Skip to content

Commit c9e57e8

Browse files
committed
build(eslint): replacing tslint help-me-mom#723
1 parent 6577c47 commit c9e57e8

File tree

508 files changed

+6509
-1752
lines changed

Some content is hidden

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

508 files changed

+6509
-1752
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
name: Lint commits
4040
command: npx commitlint --from=origin/master
4141
- run:
42-
name: Lint tslint
43-
command: npm run lint
42+
name: Lint code style
43+
command: npm run lint -- --ignore-pattern e2e/
4444
- run:
4545
name: Lint typescript
4646
command: npm run ts:check

.eslintignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CHANGELOG.md
2+
3+
dist/
4+
docs/**/*.md
5+
docs/.docusaurus
6+
e2e/*/.angular
7+
e2e/*/src/test
8+
e2e/nx/apps/*/src/test
9+
e2e/nx/decorate-angular-cli.js
10+
node_modules/
11+
test-reports/
12+
tests-e2e/.angular
13+
tests-failures/
14+
tmp/

.eslintrc.yml

+224
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
root: true
2+
3+
plugins:
4+
- '@typescript-eslint'
5+
- 'json'
6+
- 'unused-imports'
7+
- 'prefer-arrow'
8+
- 'unicorn'
9+
- 'es-roikoren'
10+
11+
settings:
12+
import/resolver:
13+
typescript:
14+
project:
15+
- ./tsconfig.json
16+
- ./tests-e2e/tsconfig.json
17+
- ./e2e/a5es5/tsconfig.json
18+
- ./e2e/a5es2015/tsconfig.json
19+
- ./e2e/a6/tsconfig.json
20+
- ./e2e/a7/tsconfig.json
21+
- ./e2e/a8/tsconfig.json
22+
- ./e2e/a9/tsconfig.json
23+
- ./e2e/a10/tsconfig.json
24+
- ./e2e/a11/tsconfig.json
25+
- ./e2e/a12/tsconfig.json
26+
- ./e2e/a13/tsconfig.json
27+
- ./e2e/a14/tsconfig.json
28+
- ./e2e/a-jasmine/tsconfig.json
29+
- ./e2e/a-jest/tsconfig.json
30+
- ./e2e/a-min/tsconfig.json
31+
- ./e2e/nx/apps/a-nx/tsconfig.json
32+
es-roikoren:
33+
aggressive: true
34+
35+
overrides:
36+
- files:
37+
- '*.ts'
38+
- '*.js'
39+
parser: '@typescript-eslint/parser'
40+
parserOptions:
41+
project:
42+
- ./tsconfig.json
43+
- ./tests-e2e/tsconfig.json
44+
- ./e2e/a5es5/tsconfig.json
45+
- ./e2e/a5es2015/tsconfig.json
46+
- ./e2e/a6/tsconfig.json
47+
- ./e2e/a7/tsconfig.json
48+
- ./e2e/a8/tsconfig.json
49+
- ./e2e/a9/tsconfig.json
50+
- ./e2e/a10/tsconfig.json
51+
- ./e2e/a11/tsconfig.json
52+
- ./e2e/a12/tsconfig.json
53+
- ./e2e/a13/tsconfig.json
54+
- ./e2e/a14/tsconfig.json
55+
- ./e2e/a-jasmine/tsconfig.json
56+
- ./e2e/a-jest/tsconfig.json
57+
- ./e2e/a-min/tsconfig.json
58+
- ./e2e/nx/apps/a-nx/tsconfig.json
59+
extends:
60+
- 'eslint:recommended'
61+
- 'plugin:@typescript-eslint/recommended'
62+
- 'plugin:@angular-eslint/recommended'
63+
- 'plugin:@angular-eslint/template/process-inline-templates'
64+
- 'plugin:unicorn/recommended'
65+
- 'plugin:import/recommended'
66+
- 'plugin:import/typescript'
67+
- 'plugin:prettier/recommended'
68+
rules:
69+
arrow-parens: off
70+
arrow-body-style: off
71+
spaced-comment:
72+
- error
73+
- always
74+
complexity:
75+
- error
76+
- 25
77+
unicorn/filename-case:
78+
- error
79+
- case: kebabCase
80+
max-lines:
81+
- error
82+
- 500
83+
max-lines-per-function:
84+
- error
85+
- 100
86+
87+
unicorn/no-array-callback-reference: off
88+
unicorn/no-array-method-this-argument: off
89+
unicorn/no-for-loop: off
90+
unicorn/no-null: off
91+
unicorn/no-useless-undefined: off
92+
unicorn/prefer-module: off
93+
unicorn/prefer-set-has: off
94+
unicorn/prefer-switch: off
95+
unicorn/prefer-type-error: off
96+
unicorn/prevent-abbreviations: off
97+
unicorn/prefer-includes: off
98+
unicorn/prefer-array-flat: off
99+
unicorn/prefer-spread: off
100+
es-roikoren/no-array-from: error
101+
es-roikoren/no-array-isarray: off
102+
es-roikoren/no-array-of: error
103+
es-roikoren/no-array-prototype-copywithin: error
104+
es-roikoren/no-array-prototype-entries: error
105+
es-roikoren/no-array-prototype-every: error
106+
es-roikoren/no-array-prototype-fill: off
107+
es-roikoren/no-array-prototype-filter: off
108+
es-roikoren/no-array-prototype-find: error
109+
es-roikoren/no-array-prototype-findindex: error
110+
es-roikoren/no-array-prototype-flat: error
111+
es-roikoren/no-array-prototype-foreach: error
112+
es-roikoren/no-array-prototype-includes: error
113+
es-roikoren/no-array-prototype-indexof: off
114+
es-roikoren/no-array-prototype-keys: error
115+
es-roikoren/no-array-prototype-lastindexof: error
116+
es-roikoren/no-array-prototype-map: off
117+
es-roikoren/no-array-prototype-reduce: error
118+
es-roikoren/no-array-prototype-reduceright: error
119+
es-roikoren/no-array-prototype-some: off
120+
es-roikoren/no-array-prototype-values: error
121+
es-roikoren/no-array-string-prototype-at: error
122+
123+
no-alert: error
124+
no-console:
125+
- error
126+
- allow:
127+
- error
128+
- warn
129+
no-debugger: error
130+
no-restricted-globals:
131+
- error
132+
- fit
133+
- fdescribe
134+
- xit
135+
- xdescribe
136+
semi:
137+
- error
138+
- always
139+
quotes:
140+
- error
141+
- single
142+
- avoidEscape: true
143+
allowTemplateLiterals: true
144+
sort-imports:
145+
- error
146+
- ignoreCase: true
147+
ignoreDeclarationSort: true
148+
allowSeparatedGroups: true
149+
import/order:
150+
- error
151+
- newlines-between: always
152+
groups:
153+
- builtin
154+
- external
155+
- internal
156+
- index
157+
- parent
158+
- sibling
159+
'@angular-eslint/no-input-rename': off
160+
'@angular-eslint/no-output-rename': off
161+
'@typescript-eslint/no-explicit-any': off
162+
'@typescript-eslint/no-unused-vars': error
163+
unused-imports/no-unused-imports: error
164+
prefer-arrow/prefer-arrow-functions:
165+
- error
166+
- allowStandaloneDeclarations: true
167+
168+
- files:
169+
- '*.spec.ts'
170+
rules:
171+
max-lines: off
172+
max-lines-per-function: off
173+
unicorn/consistent-function-scoping: off
174+
175+
- files:
176+
- '*.js'
177+
parser: 'espree'
178+
env:
179+
node: true
180+
rules:
181+
unicorn/prefer-module: off
182+
183+
- files:
184+
- 'decorate-angular-cli.js'
185+
- 'jest.config.js'
186+
- 'jest.preset.js'
187+
- 'karma.conf.js'
188+
- 'webpack.config.js'
189+
rules:
190+
'@typescript-eslint/no-var-requires': off
191+
'prefer-arrow/prefer-arrow-functions': off
192+
193+
- files:
194+
- '*.html'
195+
parser: '@angular-eslint/template-parser'
196+
extends:
197+
- 'plugin:@angular-eslint/template/recommended'
198+
199+
- files:
200+
- '*.json'
201+
extends:
202+
- 'plugin:json/recommended'
203+
- 'plugin:prettier/recommended'
204+
205+
- files:
206+
- '*.md'
207+
extends:
208+
- 'plugin:mdx/recommended'
209+
- 'plugin:prettier/recommended'
210+
211+
- files:
212+
- 'tsconfig.json'
213+
- 'tsconfig.*.json'
214+
extends:
215+
- 'plugin:json/recommended-with-comments'
216+
- 'plugin:prettier/recommended'
217+
218+
- files:
219+
- '*.yaml'
220+
- '*.yml'
221+
parser: 'yaml-eslint-parser'
222+
extends:
223+
- 'plugin:yml/prettier'
224+
- 'plugin:prettier/recommended'

.lintstagedrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
return [];
1010
}
1111

12-
commands.push(`prettier -u -w ${files.join(' ')}`);
12+
commands.push(`eslint --fix ${files.join(' ')}`);
1313

1414
return commands;
1515
},

.prettierignore

+3-14
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,9 @@ CHANGELOG.md
33
dist/
44
docs/**/*.md
55
docs/.docusaurus
6-
e2e/**/.angular
7-
e2e/a10/src/test
8-
e2e/a11/src/test
9-
e2e/a12/src/test
10-
e2e/a13/src/test
11-
e2e/a14/src/test
12-
e2e/a5es2015/src/test
13-
e2e/a5es5/src/test
14-
e2e/a6/src/test
15-
e2e/a7/src/test
16-
e2e/a8/src/test
17-
e2e/a9/src/test
18-
e2e/a-min/src/test
19-
e2e/nx/apps/a-nx/src/test
6+
e2e/*/.angular
7+
e2e/*/src/test
8+
e2e/nx/apps/*/src/test
209
node_modules/
2110
tests-e2e/.angular
2211
test-reports/

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ An example of it is:
5858
```dotenv
5959
GH_TOKEN=123123123
6060
NPM_TOKEN=123123123
61-
GIT_AUTHOR_NAME=Best Coder
61+
GIT_AUTHOR_NAME="Best Coder"
6262
63-
GIT_COMMITTER_NAME=Best Coder
63+
GIT_COMMITTER_NAME="Best Coder"
6464
6565
```
6666

e2e/a-jasmine/src/app/app.component.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
MockRenderFactory,
55
ngMocks,
66
} from 'ng-mocks';
7+
78
import { AppComponent } from './app.component';
89
import { AppModule } from './app.module';
910
import { AppService } from './app.service';

e2e/a-jasmine/src/app/app.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Input } from '@angular/core';
2-
import { ChangeDetectionStrategy, Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
2+
33
import { AppService } from './app.service';
44

55
@Component({

e2e/a-jasmine/src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ enableProdMode();
66

77
platformBrowserDynamic()
88
.bootstrapModule(AppModule)
9-
.catch(err => console.error(err));
9+
.catch(error => console.error(error));

e2e/a-jasmine/src/polyfills.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Learn more in https://angular.io/guide/browser-support
1515
*/
1616

