|
1 | 1 | module.exports = {
|
2 |
| - root: true, |
3 |
| - env: { |
4 |
| - es6: true, |
5 |
| - node: true, |
6 |
| - browser: true, |
| 2 | + root: true, |
| 3 | + env: { |
| 4 | + es6: true, |
| 5 | + node: true, |
| 6 | + browser: true, |
| 7 | + }, |
| 8 | + extends: [ |
| 9 | + 'eslint:recommended', |
| 10 | + 'plugin:@typescript-eslint/recommended', |
| 11 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 12 | + 'plugin:unicorn/recommended', |
| 13 | + 'plugin:import/warnings', |
| 14 | + 'plugin:regexp/recommended', |
| 15 | + ], |
| 16 | + parser: '@typescript-eslint/parser', |
| 17 | + parserOptions: { |
| 18 | + project: 'tsconfig.json', |
| 19 | + sourceType: 'module', |
| 20 | + ecmaFeatures: { |
| 21 | + jsx: false, |
7 | 22 | },
|
8 |
| - extends: [ |
9 |
| - 'eslint:recommended', |
10 |
| - 'plugin:@typescript-eslint/recommended', |
11 |
| - 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
12 |
| - 'plugin:unicorn/recommended', |
13 |
| - 'plugin:import/warnings', |
14 |
| - 'plugin:regexp/recommended', |
15 |
| - ], |
16 |
| - parser: '@typescript-eslint/parser', |
17 |
| - parserOptions: { |
18 |
| - project: 'tsconfig.json', |
19 |
| - sourceType: 'module', |
20 |
| - ecmaFeatures: { |
21 |
| - jsx: false, |
| 23 | + warnOnUnsupportedTypeScriptVersion: false, |
| 24 | + }, |
| 25 | + plugins: [ |
| 26 | + 'unicorn', |
| 27 | + 'import', |
| 28 | + 'wix-editor', |
| 29 | + '@typescript-eslint', |
| 30 | + 'prettier', |
| 31 | + 'simple-import-sort', |
| 32 | + 'sort-class-members', |
| 33 | + 'etc', |
| 34 | + 'only-warn', |
| 35 | + ], |
| 36 | + rules: { |
| 37 | + // core |
| 38 | + 'consistent-return': [0, { treatUndefinedAsUnspecified: false }], |
| 39 | + quotes: [1, 'single', { allowTemplateLiterals: true, avoidEscape: true }], |
| 40 | + semi: [1, 'always'], |
| 41 | + 'max-lines': [1, { max: 300 }], |
| 42 | + 'max-params': [1, { max: 5 }], |
| 43 | + 'no-unneeded-ternary': [1], |
| 44 | + // wix-editor |
| 45 | + 'wix-editor/no-instanceof-array': 1, |
| 46 | + 'wix-editor/no-not-not': 1, |
| 47 | + 'wix-editor/no-unneeded-match': 1, |
| 48 | + 'wix-editor/prefer-filter': 1, |
| 49 | + 'wix-editor/prefer-ternary': 1, |
| 50 | + 'wix-editor/return-boolean': 1, |
| 51 | + 'wix-editor/simplify-boolean-expression': 1, |
| 52 | + // unicorn |
| 53 | + 'unicorn/prefer-spread': 0, |
| 54 | + 'unicorn/catch-error-name': 0, |
| 55 | + 'unicorn/prefer-node-protocol': 0, |
| 56 | + 'unicorn/prevent-abbreviations': [ |
| 57 | + 1, |
| 58 | + { |
| 59 | + replacements: { |
| 60 | + args: false, |
| 61 | + err: false, |
| 62 | + prod: false, |
| 63 | + ref: false, |
| 64 | + params: false, |
22 | 65 | },
|
23 |
| - warnOnUnsupportedTypeScriptVersion: false, |
24 |
| - }, |
25 |
| - plugins: [ |
26 |
| - 'unicorn', |
27 |
| - 'import', |
28 |
| - 'wix-editor', |
29 |
| - '@typescript-eslint', |
30 |
| - 'prettier', |
31 |
| - 'simple-import-sort', |
32 |
| - 'sort-class-members', |
33 |
| - 'etc', |
34 |
| - 'only-warn', |
| 66 | + }, |
35 | 67 | ],
|
36 |
| - rules: { |
37 |
| - // core |
38 |
| - 'consistent-return': [0, { treatUndefinedAsUnspecified: false }], |
39 |
| - quotes: [1, 'single', { allowTemplateLiterals: true, avoidEscape: true }], |
40 |
| - semi: [1, 'always'], |
41 |
| - 'max-lines': [1, { max: 300 }], |
42 |
| - 'max-params': [1, { max: 5 }], |
43 |
| - 'no-unneeded-ternary': [1], |
44 |
| - // wix-editor |
45 |
| - 'wix-editor/no-instanceof-array': 1, |
46 |
| - 'wix-editor/no-not-not': 1, |
47 |
| - 'wix-editor/no-unneeded-match': 1, |
48 |
| - 'wix-editor/prefer-filter': 1, |
49 |
| - 'wix-editor/prefer-ternary': 1, |
50 |
| - 'wix-editor/return-boolean': 1, |
51 |
| - 'wix-editor/simplify-boolean-expression': 1, |
52 |
| - // unicorn |
53 |
| - 'unicorn/prefer-spread': 0, |
54 |
| - 'unicorn/catch-error-name': 0, |
55 |
| - 'unicorn/prefer-node-protocol': 0, |
56 |
| - 'unicorn/prevent-abbreviations': [ |
57 |
| - 1, |
58 |
| - { |
59 |
| - replacements: { |
60 |
| - args: false, |
61 |
| - err: false, |
62 |
| - prod: false, |
63 |
| - ref: false, |
64 |
| - params: false, |
65 |
| - }, |
66 |
| - }, |
67 |
| - ], |
68 |
| - // import |
69 |
| - 'import/max-dependencies': [1, { max: 15 }], |
70 |
| - // simple-import-sort with recomended settings |
71 |
| - 'simple-import-sort/imports': 1, |
72 |
| - 'sort-imports': 'off', |
73 |
| - 'import/order': 'off', |
74 |
| - // typescript-eslint |
75 |
| - '@typescript-eslint/no-floating-promises': 1, |
76 |
| - '@typescript-eslint/no-unnecessary-condition': 1, |
77 |
| - '@typescript-eslint/explicit-module-boundary-types': 0, |
78 |
| - '@typescript-eslint/unbound-method': 0, |
79 |
| - // sort-class-members |
80 |
| - 'sort-class-members/sort-class-members': [ |
81 |
| - 1, |
82 |
| - { |
83 |
| - order: [ |
84 |
| - '[static-properties]', |
85 |
| - '[static-methods]', |
86 |
| - '[properties]', |
87 |
| - '[conventional-private-properties]', |
88 |
| - 'constructor', |
89 |
| - '[methods]', |
90 |
| - '[conventional-private-methods]', |
91 |
| - ], |
92 |
| - accessorPairPositioning: 'getThenSet', |
93 |
| - }, |
| 68 | + // import |
| 69 | + 'import/max-dependencies': [1, { max: 15 }], |
| 70 | + // simple-import-sort with recomended settings |
| 71 | + 'simple-import-sort/imports': 1, |
| 72 | + 'sort-imports': 'off', |
| 73 | + 'import/order': 'off', |
| 74 | + // typescript-eslint |
| 75 | + '@typescript-eslint/no-floating-promises': 1, |
| 76 | + '@typescript-eslint/no-unnecessary-condition': 1, |
| 77 | + '@typescript-eslint/explicit-module-boundary-types': 0, |
| 78 | + '@typescript-eslint/unbound-method': 0, |
| 79 | + // sort-class-members |
| 80 | + 'sort-class-members/sort-class-members': [ |
| 81 | + 1, |
| 82 | + { |
| 83 | + order: [ |
| 84 | + '[static-properties]', |
| 85 | + '[static-methods]', |
| 86 | + '[properties]', |
| 87 | + '[conventional-private-properties]', |
| 88 | + 'constructor', |
| 89 | + '[methods]', |
| 90 | + '[conventional-private-methods]', |
94 | 91 | ],
|
95 |
| - // etc |
96 |
| - 'etc/no-deprecated': 1, |
97 |
| - 'etc/no-assign-mutated-array': 1, |
98 |
| - }, |
99 |
| - overrides: [ |
100 |
| - { |
101 |
| - files: ['*.spec.ts', '**/{test,@generated}/**/*.ts'], |
102 |
| - rules: { |
103 |
| - 'consistent-return': 0, |
104 |
| - 'max-lines': 0, |
105 |
| - 'regexp/strict': 0, |
106 |
| - '@typescript-eslint/no-misused-promises': 0, |
107 |
| - '@typescript-eslint/no-explicit-any': 0, |
108 |
| - '@typescript-eslint/no-unsafe-member-access': 0, |
109 |
| - '@typescript-eslint/no-floating-promises': 0, |
110 |
| - '@typescript-eslint/no-non-null-assertion': 0, |
111 |
| - '@typescript-eslint/camelcase': 0, |
112 |
| - '@typescript-eslint/no-unsafe-assignment': 0, |
113 |
| - '@typescript-eslint/no-unused-vars': 0, |
114 |
| - '@typescript-eslint/no-unsafe-return': 0, |
115 |
| - '@typescript-eslint/no-non-null-asserted-optional-chain': 0, |
116 |
| - 'import/max-dependencies': 0, |
117 |
| - }, |
118 |
| - }, |
| 92 | + accessorPairPositioning: 'getThenSet', |
| 93 | + }, |
119 | 94 | ],
|
| 95 | + // etc |
| 96 | + 'etc/no-deprecated': 1, |
| 97 | + 'etc/no-assign-mutated-array': 1, |
| 98 | + }, |
| 99 | + overrides: [ |
| 100 | + { |
| 101 | + files: ['*.spec.ts', '**/{test,@generated}/**/*.ts'], |
| 102 | + rules: { |
| 103 | + 'consistent-return': 0, |
| 104 | + 'max-lines': 0, |
| 105 | + 'regexp/strict': 0, |
| 106 | + '@typescript-eslint/no-misused-promises': 0, |
| 107 | + '@typescript-eslint/no-explicit-any': 0, |
| 108 | + '@typescript-eslint/no-unsafe-member-access': 0, |
| 109 | + '@typescript-eslint/no-floating-promises': 0, |
| 110 | + '@typescript-eslint/no-non-null-assertion': 0, |
| 111 | + '@typescript-eslint/camelcase': 0, |
| 112 | + '@typescript-eslint/no-unsafe-assignment': 0, |
| 113 | + '@typescript-eslint/no-unused-vars': 0, |
| 114 | + '@typescript-eslint/no-unsafe-return': 0, |
| 115 | + '@typescript-eslint/no-non-null-asserted-optional-chain': 0, |
| 116 | + 'import/max-dependencies': 0, |
| 117 | + }, |
| 118 | + }, |
| 119 | + ], |
120 | 120 | };
|
0 commit comments