-
Notifications
You must be signed in to change notification settings - Fork 309
/
.eslintrc.js
124 lines (123 loc) · 3.86 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
const baseJsTsConfig = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.eslint.json',
sourceType: 'module',
},
rules: {
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-use-before-define': ['error', { classes: false, functions: false }],
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/prefer-readonly': 'error',
curly: ['error', 'all'],
'import/default': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-relative-packages': 'off',
'import/no-unresolved': 'off',
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
},
groups: ['builtin', 'external', ['internal', 'parent', 'sibling']],
'newlines-between': 'always',
},
],
'import/prefer-default-export': 'off',
'no-console': 'off',
'no-empty-function': 'off',
'no-plusplus': 'off',
'no-shadow': 'off',
'no-underscore-dangle': 'off',
'no-use-before-define': 'off',
'no-useless-constructor': 'off',
'padding-line-between-statements': [
'error',
{
blankLine: 'always',
prev: '*',
next: 'return',
},
],
'prettier/prettier': [
'error',
{
singleAttributePerLine: true,
printWidth: 120,
singleQuote: true,
tabWidth: 4,
semi: true,
trailingComma: 'all',
parser: 'typescript',
},
],
},
};
module.exports = {
env: {
node: true,
es2020: true,
},
overrides: [
{
...baseJsTsConfig,
files: ['*.ts', '*.js', '*.mts'],
extends: [
'plugin:@angular-eslint/recommended',
'plugin:@angular-eslint/template/process-inline-templates',
...baseJsTsConfig.extends,
],
rules: {
...baseJsTsConfig.rules,
'@angular-eslint/component-class-suffix': 'off',
'@angular-eslint/component-selector': 'off',
'@angular-eslint/directive-selector': 'off',
'@angular-eslint/no-input-rename': 'off',
},
},
{
files: ['*.html'],
parser: '@angular-eslint/template-parser',
extends: [
'plugin:@angular-eslint/template/recommended',
'plugin:@angular-eslint/template/accessibility',
'plugin:prettier/recommended',
],
rules: {
'prettier/prettier': [
'error',
{
singleAttributePerLine: true,
printWidth: 120,
tabWidth: 4,
semi: false,
parser: 'angular',
},
],
},
},
{
...baseJsTsConfig,
files: ['*.js'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{
...baseJsTsConfig,
files: ['*.spec.ts', 'e2e/**/__tests__/**/*.js'],
extends: ['plugin:jest/recommended', ...baseJsTsConfig.extends],
},
],
};