Skip to content

Commit 65ac971

Browse files
committed
🌱 add linter config
1 parent 88848b8 commit 65ac971

File tree

4 files changed

+15278
-9528
lines changed

4 files changed

+15278
-9528
lines changed

.eslintrc.json

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"root": true,
3+
"ignorePatterns": ["projects/**/*"],
4+
"plugins": ["import"],
5+
"overrides": [
6+
{
7+
"files": ["*.ts"],
8+
"parser": "@typescript-eslint/parser",
9+
"parserOptions": {
10+
"project": ["tsconfig.json"],
11+
"createDefaultProgram": true
12+
},
13+
"extends": [
14+
"eslint:recommended",
15+
"plugin:@typescript-eslint/recommended",
16+
"plugin:@angular-eslint/recommended",
17+
"plugin:@angular-eslint/template/process-inline-templates"
18+
],
19+
"rules": {
20+
"max-len": [
21+
"error",
22+
{
23+
"code": 90
24+
}
25+
],
26+
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1,"maxBOF": 0 }],
27+
"no-inferrable-types": "off",
28+
"no-console": "error",
29+
"no-debugger": "error",
30+
"semi": "error",
31+
"no-tabs": "error",
32+
"space-before-blocks": "error",
33+
"import/no-unresolved": "error",
34+
"@angular-eslint/directive-selector": [
35+
"error",
36+
{
37+
"type": "attribute",
38+
"prefix": "app",
39+
"style": "camelCase"
40+
}
41+
],
42+
"@angular-eslint/component-selector": [
43+
"error",
44+
{
45+
"type": "element",
46+
"prefix": "app",
47+
"style": "kebab-case"
48+
}
49+
],
50+
"import/order": [
51+
"error",
52+
{
53+
"alphabetize": { "order": "asc", "caseInsensitive": true },
54+
"newlines-between": "always",
55+
"groups": [ "internal", "unknown", "external", "builtin", ["parent", "sibling", "index"]],
56+
"pathGroups": [
57+
{
58+
"pattern": "@angular",
59+
"group": "internal"
60+
},
61+
{
62+
"pattern": "rxjs",
63+
"group": "unknown"
64+
},
65+
{
66+
"pattern": "rxjs/**",
67+
"group": "unknown"
68+
},
69+
{
70+
"pattern": "@services/**",
71+
"group": "builtin",
72+
"position": "before"
73+
},
74+
{
75+
"pattern": "@components/**",
76+
"group": "builtin",
77+
"position": "before"
78+
},
79+
{
80+
"pattern": "@models/**",
81+
"group": "builtin",
82+
"position": "before"
83+
},
84+
{
85+
"pattern": "@interfaces/**",
86+
"group": "builtin",
87+
"position": "before"
88+
},
89+
{
90+
"pattern": "@utils/**",
91+
"group": "builtin",
92+
"position": "before"
93+
},
94+
{
95+
"pattern": "@constants/**",
96+
"group": "builtin",
97+
"position": "before"
98+
},
99+
{
100+
"pattern": "@pipes/**",
101+
"group": "builtin",
102+
"position": "before"
103+
}
104+
],
105+
"pathGroupsExcludedImportTypes": ["type", "object"]
106+
}
107+
]
108+
},
109+
"settings": {
110+
"import/internal-regex": "@angular",
111+
"import/resolver": {
112+
"alias": true,
113+
"typescript": {
114+
"alwaysTryTypes": true
115+
}
116+
},
117+
"import/parsers": {
118+
"@typescript-eslint/parser": [".ts", ".tsx"]
119+
}
120+
}
121+
},
122+
{
123+
"files": ["*.html"],
124+
"extends": [
125+
"plugin:@angular-eslint/template/recommended"
126+
],
127+
"rules": { }
128+
},
129+
{
130+
"env": {
131+
"jasmine": true
132+
},
133+
"extends": [
134+
"plugin:jasmine/recommended"
135+
],
136+
"plugins": [
137+
"jasmine"
138+
],
139+
"files": [
140+
"**/*.spec.ts",
141+
"*.d.ts"
142+
]
143+
}
144+
]
145+
}

angular.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,21 @@
9999
],
100100
"scripts": []
101101
}
102+
},
103+
"lint": {
104+
"builder": "@angular-eslint/builder:lint",
105+
"options": {
106+
"lintFilePatterns": [
107+
"src/**/*.ts",
108+
"src/**/*.html"
109+
]
110+
}
102111
}
103112
}
104113
}
105114
},
106-
"defaultProject": "frontend"
115+
"defaultProject": "frontend",
116+
"cli": {
117+
"defaultCollection": "@angular-eslint/schematics"
118+
}
107119
}

0 commit comments

Comments
 (0)