|
1 | 1 | { |
2 | | - "extends": "react-app", |
| 2 | + "parser": "@typescript-eslint/parser", |
| 3 | + "extends": [ |
| 4 | + "react-app", |
| 5 | + "prettier", |
| 6 | + "standard", |
| 7 | + "plugin:unicorn/recommended", |
| 8 | + "plugin:@typescript-eslint/recommended", |
| 9 | + "plugin:@typescript-eslint/eslint-recommended", |
| 10 | + "plugin:import/errors", |
| 11 | + "plugin:import/warnings" |
| 12 | + ], |
| 13 | + "settings": { |
| 14 | + "import/parsers": { |
| 15 | + "@typescript-eslint/parser": [".ts", ".tsx"] |
| 16 | + }, |
| 17 | + "import/resolver": { |
| 18 | + "node": { "extensions": [".js", ".mjs", ".cjs"] }, |
| 19 | + "typescript": {} |
| 20 | + } |
| 21 | + }, |
| 22 | + "plugins": ["@typescript-eslint", "simple-import-sort", "import"], |
3 | 23 | "rules": { |
4 | 24 | "react/react-in-jsx-scope": "off", |
5 | 25 | "react/display-name": "off", |
6 | 26 | "react/prop-types": "off", |
7 | 27 | "react/jsx-key": "error", |
8 | 28 | "no-console": 1, |
9 | 29 | "no-unused-vars": "off", |
10 | | - "@typescript-eslint/no-unused-vars": "error" |
| 30 | + "@typescript-eslint/no-unused-vars": "error", |
| 31 | + "simple-import-sort/imports": "error", |
| 32 | + "simple-import-sort/exports": "error", |
| 33 | + "import/newline-after-import": "error", |
| 34 | + "import/no-duplicates": "error", |
| 35 | + // Enforce import order |
| 36 | + // "import/order": ["error"], |
| 37 | + // Imports should come first |
| 38 | + "import/first": "error", |
| 39 | + // Other import rules |
| 40 | + "import/no-mutable-exports": "error", |
| 41 | + // Allow unresolved imports |
| 42 | + "import/no-unresolved": "off", |
| 43 | + |
| 44 | + "semi": 0, |
| 45 | + "quotes": 0, |
| 46 | + "indent": 0, |
| 47 | + "space-before-function-paren": 0, |
| 48 | + "arrow-parens": 0, |
| 49 | + "comma-dangle": 0, |
| 50 | + "keyword-spacing": 0, |
| 51 | + "no-multiple-empty-lines": 0, |
| 52 | + "no-trailing-spaces": 0, |
| 53 | + "unicorn/number-literal-case": 0, |
| 54 | + "unicorn/template-indent": 0, |
| 55 | + "generator-star-spacing": 0, |
| 56 | + "space-infix-ops": 0, |
| 57 | + "comma-spacing": 0, |
| 58 | + "brace-style": 0, |
| 59 | + "space-in-parens": 0, |
| 60 | + "space-before-blocks": 0, |
| 61 | + "semi-spacing": 0, |
| 62 | + "object-property-newline": 0, |
| 63 | + "no-multi-spaces": 0, |
| 64 | + "key-spacing": 0, |
| 65 | + "eol-last": 0, |
| 66 | + "func-call-spacing": 0, |
| 67 | + "comma-style": 0, |
| 68 | + |
| 69 | + // Disable some unnecessary or conflicting rules |
| 70 | + "no-use-before-define": "off", |
| 71 | + "unicorn/prevent-abbreviations": 0, |
| 72 | + "unicorn/no-await-expression-member": 0, |
| 73 | + "unicorn/no-useless-undefined": 0, |
| 74 | + "unicorn/no-array-push-push": 0, |
| 75 | + "unicorn/filename-case": 0, |
| 76 | + "@typescript-eslint/no-explicit-any": 0, |
| 77 | + "@typescript-eslint/no-empty-function": 0, |
| 78 | + "@typescript-eslint/no-var-requires": 0, |
| 79 | + "@typescript-eslint/ban-ts-comment": 0, |
| 80 | + "@typescript-eslint/no-empty-interface": 0, |
| 81 | + |
| 82 | + // Prefer const over let |
| 83 | + "prefer-const": [ |
| 84 | + "error", |
| 85 | + { |
| 86 | + "destructuring": "any", |
| 87 | + "ignoreReadBeforeAssign": false |
| 88 | + } |
| 89 | + ], |
| 90 | + |
| 91 | + // No single if in an "else" block |
| 92 | + "no-lonely-if": "error", |
| 93 | + |
| 94 | + // Force curly braces for control flow, |
| 95 | + // including if blocks with a single statement |
| 96 | + "curly": ["error", "all"], |
| 97 | + |
| 98 | + // No async function without await |
| 99 | + "require-await": "error", |
| 100 | + |
| 101 | + // Force dot notation when possible |
| 102 | + "dot-notation": "error", |
| 103 | + |
| 104 | + // Force object shorthand where possible |
| 105 | + "object-shorthand": "error", |
| 106 | + |
| 107 | + // No useless destructuring/importing/exporting renames |
| 108 | + "no-useless-rename": "error" |
11 | 109 | } |
12 | 110 | } |
0 commit comments