-
Notifications
You must be signed in to change notification settings - Fork 26
/
.eslintrc.js
158 lines (156 loc) · 6.31 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
module.exports = {
env: {
browser: true,
es6: true,
node: true,
mocha: true,
jasmine: true,
jest: true,
},
overrides: [
{
files: ['*.js'],
extends: ['airbnb-base', 'eslint:recommended'],
plugins: ['no-jquery'],
rules: {
indent: [
'error',
4,
{ SwitchCase: 1 },
],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'no-unused-vars': ['error', { vars: 'local' }],
'no-plusplus': 'off',
'no-cond-assign': ['error', 'always'],
eqeqeq: ['warn', 'smart'],
// disable rules from base configurations
'no-console': 'off',
'no-alert': 'off',
'func-names': 'off',
'block-scoped-var': 'error',
'guard-for-in': 'error',
'no-loop-func': 'error',
'no-self-compare': 'error',
'no-unneeded-ternary': 'error',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'no-underscore-dangle': 'off',
'class-methods-use-this': 'off',
'no-param-reassign': ['error', { props: false }],
'no-jquery/no-other-methods': 'error',
'no-jquery/no-other-utils': 'error',
'no-jquery/no-jquery-constructor': 'error',
'no-jquery/no-animate': 'error',
'no-jquery/no-bind': 'error',
'no-jquery/no-class': 'error',
'no-jquery/no-closest': 'error',
'no-jquery/no-delegate': 'error',
'no-jquery/no-each-collection': 'error',
'no-jquery/no-event-shorthand': 'error',
'no-jquery/no-fade': 'error',
'no-jquery/no-find-collection': 'error',
'no-jquery/no-has': 'error',
'no-jquery/no-html': 'error',
'no-jquery/no-is': 'error',
'no-jquery/no-live': 'error',
'no-jquery/no-load': 'error',
'no-jquery/no-map-collection': 'error',
'no-jquery/no-parent': 'error',
'no-jquery/no-parents': 'error',
'no-jquery/no-ready-shorthand': 'error',
'no-jquery/no-serialize': 'error',
'no-jquery/no-size': 'error',
'no-jquery/no-slide': 'error',
'no-jquery/no-trigger': 'error',
'no-jquery/no-val': 'error',
'no-jquery/no-visibility': 'error',
'no-jquery/no-wrap': 'error',
'no-jquery/no-ajax': 'error',
'no-jquery/no-camel-case': 'error',
'no-jquery/no-contains': 'error',
'no-jquery/no-deferred': 'error',
'no-jquery/no-each-util': 'error',
'no-jquery/no-error': 'error',
'no-jquery/no-escape-selector': 'off',
'no-jquery/no-extend': 'error',
'no-jquery/no-find-util': 'error',
'no-jquery/no-global-eval': 'error',
'no-jquery/no-grep': 'error',
'no-jquery/no-hold-ready': 'error',
'no-jquery/no-in-array': 'error',
'no-jquery/no-is-array': 'error',
'no-jquery/no-is-empty-object': 'error',
'no-jquery/no-is-function': 'error',
'no-jquery/no-is-numeric': 'error',
'no-jquery/no-is-plain-object': 'error',
'no-jquery/no-is-window': 'error',
'no-jquery/no-map-util': 'error',
'no-jquery/no-merge': 'error',
'no-jquery/no-node-name': 'error',
'no-jquery/no-noop': 'error',
'no-jquery/no-now': 'error',
'no-jquery/no-param': 'error',
'no-jquery/no-parse-html': 'error',
'no-jquery/no-parse-json': 'error',
'no-jquery/no-parse-xml': 'error',
'no-jquery/no-proxy': 'error',
'no-jquery/no-trim': 'error',
'no-jquery/no-type': 'error',
'no-jquery/no-unique': 'error',
'no-jquery/no-when': 'error',
'no-jquery/no-attr': 'error',
'no-jquery/no-clone': 'error',
'no-jquery/no-css': 'error',
'no-jquery/no-data': 'error',
'no-jquery/no-filter': 'error',
'no-jquery/no-prop': 'error',
'no-jquery/no-sub': 'error',
'no-jquery/no-text': 'error',
},
},
{
files: ['*.html'],
plugins: ['@html-eslint'],
parser: '@html-eslint/parser',
extends: ['plugin:@html-eslint/recommended'],
rules: {
'@html-eslint/require-img-alt': 'off',
'@html-eslint/require-button-type': 'error',
'@html-eslint/no-multiple-empty-lines': ['error', { max: 1 }],
'@html-eslint/require-li-container': 'off', // don't work with li in template tag
'@html-eslint/element-newline': 'error',
},
},
{
files: ['*.component.html'],
extends: ['plugin:@angular-eslint/template/recommended'],
rules: {
'@html-eslint/require-doctype': 'off',
},
},
{
files: ['*.ts'],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@angular-eslint/recommended',
'plugin:@angular-eslint/template/process-inline-templates',
],
rules: {
quotes: ['error', 'single'],
indent: [
'error',
4,
{ SwitchCase: 1 },
],
'no-cond-assign': ['error', 'always'],
'no-console': 'off',
'no-alert': 'off',
'func-names': 'off',
},
},
],
};