|
| 1 | +module.exports = { |
| 2 | + parser: "@typescript-eslint/parser", |
| 3 | + extends: [ |
| 4 | + "eslint:recommended", |
| 5 | + "plugin:@typescript-eslint/eslint-recommended", |
| 6 | + "plugin:@typescript-eslint/recommended", |
| 7 | + "plugin:import/errors", |
| 8 | + "plugin:import/typescript", |
| 9 | + "prettier", |
| 10 | + ], |
| 11 | + plugins: ["@typescript-eslint", "simple-import-sort", "import"], |
| 12 | + parserOptions: { |
| 13 | + ecmaVersion: 2018, |
| 14 | + sourceType: "module", |
| 15 | + }, |
| 16 | + env: { |
| 17 | + node: true, |
| 18 | + es6: true, |
| 19 | + }, |
| 20 | + globals: { |
| 21 | + NodeJS: false, // For TypeScript |
| 22 | + }, |
| 23 | + rules: { |
| 24 | + "no-unused-vars": 0, |
| 25 | + "@typescript-eslint/no-unused-vars": [ |
| 26 | + "error", |
| 27 | + { |
| 28 | + argsIgnorePattern: "^_", |
| 29 | + varsIgnorePattern: "^_", |
| 30 | + args: "after-used", |
| 31 | + ignoreRestSiblings: true, |
| 32 | + }, |
| 33 | + ], |
| 34 | + curly: "error", |
| 35 | + "no-else-return": 0, |
| 36 | + "no-return-assign": [2, "except-parens"], |
| 37 | + "no-underscore-dangle": 0, |
| 38 | + camelcase: 0, |
| 39 | + "prefer-arrow-callback": [ |
| 40 | + "error", |
| 41 | + { |
| 42 | + allowNamedFunctions: true, |
| 43 | + }, |
| 44 | + ], |
| 45 | + "class-methods-use-this": 0, |
| 46 | + "no-restricted-syntax": 0, |
| 47 | + "no-param-reassign": [ |
| 48 | + "error", |
| 49 | + { |
| 50 | + props: false, |
| 51 | + }, |
| 52 | + ], |
| 53 | + |
| 54 | + "arrow-body-style": 0, |
| 55 | + "no-nested-ternary": 0, |
| 56 | + |
| 57 | + /* |
| 58 | + * simple-import-sort seems to be the most stable import sorting currently, |
| 59 | + * disable others |
| 60 | + */ |
| 61 | + "simple-import-sort/imports": "error", |
| 62 | + "simple-import-sort/exports": "error", |
| 63 | + "sort-imports": "off", |
| 64 | + "import/order": "off", |
| 65 | + |
| 66 | + "import/no-deprecated": "warn", |
| 67 | + "import/no-duplicates": "error", |
| 68 | + // Doesn't support 'exports'? |
| 69 | + "import/no-unresolved": "off", |
| 70 | + "@typescript-eslint/ban-ts-comment": "off", |
| 71 | + "@typescript-eslint/no-namespace": "off", |
| 72 | + }, |
| 73 | + overrides: [ |
| 74 | + { |
| 75 | + files: ["__tests__/**/*", "test.js"], |
| 76 | + rules: { |
| 77 | + "@typescript-eslint/no-explicit-any": 0, |
| 78 | + "@typescript-eslint/explicit-function-return-type": 0, |
| 79 | + "@typescript-eslint/no-var-requires": 0, |
| 80 | + "@typescript-eslint/ban-ts-comment": 0, |
| 81 | + }, |
| 82 | + }, |
| 83 | + { |
| 84 | + files: ["perfTest/**/*", "examples/**/*"], |
| 85 | + rules: { |
| 86 | + "@typescript-eslint/no-var-requires": 0, |
| 87 | + }, |
| 88 | + }, |
| 89 | + ], |
| 90 | +}; |
0 commit comments