Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

34299da時点でのdiff #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
"outputPath": "dist/angular-ngrx-eslint-template",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
Expand All @@ -31,9 +29,7 @@
"input": "public"
}
],
"styles": [
"src/styles.scss"
],
"styles": ["src/styles.scss"],
"scripts": []
},
"configurations": {
Expand Down Expand Up @@ -78,10 +74,7 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": [
Expand All @@ -90,9 +83,7 @@
"input": "public"
}
],
"styles": [
"src/styles.scss"
],
"styles": ["src/styles.scss"],
"scripts": []
}
}
Expand Down
179 changes: 87 additions & 92 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,170 +1,165 @@
import eslint from '@eslint/js';
import tsEslint from 'typescript-eslint';
import angular from 'angular-eslint';
import gitignore from 'eslint-config-flat-gitignore'
import gitignore from 'eslint-config-flat-gitignore';
import ngrx from '@ngrx/eslint-plugin/v9/index.js';
import stylisticJs from '@stylistic/eslint-plugin-js'
import eslintConfigPrettier from "eslint-config-prettier";
import stylisticJs from '@stylistic/eslint-plugin-js';
import eslintConfigPrettier from 'eslint-config-prettier';

export default tsEslint.config(
gitignore(),
eslintConfigPrettier,
// eslint typescript-eslint recommended config
{
files : [ '**/*.ts' ],
languageOptions : {
parser : tsEslint.parser,
parserOptions : {
project: './tsconfig.json',
files: ['**/*.ts'],
languageOptions: {
parser: tsEslint.parser,
parserOptions: {
project: './tsconfig.json'
}
},
extends: [
eslint.configs.recommended,
...tsEslint.configs.strict,
...tsEslint.configs.stylistic,
],
...tsEslint.configs.stylistic
]
},

// eslint stylistic
{
files:['**/*.ts'],
files: ['**/*.ts'],
plugins: {
'@stylistic/js': stylisticJs,
'@stylistic/js': stylisticJs
},
rules: {
'@stylistic/js/array-bracket-spacing' : [ "error", "always" ],
'@stylistic/js/arrow-spacing' : 'error',
'@stylistic/js/block-spacing' : 'error',
'@stylistic/js/array-bracket-newline' : [ "error", "consistent" ],
'@stylistic/js/brace-style' : [
"error",
"1tbs",
'@stylistic/js/array-bracket-spacing': ['error', 'always'],
'@stylistic/js/arrow-spacing': 'error',
'@stylistic/js/block-spacing': 'error',
'@stylistic/js/array-bracket-newline': ['error', 'consistent'],
'@stylistic/js/brace-style': [
'error',
'1tbs',
{
"allowSingleLine": true
allowSingleLine: true
}
],
'@stylistic/js/comma-style' : [ "error", "last" ],
'@stylistic/js/dot-location' : [ "error", "object" ],
"indent" : [ "error", 2 ],
"@stylistic/js/key-spacing" : [ "error", {
"multiLine": {
"beforeColon" : false,
"afterColon" : true

},
"align": {
"beforeColon" : true,
"afterColon" : true,
"on" : "colon"
'@stylistic/js/comma-style': ['error', 'last'],
'@stylistic/js/dot-location': ['error', 'object'],
indent: ['error', 2],
'@stylistic/js/key-spacing': [
'error',
{
multiLine: {
beforeColon: false,
afterColon: true
},
align: {
beforeColon: true,
afterColon: true,
on: 'colon'
}
}
} ],
"@stylistic/js/max-len" : [ "error", { "code": 80 } ],
"@stylistic/js/multiline-ternary" : [ "error", "always" ],
],
'@stylistic/js/max-len': ['error', { code: 80 }],
'@stylistic/js/multiline-ternary': ['error', 'always']
}
},

// eslint config
{
files : [ "**/*.ts" ],
rules : {
quotes : [ "error", "single" ],
'quote-props' : [ 'error', 'consistent-as-needed', { 'keywords': true } ],
'object-shorthand' : [ 'error', 'always', { 'avoidQuotes': true } ],
files: ['**/*.ts'],
rules: {
quotes: ['error', 'single'],
'quote-props': ['error', 'consistent-as-needed', { keywords: true }],
'object-shorthand': ['error', 'always', { avoidQuotes: true }]
}
},

// typescript-eslint config
{
files : [ "**/*.ts" ],
rules : {
'@typescript-eslint/explicit-function-return-type' : 'error',
"@typescript-eslint/prefer-for-of" : "error",
"@typescript-eslint/consistent-type-definitions" : [
"error",
"type"
],
"@typescript-eslint/naming-convention": [
"error",
files: ['**/*.ts'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/naming-convention': [
'error',
{
selector : [ "parameter" ],
format : [ "camelCase" ]
selector: ['parameter'],
format: ['camelCase']
},
{
selector : [ "interface" ],
format : [ "PascalCase" ],
prefix : [ "I" ],
selector: ['interface'],
format: ['PascalCase'],
prefix: ['I']
}
]
}
},

// api file config
{
files : [ "**/*.api.ts " ],
rules : {
"@typescript-eslint/naming-convention": [
"error",
files: ['**/*.api.ts '],
rules: {
'@typescript-eslint/naming-convention': [
'error',
{
selector : [ "class" ],
format : [ "PascalCase" ],
suffix : [ "API" ],
selector: ['class'],
format: ['PascalCase'],
suffix: ['API']
},
{
selector : [ "classMethod" ],
format : [ "camelCase" ],
selector: ['classMethod'],
format: ['camelCase']
}
]
}
},

// service file config
{
files : [ "**/*.service.ts " ],
rules : {
"@typescript-eslint/naming-convention": [
"error",
files: ['**/*.service.ts '],
rules: {
'@typescript-eslint/naming-convention': [
'error',
{
selector : [ "class" ],
format : [ "PascalCase" ],
suffix : [ "SERVICE" ],
selector: ['class'],
format: ['PascalCase'],
suffix: ['SERVICE']
},
{
selector : "classMethod",
format : [ "camelCase" ],
selector: 'classMethod',
format: ['camelCase']
}
]
}
},

// angular ts config
{
files : [ '**/*.ts' ],
extends : [
...angular.configs.tsRecommended,
],
processor : angular.processInlineTemplates,
rules : {
'@angular-eslint/no-input-rename': 'off',
},
files: ['**/*.ts'],
extends: [...angular.configs.tsRecommended],
processor: angular.processInlineTemplates,
rules: {
'@angular-eslint/no-input-rename': 'off'
}
},

// angular html config
{
files : [ '**/*.html' ],
extends : [
files: ['**/*.html'],
extends: [
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
...angular.configs.templateAccessibility
],
rules: {
'@angular-eslint/template/no-negated-async': 'off',
},
'@angular-eslint/template/no-negated-async': 'off'
}
},

// ngrx config
{
files : [ "**/*.ts" ],
extends : [
...ngrx.configs.all,
]
files: ['**/*.ts'],
extends: [...ngrx.configs.all]
}
)
);
64 changes: 44 additions & 20 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,18 @@

--pill-accent: var(--bright-blue);

font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol";
font-family:
'Inter',
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Helvetica,
Arial,
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol';
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand All @@ -51,9 +60,18 @@
line-height: 100%;
letter-spacing: -0.125rem;
margin: 0;
font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol";
font-family:
'Inter Tight',
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Helvetica,
Arial,
sans-serif,
'Apple Color Emoji',
'Segoe UI Emoji',
'Segoe UI Symbol';
}

p {
Expand Down Expand Up @@ -231,19 +249,26 @@ <h1>Hello, {{ title }}</h1>
<div class="divider" role="separator" aria-label="Divider"></div>
<div class="right-side">
<div class="pill-group">
@for (item of [
{ title: 'Explore the Docs', link: 'https://angular.dev' },
{ title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' },
{ title: 'CLI Docs', link: 'https://angular.dev/tools/cli' },
{ title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' },
{ title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' },
]; track item.title) {
<a
class="pill"
[href]="item.link"
target="_blank"
rel="noopener"
>
@for (
item of [
{ title: 'Explore the Docs', link: 'https://angular.dev' },
{
title: 'Learn with Tutorials',
link: 'https://angular.dev/tutorials'
},
{ title: 'CLI Docs', link: 'https://angular.dev/tools/cli' },
{
title: 'Angular Language Service',
link: 'https://angular.dev/tools/language-service'
},
{
title: 'Angular DevTools',
link: 'https://angular.dev/tools/devtools'
}
];
track item.title
) {
<a class="pill" [href]="item.link" target="_blank" rel="noopener">
<span>{{ item.title }}</span>
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -332,5 +357,4 @@ <h1>Hello, {{ title }}</h1>
<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * * -->
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->


<router-outlet />
Loading