Skip to content

Commit 367082d

Browse files
committed
chore: update the config for unit testing and lint
1 parent 12b1a7f commit 367082d

File tree

11 files changed

+2127
-3787
lines changed

11 files changed

+2127
-3787
lines changed

.browserslistrc

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
22
# For additional information regarding the format and rule options, please see:
33
# https://github.com/browserslist/browserslist#queries
4-
#
5-
# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
64

7-
> 0.5%
8-
last 2 versions
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 2 Chrome version
12+
last 2 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
last 2 Android major versions
917
Firefox ESR
10-
not dead
11-
not IE 9-11
18+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

.eslintrc.json

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,59 @@
1616
"createDefaultProgram": true
1717
},
1818
"extends": [
19+
"eslint:recommended",
20+
"airbnb-base",
21+
"airbnb-typescript/base",
1922
"plugin:@angular-eslint/ng-cli-compat",
2023
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
21-
"plugin:@angular-eslint/template/process-inline-templates"
24+
"plugin:@angular-eslint/template/process-inline-templates",
25+
"plugin:rxjs/recommended"
26+
],
27+
"plugins": [
28+
"rxjs-angular"
2229
],
2330
"rules": {
24-
"@typescript-eslint/consistent-type-definitions": "error",
25-
"@typescript-eslint/dot-notation": "off",
26-
"@typescript-eslint/explicit-member-accessibility": [
27-
"off",
31+
"@angular-eslint/component-class-suffix": [
32+
"error",
2833
{
29-
"accessibility": "explicit"
34+
"suffixes": [
35+
"Page",
36+
"Component"
37+
]
3038
}
3139
],
32-
"brace-style": [
40+
"@angular-eslint/component-selector": [
3341
"error",
34-
"1tbs"
42+
{
43+
"type": "element",
44+
"prefix": "app",
45+
"style": "kebab-case"
46+
}
3547
],
36-
"id-blacklist": "off",
37-
"id-match": "off",
38-
"no-underscore-dangle": "off"
48+
"@angular-eslint/directive-selector": [
49+
"error",
50+
{
51+
"type": "attribute",
52+
"prefix": "app",
53+
"style": "camelCase"
54+
}
55+
],
56+
"import/prefer-default-export": "off",
57+
"rxjs-angular/prefer-async-pipe": "off",
58+
"rxjs-angular/prefer-composition": "off",
59+
"rxjs-angular/prefer-takeuntil": "error",
60+
"@typescript-eslint/no-unused-vars": [
61+
"error",
62+
{
63+
"vars": "all",
64+
"args": "after-used",
65+
"ignoreRestSiblings": true,
66+
"varsIgnorePattern": "[iI]gnored",
67+
"argsIgnorePattern": "^_"
68+
}
69+
],
70+
"ngrx/prefer-effect-callback-in-block-statement": "off",
71+
"@typescript-eslint/explicit-function-return-type":"error"
3972
}
4073
},
4174
{
@@ -45,7 +78,17 @@
4578
"extends": [
4679
"plugin:@angular-eslint/template/recommended"
4780
],
48-
"rules": {}
81+
"rules": {
82+
"@angular-eslint/template/conditional-complexity": "error",
83+
"@angular-eslint/template/no-call-expression": "error",
84+
"@angular-eslint/template/use-track-by-function": "error",
85+
"@angular-eslint/template/cyclomatic-complexity": [
86+
"error",
87+
{
88+
"maxComplexity": 25
89+
}
90+
]
91+
}
4992
}
5093
]
5194
}

0 commit comments

Comments
 (0)