-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
74 lines (74 loc) · 2.25 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
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['*.ts'],
excludedFiles: ['*.spec.ts', '*.d.ts'],
parserOptions: {
project: ['tsconfig.json', 'tsconfig.spec.json', 'tsconfig.server.json', 'e2e/tsconfig.json'],
createDefaultProgram: true,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@angular-eslint/recommended',
'plugin:@angular-eslint/template/process-inline-templates',
],
rules: {
// Note: you must disable the base rule as it can report incorrect errors
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', {args: 'after-used'}],
'@typescript-eslint/no-explicit-any': 'error',
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'app',
style: 'camelCase',
},
],
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'app',
style: 'kebab-case',
},
],
// Allow Angular Life Cycle empty methods and empty constructor
'@angular-eslint/no-empty-lifecycle-method': 'off',
'@typescript-eslint/no-empty-function': ['error', {allow: ['constructors', 'methods']}],
'no-empty-function': ['error', {allow: ['constructors', 'methods']}],
indent: 'off',
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'no-eval': 'error',
'no-extra-semi': 'error',
'no-duplicate-imports': 'error',
'no-debugger': 'error',
'getter-return': 'error',
'no-cond-assign': 'error',
'no-const-assign': 'error',
'no-compare-neg-zero': 'error',
'no-dupe-args': 'error',
'no-dupe-else-if': 'error',
'no-unreachable': 'error',
},
},
{
files: ['*.html'],
extends: ['plugin:@angular-eslint/template/recommended'],
rules: {},
},
],
};