-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
95 lines (95 loc) · 2.53 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
module.exports = {
/**
* See packages/eslint-plugin/src/configs/README.md
* for what this recommended config contains.
*/
env: {
es6: true,
browser: true,
node: true,
},
extends: [
'plugin:@angular-eslint/recommended',
],
rules: {
// ORIGINAL tslint.json -> "directive-selector": [true, "attribute", "app", "camelCase"],
'@angular-eslint/directive-selector': [
'error',
{ type: 'attribute', prefix: 'app', style: 'camelCase' },
],
// ORIGINAL tslint.json -> "component-selector": [true, "element", "app", "kebab-case"],
'@angular-eslint/component-selector': [
'error',
{ type: 'element', prefix: 'app', style: 'kebab-case' },
],
},
overrides: [
/**
* This extra piece of configuration is only necessary if you make use of inline
* templates within Component metadata, e.g.:
*/
{
files: ['*.component.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['@angular-eslint/template'],
processor: '@angular-eslint/template/extract-inline-html',
},
// Custom rules for TypeScript
{
files: ['*.ts'],
extends: [
'airbnb-typescript/base',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
rules: {
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
'class-methods-use-this': 'off',
'lines-between-class-members': 'off',
'@typescript-eslint/unbound-method': [
'error',
{
ignoreStatic: true,
},
],
},
},
// Configuration for unit and e2e spec files
{
files: ['*.spec.ts'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
},
},
{
files: ['src/**/*.spec.ts', 'src/**/*.d.ts'],
parserOptions: {
project: './tsconfig.spec.json',
},
extends: ['plugin:jasmine/recommended'],
plugins: ['jasmine'],
env: { jasmine: true },
},
{
files: ['e2e/**/*.e2e-spec.ts', 'e2e/**/*.po.ts'],
parserOptions: {
project: './e2e/tsconfig.json',
},
extends: ['plugin:protractor/recommended'],
plugins: ['protractor'],
rules: {
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}],
}
},
],
};