-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
136 lines (136 loc) · 5.42 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
125
126
127
128
129
130
131
132
133
134
135
136
module.exports = {
'root': true,
'overrides': [
{
'files': [
'**/*.html',
],
'parser': '@angular-eslint/template-parser',
'extends': [
'plugin:@angular-eslint/recommended',
'plugin:@angular-eslint/template/process-inline-templates',
],
'rules': {
'sort-imports-es6-autofix/sort-imports-es6': 'off',
},
},
{
'files': [
'**/*.ts',
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
project: 'tsconfig.json',
sourceType: 'module',
createDefaultProgram: true,
},
'env': {
node: true,
jest: true,
},
'extends': [
'google',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
'plugins': [
'@typescript-eslint/eslint-plugin',
'sort-imports-es6-autofix',
],
'rules': {
'@typescript-eslint/no-empty-function': ['error', { 'allow': ['constructors'] }],
'@typescript-eslint/no-unused-vars': ['warn', { 'argsIgnorePattern': '^_' }],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/quotes': ['error', 'single'],
'no-extra-parens': 'error',
'require-atomic-updates': 'error',
'block-scoped-var': 'error',
'default-param-last': 'error',
'default-case-last': 'error',
'eqeqeq': 'error',
'no-lone-blocks': 'error',
'no-return-await': 'error',
'no-use-before-define': 'error',
'block-spacing': 'error',
'function-call-argument-newline': ['error', 'consistent'],
'max-len': ['error', {
code: 120,
tabWidth: 4,
ignoreUrls: true,
}],
'no-inline-comments': 'error',
'no-whitespace-before-property': 'error',
'object-curly-spacing': ['error', 'always'],
'operator-linebreak': ['error', 'after', {
'overrides': {
'?': 'before',
':': 'before',
},
}],
'space-in-parens': ['error', 'never'],
'no-duplicate-imports': 'error',
'no-useless-computed-key': 'error',
'no-useless-rename': 'error',
// see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md
'indent': 'off',
// see https://github.com/typescript-eslint/typescript-eslint/issues/1824#issuecomment-957559729
// indent rules are broken for decorators
'@typescript-eslint/indent': [
'error',
4,
{
'SwitchCase': 1,
'ignoredNodes': [
'FunctionExpression > .params[decorators.length > 0]',
'FunctionExpression > .params > :matches(Decorator, :not(:first-child))',
'ClassBody.body > PropertyDefinition[decorators.length > 0] > .key',
],
},
],
'new-cap': 'off',
'require-jsdoc': 'off',
// see https://github.com/marudor/eslint-plugin-sort-imports-es6-autofix/blob/master/README.md
'sort-imports-es6-autofix/sort-imports-es6': ['error', {
'memberSyntaxSortOrder': ['none', 'all', 'single', 'multiple'],
}],
'no-restricted-imports': [
'warn',
{
'patterns': [
{
'group': ['.*'],
'message': 'Don\'t use relative path imports!',
},
],
}
],
'spaced-comment': ['error', 'always', {
'line': {
'markers': ['#region', '#endregion', 'region', 'endregion'],
},
},
],
'@angular-eslint/directive-selector': [
'error',
{
'type': 'attribute',
'prefix': 'app',
'style': 'camelCase',
},
],
'@angular-eslint/component-selector': [
'error',
{
'type': 'element',
'prefix': 'app',
'style': 'kebab-case',
},
],
},
},
],
'ignorePatterns': ['node_modules', 'dist', '**/index.ts'],
};