Skip to content

Commit acf6431

Browse files
committed
🌱 add linter config
1 parent 4691e25 commit acf6431

File tree

4 files changed

+5629
-1971
lines changed

4 files changed

+5629
-1971
lines changed

.eslintrc.json

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
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": 100
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+
"position": "before"
65+
},
66+
{
67+
"pattern": "rxjs/**",
68+
"group": "unknown",
69+
"position": "before"
70+
},
71+
{
72+
"pattern": "sweetalert",
73+
"group": "unknown",
74+
"position": "before"
75+
},
76+
{
77+
"pattern": "ng-apexcharts",
78+
"group": "unknown",
79+
"position": "before"
80+
},
81+
{
82+
"pattern": "ng-apexcharts/**",
83+
"group": "unknown",
84+
"position": "before"
85+
},
86+
{
87+
"pattern": "@faker-js/**",
88+
"group": "builtin",
89+
"position": "before"
90+
},
91+
{
92+
"pattern": "@services/**",
93+
"group": "builtin",
94+
"position": "before"
95+
},
96+
{
97+
"pattern": "@components/**",
98+
"group": "builtin",
99+
"position": "before"
100+
},
101+
{
102+
"pattern": "@models/**",
103+
"group": "builtin",
104+
"position": "before"
105+
},
106+
{
107+
"pattern": "@interfaces/**",
108+
"group": "builtin",
109+
"position": "before"
110+
},
111+
{
112+
"pattern": "@guards/**",
113+
"group": "builtin",
114+
"position": "before"
115+
},
116+
{
117+
"pattern": "@utils/**",
118+
"group": "builtin",
119+
"position": "before"
120+
},
121+
{
122+
"pattern": "@constants/**",
123+
"group": "builtin",
124+
"position": "before"
125+
},
126+
{
127+
"pattern": "@pipes/**",
128+
"group": "builtin",
129+
"position": "before"
130+
},
131+
{
132+
"pattern": "@enums/**",
133+
"group": "builtin",
134+
"position": "before"
135+
},
136+
{
137+
"pattern": "@customTypes/**",
138+
"group": "builtin",
139+
"position": "before"
140+
},
141+
{
142+
"pattern": "@mocks/**",
143+
"group": "builtin",
144+
"position": "before"
145+
}
146+
],
147+
"pathGroupsExcludedImportTypes": ["type", "object"]
148+
}
149+
]
150+
},
151+
"settings": {
152+
"import/internal-regex": "@angular",
153+
"import/resolver": {
154+
"alias": true,
155+
"typescript": {
156+
"alwaysTryTypes": true
157+
}
158+
},
159+
"import/parsers": {
160+
"@typescript-eslint/parser": [".ts", ".tsx"]
161+
}
162+
}
163+
},
164+
{
165+
"files": ["*.html"],
166+
"extends": [
167+
"plugin:@angular-eslint/template/recommended"
168+
],
169+
"rules": { }
170+
},
171+
{
172+
"env": {
173+
"jasmine": true
174+
},
175+
"extends": [
176+
"plugin:jasmine/recommended"
177+
],
178+
"plugins": [
179+
"jasmine"
180+
],
181+
"files": [
182+
"**/*.spec.ts",
183+
"*.d.ts"
184+
],
185+
"rules": {
186+
"jasmine/no-focused-tests": "error",
187+
"jasmine/no-disabled-tests": [
188+
"error",
189+
{
190+
"checkDescribe": true,
191+
"checkContext": true,
192+
"checkIt": true,
193+
"checkXit": true,
194+
"checkXdescribe": true
195+
}
196+
],
197+
"jasmine/new-line-before-expect": "error"
198+
}
199+
}
200+
]
201+
}

angular.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
"src/favicon.ico",
3131
"src/assets"
3232
],
33+
"stylePreprocessorOptions": {
34+
"includePaths": [
35+
"src/assets/scss"
36+
]
37+
},
3338
"styles": [
3439
"src/styles.scss"
3540
],
@@ -103,9 +108,21 @@
103108
],
104109
"scripts": []
105110
}
111+
},
112+
"lint": {
113+
"builder": "@angular-eslint/builder:lint",
114+
"options": {
115+
"lintFilePatterns": [
116+
"src/**/*.ts",
117+
"src/**/*.html"
118+
]
119+
}
106120
}
107121
}
108122
}
109123
},
110-
"defaultProject": "frontend"
124+
"defaultProject": "frontend",
125+
"cli": {
126+
"defaultCollection": "@angular-eslint/schematics"
127+
}
111128
}

0 commit comments

Comments
 (0)