|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + parser: "@typescript-eslint/parser", |
| 4 | + parserOptions: { |
| 5 | + project: true, |
| 6 | + }, |
| 7 | + plugins: ["@typescript-eslint", "import"], |
| 8 | + extends: [ |
| 9 | + "eslint:recommended", |
| 10 | + "plugin:@typescript-eslint/eslint-recommended", |
| 11 | + "plugin:@typescript-eslint/recommended", |
| 12 | + ], |
| 13 | + ignorePatterns: ["dist", "*.spec.ts"], |
| 14 | + rules: { |
| 15 | + "no-unused-vars": "off", |
| 16 | + "no-extra-boolean-cast": "off", |
| 17 | + "no-empty-function": "off", |
| 18 | + "@typescript-eslint/no-empty-function": [ |
| 19 | + "error", |
| 20 | + { allow: ["asyncMethods", "methods"] }, |
| 21 | + ], |
| 22 | + "@typescript-eslint/no-unsafe-declaration-merging": "off", |
| 23 | + "@typescript-eslint/no-use-before-define": "off", |
| 24 | + "@typescript-eslint/typedef": "off", |
| 25 | + "@typescript-eslint/explicit-function-return-type": "off", |
| 26 | + "max-len": ["off"], |
| 27 | + "import/order": "error", |
| 28 | + "sort-imports": [ |
| 29 | + "error", |
| 30 | + { |
| 31 | + ignoreCase: true, |
| 32 | + ignoreDeclarationSort: true, |
| 33 | + }, |
| 34 | + ], |
| 35 | + "comma-dangle": "off", |
| 36 | + "@typescript-eslint/no-empty-interface": [ |
| 37 | + "error", |
| 38 | + { |
| 39 | + allowSingleExtends: true, |
| 40 | + }, |
| 41 | + ], |
| 42 | + "@typescript-eslint/camelcase": "off", |
| 43 | + "@typescript-eslint/naming-convention": [ |
| 44 | + "error", |
| 45 | + { |
| 46 | + selector: "default", |
| 47 | + format: ["UPPER_CASE", "camelCase", "PascalCase"], |
| 48 | + leadingUnderscore: "allow", |
| 49 | + }, |
| 50 | + { |
| 51 | + selector: "property", |
| 52 | + format: null, // disable for property names because of our foo__expanded convention for JSS |
| 53 | + // TODO: I think we can come up with a regex that ignores variables with __ in them |
| 54 | + }, |
| 55 | + { |
| 56 | + selector: "variable", |
| 57 | + format: null, // disable for variable names because of our foo__expanded convention for JSS |
| 58 | + // TODO: I think we can come up with a regex that ignores variables with __ in them |
| 59 | + }, |
| 60 | + { |
| 61 | + selector: "interface", |
| 62 | + format: ["PascalCase"], |
| 63 | + custom: { |
| 64 | + regex: "^I[A-Z]", |
| 65 | + match: false, |
| 66 | + }, |
| 67 | + }, |
| 68 | + ], |
| 69 | + "@typescript-eslint/no-inferrable-types": "off", |
| 70 | + "no-prototype-builtins": "off", |
| 71 | + "no-fallthrough": "off", |
| 72 | + "no-unexpected-multiline": "off", |
| 73 | + "@typescript-eslint/no-unused-vars": ["warn", { args: "none" }], |
| 74 | + "@typescript-eslint/no-explicit-any": "off", |
| 75 | + }, |
| 76 | + overrides: [ |
| 77 | + { |
| 78 | + files: ["**/*.js"], |
| 79 | + extends: ["eslint:recommended"], |
| 80 | + env: { |
| 81 | + node: true, |
| 82 | + "shared-node-browser": true, |
| 83 | + }, |
| 84 | + rules: { |
| 85 | + "@typescript-eslint/no-var-requires": "off", |
| 86 | + }, |
| 87 | + }, |
| 88 | + ], |
| 89 | +}; |
0 commit comments