17-
/***************************************************************************************************
17+
/**
1818
* BROWSER POLYFILLS
1919
*/
2020

@@ -54,11 +54,11 @@
5454
*
5555
*/
5656

57-
/***************************************************************************************************
57+
/**
5858
* Zone JS is required by default for Angular itself.
5959
*/
6060
import 'zone.js'; // Included with Angular CLI.
6161

62-
/***************************************************************************************************
62+
/**
6363
* APPLICATION IMPORTS
6464
*/

e2e/a-jasmine/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
"strictInputAccessModifiers": true,
2626
"strictTemplates": true
2727
},
28-
"files": ["src/test.ts", "src/polyfills.ts"],
28+
"files": ["src/main.ts", "src/polyfills.ts", "src/test.ts"],
2929
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
3030
}

e2e/a-jest/src/app/app.component.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
MockRenderFactory,
55
ngMocks,
66
} from 'ng-mocks';
7+
78
import { AppComponent } from './app.component';
89
import { AppModule } from './app.module';
910
import { AppService } from './app.service';

e2e/a-jest/src/app/app.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Input } from '@angular/core';
2-
import { ChangeDetectionStrategy, Component } from '@angular/core';
1+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
2+
33
import { AppService } from './app.service';
44

55
@Component({

e2e/a-jest/src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ enableProdMode();
66

77
platformBrowserDynamic()
88
.bootstrapModule(AppModule)
9-
.catch(err => console.error(err));
9+
.catch(error => console.error(error));

e2e/a-jest/src/polyfills.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Learn more in https://angular.io/guide/browser-support
1515
*/
1616

17-
/***************************************************************************************************
17+
/**
1818
* BROWSER POLYFILLS
1919
*/
2020

@@ -54,11 +54,11 @@
5454
*
5555
*/
5656

57-
/***************************************************************************************************
57+
/**
5858
* Zone JS is required by default for Angular itself.
5959
*/
6060
import 'zone.js/dist/zone'; // Included with Angular CLI.
6161

62-
/***************************************************************************************************
62+
/**
6363
* APPLICATION IMPORTS
6464
*/

0 commit comments

Comments
 (0)