|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + 'env': { |
| 4 | + 'browser': true, |
| 5 | + 'es2021': true, |
| 6 | + }, |
| 7 | + "settings": { |
| 8 | + "import/parsers": { |
| 9 | + "@typescript-eslint/parser": [".ts", ".tsx"] |
| 10 | + }, |
| 11 | + "import/resolver": { |
| 12 | + "typescript": {}, |
| 13 | + "node": { |
| 14 | + "moduleDirectory": ["node_modules", "./"] |
| 15 | + } |
| 16 | + }, |
| 17 | + }, |
| 18 | + 'extends': [ |
| 19 | + 'plugin:react/recommended', |
| 20 | + 'plugin:@typescript-eslint/recommended', |
| 21 | + 'airbnb', |
| 22 | + 'airbnb/hooks', |
| 23 | + 'plugin:@typescript-eslint/recommended-requiring-type-checking', |
| 24 | + "plugin:import/errors", |
| 25 | + "plugin:import/warnings", |
| 26 | + "plugin:import/typescript", |
| 27 | + ], |
| 28 | + 'parser': '@typescript-eslint/parser', |
| 29 | + 'parserOptions': { |
| 30 | + 'ecmaFeatures': { |
| 31 | + 'jsx': true |
| 32 | + }, |
| 33 | + 'ecmaVersion': 'latest', |
| 34 | + 'sourceType': 'module', |
| 35 | + 'tsconfigRootDir': __dirname, |
| 36 | + 'project': ['./tsconfig.json'] |
| 37 | + }, |
| 38 | + 'plugins': [ |
| 39 | + '@typescript-eslint', |
| 40 | + 'react', |
| 41 | + 'import', |
| 42 | + ], |
| 43 | + 'rules': { |
| 44 | + 'semi': 'off', |
| 45 | + '@typescript-eslint/semi': ['error'], |
| 46 | + 'linebreak-style': 'off', |
| 47 | + 'no-unused-vars': 'off', |
| 48 | + '@typescript-eslint/no-unused-vars': ['error'], |
| 49 | + 'import/extensions': [ |
| 50 | + 'error', |
| 51 | + { |
| 52 | + 'js': 'never', |
| 53 | + 'jsx': 'never', |
| 54 | + 'ts': 'never', |
| 55 | + 'tsx': 'never', |
| 56 | + 'json': 'always', |
| 57 | + } |
| 58 | + ], |
| 59 | + 'react/prop-types': 'off', |
| 60 | + 'react/require-default-props': 'off', |
| 61 | + 'react-hooks/rules-of-hooks': 'error', |
| 62 | + 'react-hooks/exhaustive-deps': 'error', |
| 63 | + "react/function-component-definition": ['error', { |
| 64 | + "namedComponents": "arrow-function", |
| 65 | + }], |
| 66 | + 'react/jsx-filename-extension': ['error', { 'extensions': ['.ts', '.tsx'] }], |
| 67 | + 'react/jsx-curly-brace-presence': 'error', |
| 68 | + 'react/jsx-props-no-spreading': 'off', |
| 69 | + 'react/jsx-one-expression-per-line': 'off', |
| 70 | + 'no-nested-ternary': 'off', |
| 71 | + "object-curly-newline": ["error", { |
| 72 | + "ImportDeclaration": "never", |
| 73 | + }], |
| 74 | + 'import/order': 'off', |
| 75 | + "import/no-unresolved": "error", |
| 76 | + "jsx-a11y/anchor-is-valid": "off", |
| 77 | + "import/no-named-default": "off", |
| 78 | + "no-console": ["warn", { allow: ["warn", "error"] }], |
| 79 | + "@typescript-eslint/no-inferrable-types": "off", |
| 80 | + "@typescript-eslint/no-misused-promises": [ |
| 81 | + "error", |
| 82 | + { |
| 83 | + "checksVoidReturn": { |
| 84 | + "properties": false, |
| 85 | + "attributes": false |
| 86 | + } |
| 87 | + } |
| 88 | + ], |
| 89 | + "@typescript-eslint/no-floating-promises": [ |
| 90 | + "error", |
| 91 | + { ignoreIIFE: true } |
| 92 | + ], |
| 93 | + "max-len": ["error", { |
| 94 | + "code": 100, |
| 95 | + "ignoreComments": true, |
| 96 | + "ignoreStrings": true, |
| 97 | + }], |
| 98 | + "prefer-promise-reject-errors": 'off', |
| 99 | + 'comma-dangle': 'off', |
| 100 | + 'eol-last': 'off', |
| 101 | + }, |
| 102 | +}; |
0 commit comments