-
-
Notifications
You must be signed in to change notification settings - Fork 341
Expand file tree
/
Copy path.eslintrc.js
More file actions
114 lines (111 loc) · 3.9 KB
/
Copy path.eslintrc.js
File metadata and controls
114 lines (111 loc) · 3.9 KB
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
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'airbnb-base',
'plugin:unicorn/recommended',
'plugin:@internal/eslint-plugin/recommended',
],
parserOptions: {
ecmaVersion: '2021',
sourceType: 'module',
},
ignorePatterns: [
'!.*',
'/dist',
'/examples/assets/library',
'/test/coverage',
'/test/helpers',
],
rules: {
'brace-style': ['error', '1tbs'],
'class-methods-use-this': 'off',
'comma-dangle': ['error', {
arrays: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
imports: 'always-multiline',
objects: 'always-multiline',
}],
'consistent-return': 'off',
curly: ['error', 'all'],
'func-names': 'off',
'import/no-extraneous-dependencies': ['error', {}],
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
indent: ['error', 4, {
SwitchCase: 1,
}],
'linebreak-style': ['error', 'unix'],
'max-len': 'off',
'no-console': 'off',
'no-nested-ternary': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-restricted-syntax': 'off',
'no-unused-vars': 'off',
'object-shorthand': ['error', 'never'],
'padding-line-between-statements': ['error', {
blankLine: 'always',
next: ['continue', 'break', 'export', 'return', 'throw'],
prev: '*',
}],
'prefer-destructuring': 'off',
'prefer-template': 'off',
'spaced-comment': ['error', 'always', {
block: {
balanced: true,
exceptions: ['*'],
markers: ['!'],
},
line: {
exceptions: ['-', '+'],
markers: ['/'],
},
}],
strict: 'off',
'unicorn/no-anonymous-default-export': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-negated-condition': 'off',
'unicorn/no-null': 'off',
'unicorn/no-this-assignment': 'off',
'unicorn/prefer-array-find': 'off',
'unicorn/prefer-array-some': 'off', // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2007
'unicorn/prefer-at': 'off',
'unicorn/prefer-global-this': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-string-raw': 'off',
'unicorn/prefer-string-replace-all': 'off',
'unicorn/prevent-abbreviations': 'off',
'wrap-iife': ['error', 'inside'],
// TODO rules to be removed/fixed in v2.10.0 as fixes are not compatible with IE11
'no-restricted-properties': 'off',
'unicorn/prefer-reflect-apply': 'off',
'unicorn/prefer-top-level-await': 'off', // needs Node 14+
// TODO rules with a lot of errors to be fixed manually, fix in a separate PR
eqeqeq: 'off', // about 20 errors to be fixed manually
'no-shadow': 'off', // about 220 errors to be fixed manually
'prefer-arrow-callback': 'off', // about 350 errors (all autofixable)
},
reportUnusedDisableDirectives: true,
globals: {
jQuery: true,
},
overrides: [{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
],
rules: {
// https://typescript-eslint.io/rules/no-use-before-define#how-to-use
'no-use-before-define': 'off',
// TODO rules with a lot of errors to be fixed manually, fix in a separate PR
'@typescript-eslint/ban-types': 'off', // 16 eslint errors only, help wanted!
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
},
}],
};