Skip to content

Commit d86078e

Browse files
committed
feat install prietter, eslint and fortatation code
1 parent bd5eea5 commit d86078e

93 files changed

Lines changed: 3626 additions & 2398 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package.json
2+
package-lock.json
3+
dist
4+
node_modules

.prettierrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"singleQuote": true,
6+
"trailingComma": "all",
7+
"semi": true,
8+
"bracketSpacing": true,
9+
"arrowParens": "always",
10+
"endOfLine": "auto",
11+
"htmlWhitespaceSensitivity": "ignore",
12+
"embeddedLanguageFormatting": "auto"
13+
}

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ View your app in AI Studio: https://ai.studio/apps/c9f95229-05dc-4fcb-bfac-ba83f
1010

1111
## Run Locally
1212

13-
**Prerequisites:** Node.js
14-
13+
**Prerequisites:** Node.js
1514

1615
1. Install dependencies:
1716
`npm install`

angular.json

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"version": 1,
44
"cli": {
55
"packageManager": "npm",
6-
"schematicCollections": [
7-
"angular-eslint"
8-
],
6+
"schematicCollections": ["angular-eslint"],
97
"analytics": "169ed763-2250-4e49-a165-52c8e18688e7"
108
},
119
"newProjectRoot": "projects",
@@ -28,9 +26,7 @@
2826
"input": "public"
2927
}
3028
],
31-
"styles": [
32-
"src/styles.css"
33-
],
29+
"styles": ["src/styles.css"],
3430
"server": "src/main.server.ts",
3531
"outputMode": "server",
3632
"ssr": {
@@ -39,6 +35,13 @@
3935
},
4036
"configurations": {
4137
"production": {
38+
"outputHashing": "all",
39+
"fileReplacements": [
40+
{
41+
"replace": "src/environments/environment.ts",
42+
"with": "src/environments/environment.production.ts"
43+
}
44+
],
4245
"budgets": [
4346
{
4447
"type": "initial",
@@ -50,13 +53,18 @@
5053
"maximumWarning": "4kB",
5154
"maximumError": "8kB"
5255
}
53-
],
54-
"outputHashing": "all"
56+
]
5557
},
5658
"development": {
5759
"optimization": false,
5860
"extractLicenses": false,
59-
"sourceMap": true
61+
"sourceMap": true,
62+
"fileReplacements": [
63+
{
64+
"replace": "src/environments/environment.ts",
65+
"with": "src/environments/environment.development.ts"
66+
}
67+
]
6068
}
6169
},
6270
"defaultConfiguration": "production"
@@ -79,10 +87,7 @@
7987
"lint": {
8088
"builder": "@angular-eslint/builder:lint",
8189
"options": {
82-
"lintFilePatterns": [
83-
"src/**/*.ts",
84-
"src/**/*.html"
85-
]
90+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
8691
}
8792
}
8893
}

eslint.config.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
// @ts-check
1+
// @ts-nocheck
22
const eslint = require('@eslint/js');
3-
const {defineConfig} = require('eslint/config');
43
const tseslint = require('typescript-eslint');
54
const angular = require('angular-eslint');
5+
const prettierPlugin = require('eslint-plugin-prettier');
6+
const prettierConfig = require('eslint-config-prettier');
67

7-
module.exports = defineConfig([
8+
module.exports = tseslint.config(
89
{
910
files: ['**/*.ts'],
1011
extends: [
1112
eslint.configs.recommended,
12-
tseslint.configs.recommended,
13-
tseslint.configs.stylistic,
14-
angular.configs.tsRecommended,
13+
...tseslint.configs.recommended,
14+
...tseslint.configs.stylistic,
15+
...angular.configs.tsRecommended,
16+
prettierConfig,
1517
],
18+
plugins: {
19+
prettier: prettierPlugin,
20+
},
1621
processor: angular.processInlineTemplates,
1722
rules: {
1823
'@angular-eslint/directive-selector': [
@@ -31,14 +36,18 @@ module.exports = defineConfig([
3136
style: 'kebab-case',
3237
},
3338
],
39+
'prettier/prettier': [
40+
'error',
41+
{
42+
endOfLine: 'auto',
43+
},
44+
],
45+
'@typescript-eslint/no-explicit-any': 'error', // Forbid usage of 'any'
3446
},
3547
},
3648
{
3749
files: ['**/*.html'],
38-
extends: [
39-
angular.configs.templateRecommended,
40-
angular.configs.templateAccessibility,
41-
],
50+
extends: [...angular.configs.templateRecommended, ...angular.configs.templateAccessibility],
4251
rules: {},
43-
}
44-
]);
52+
},
53+
);

0 commit comments

Comments
 (0)