|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + env: { |
| 4 | + node: true, |
| 5 | + browser: true, |
| 6 | + }, |
| 7 | + extends: [ |
| 8 | + 'eslint:recommended', |
| 9 | + 'plugin:@typescript-eslint/recommended', |
| 10 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 11 | + 'plugin:unicorn/recommended', |
| 12 | + 'plugin:import/warnings', |
| 13 | + 'plugin:regexp/recommended', |
| 14 | + 'plugin:etc/recommended', |
| 15 | + 'plugin:promise/recommended', |
| 16 | + 'plugin:prettier/recommended', |
| 17 | + 'prettier', |
| 18 | + ], |
| 19 | + parser: '@typescript-eslint/parser', |
| 20 | + parserOptions: { |
| 21 | + ecmaVersion: 2022, |
| 22 | + project: 'tsconfig.json', |
| 23 | + sourceType: 'module', |
| 24 | + ecmaFeatures: { |
| 25 | + jsx: false, |
| 26 | + }, |
| 27 | + warnOnUnsupportedTypeScriptVersion: false, |
| 28 | + }, |
| 29 | + plugins: [ |
| 30 | + 'unicorn', |
| 31 | + 'import', |
| 32 | + 'wix-editor', |
| 33 | + '@typescript-eslint', |
| 34 | + 'prettier', |
| 35 | + 'simple-import-sort', |
| 36 | + 'etc', |
| 37 | + 'promise', |
| 38 | + 'only-warn', |
| 39 | + ], |
| 40 | + ignorePatterns: ['@generated/**', '*.config.js', '.*rc.js'], |
| 41 | + rules: { |
| 42 | + // core |
| 43 | + 'consistent-return': [1, { treatUndefinedAsUnspecified: true }], |
| 44 | + quotes: [1, 'single', { allowTemplateLiterals: true, avoidEscape: true }], |
| 45 | + semi: [1, 'always'], |
| 46 | + 'max-lines': [1, { max: 300 }], |
| 47 | + 'max-params': [1, { max: 5 }], |
| 48 | + 'no-unneeded-ternary': [1], |
| 49 | + // wix-editor |
| 50 | + 'wix-editor/no-instanceof-array': 1, |
| 51 | + 'wix-editor/no-not-not': 1, |
| 52 | + 'wix-editor/no-unneeded-match': 1, |
| 53 | + 'wix-editor/prefer-filter': 1, |
| 54 | + 'wix-editor/prefer-ternary': 1, |
| 55 | + 'wix-editor/return-boolean': 1, |
| 56 | + 'wix-editor/simplify-boolean-expression': 1, |
| 57 | + // unicorn |
| 58 | + 'unicorn/prefer-spread': 0, |
| 59 | + 'unicorn/catch-error-name': 0, |
| 60 | + 'unicorn/prefer-node-protocol': 0, |
| 61 | + 'unicorn/prevent-abbreviations': [ |
| 62 | + 1, |
| 63 | + { |
| 64 | + replacements: { |
| 65 | + args: false, |
| 66 | + err: false, |
| 67 | + prod: false, |
| 68 | + ref: false, |
| 69 | + params: false, |
| 70 | + }, |
| 71 | + }, |
| 72 | + ], |
| 73 | + // import |
| 74 | + 'import/max-dependencies': [1, { max: 15 }], |
| 75 | + // simple-import-sort with recomended settings |
| 76 | + 'simple-import-sort/imports': 1, |
| 77 | + 'simple-import-sort/exports': 1, |
| 78 | + 'sort-imports': 0, |
| 79 | + 'import/first': 1, |
| 80 | + 'import/newline-after-import': 1, |
| 81 | + 'import/no-duplicates': 1, |
| 82 | + // typescript-eslint |
| 83 | + '@typescript-eslint/no-floating-promises': 1, |
| 84 | + '@typescript-eslint/no-unnecessary-condition': 1, |
| 85 | + '@typescript-eslint/no-explicit-any': [1, { ignoreRestArgs: true }], |
| 86 | + }, |
| 87 | + overrides: [ |
| 88 | + { |
| 89 | + files: ['*.spec.ts', '**/testing/**/*.ts'], |
| 90 | + rules: { |
| 91 | + 'unicorn/prefer-module': 0, |
| 92 | + '@typescript-eslint/no-unsafe-call': 0, |
| 93 | + 'consistent-return': 0, |
| 94 | + 'max-lines': 0, |
| 95 | + '@typescript-eslint/no-explicit-any': 0, |
| 96 | + '@typescript-eslint/no-floating-promises': 0, |
| 97 | + '@typescript-eslint/no-non-null-assertion': 0, |
| 98 | + '@typescript-eslint/camelcase': 0, |
| 99 | + 'import/max-dependencies': 0, |
| 100 | + }, |
| 101 | + }, |
| 102 | + ], |
| 103 | +}; |
0 commit comments