|
| 1 | +module.exports = { |
| 2 | + extends: [ |
| 3 | + // https://eslint.org/docs/rules/ |
| 4 | + "eslint:recommended", |
| 5 | + // https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/src/configs/recommended.json |
| 6 | + "plugin:@typescript-eslint/recommended", |
| 7 | + // https://prettier.io/docs/en/eslint.html |
| 8 | + "plugin:prettier/recommended", |
| 9 | + ], |
| 10 | + // https://reactjs.org/docs/hooks-rules.html |
| 11 | + plugins: [], |
| 12 | + parser: "@typescript-eslint/parser", |
| 13 | + parserOptions: { |
| 14 | + project: "./tsconfig.json", |
| 15 | + }, |
| 16 | + settings: {}, |
| 17 | + rules: { |
| 18 | + "no-undef": "off", // useless in TypeScript |
| 19 | + "no-constant-condition": ["warn", { checkLoops: false }], |
| 20 | + "no-useless-escape": "warn", |
| 21 | + "no-console": "warn", |
| 22 | + |
| 23 | + "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_|^intl$" }], |
| 24 | + "@typescript-eslint/array-type": ["error", "generic"], |
| 25 | + "@typescript-eslint/camelcase": "warn", |
| 26 | + "@typescript-eslint/class-name-casing": "warn", // to allow the initial underscore |
| 27 | + "@typescript-eslint/no-non-null-assertion": "warn", // NOTE: pay attention to it because it may cause unexpected behavior |
| 28 | + "@typescript-eslint/prefer-for-of": "warn", |
| 29 | + "@typescript-eslint/prefer-includes": "warn", |
| 30 | + "@typescript-eslint/prefer-string-starts-ends-with": "warn", |
| 31 | + "@typescript-eslint/no-use-before-define": "warn", |
| 32 | + |
| 33 | + "@typescript-eslint/indent": "off", |
| 34 | + "@typescript-eslint/no-explicit-any": "off", |
| 35 | + "@typescript-eslint/explicit-function-return-type": "off", |
| 36 | + "@typescript-eslint/explicit-member-accessibility": "off", |
| 37 | + "@typescript-eslint/no-object-literal-type-assertion": "off", |
| 38 | + "@typescript-eslint/no-empty-interface": "off", |
| 39 | + "@typescript-eslint/no-parameter-properties": "off", |
| 40 | + "@typescript-eslint/no-var-requires": "off", // not a part of ECMA-262 |
| 41 | + "@typescript-eslint/prefer-interface": "off", |
| 42 | + |
| 43 | + "prettier/prettier": "warn", |
| 44 | + }, |
| 45 | +}; |
0 commit comments