-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
103 lines (103 loc) · 3.09 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
module.exports = {
root: true,
env: {
node: true,
browser: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:unicorn/recommended',
'plugin:promise/recommended',
'plugin:sonarjs/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: false,
},
project: 'tsconfig.json',
},
plugins: [
'unicorn',
'import',
'wix-editor',
'@typescript-eslint/tslint',
'prettier',
'simple-import-sort',
'promise',
'sonarjs',
'only-warn',
],
rules: {
// core
'no-unused-vars': 0,
'no-undef': 0,
'consistent-return': [1, { treatUndefinedAsUnspecified: true }],
quotes: [1, 'single', { allowTemplateLiterals: true, avoidEscape: true }],
semi: [1, 'always'],
'max-lines': [1, { max: 200 }],
'max-params': [1, { max: 5 }],
'no-unneeded-ternary': [1],
// wix-editor
'wix-editor/no-instanceof-array': 1,
'wix-editor/no-not-not': 1,
'wix-editor/no-unneeded-match': 1,
'wix-editor/prefer-filter': 1,
'wix-editor/prefer-ternary': 1,
'wix-editor/return-boolean': 1,
'wix-editor/simplify-boolean-expression': 1,
// unicorn
'unicorn/prefer-spread': 0,
'unicorn/catch-error-name': 0,
'unicorn/prevent-abbreviations': [
1,
{
replacements: {
err: false,
prod: false,
ref: false,
params: false,
},
},
],
// import
'import/newline-after-import': 0,
'import/no-duplicates': 1,
'import/max-dependencies': [1, { max: 15 }],
// sort-imports
'simple-import-sort/sort': 1,
'prettier/prettier': [1, { endOfLine: 'auto' }],
'sort-imports': 'off',
'import/order': 'off',
// tslint
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-floating-promises': 1,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/no-unnecessary-condition': [1, { ignoreRhs: true }],
'@typescript-eslint/tslint/config': [
1,
{
lintFile: './tslint.json',
},
],
},
overrides: [
{
files: ['*.spec.ts', '**/testing/**/*.ts'],
rules: {
'consistent-return': 0,
'max-lines': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-floating-promises': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/camelcase': 0,
'import/max-dependencies': 0,
'sonarjs/no-duplicate-string': 0,
},
},
],
};