|
| 1 | +module.exports = { |
| 2 | + 'env': { |
| 3 | + 'browser': true, |
| 4 | + 'es6': true, |
| 5 | + 'node': true |
| 6 | + }, |
| 7 | + 'extends': [ |
| 8 | + 'eslint:recommended', |
| 9 | + 'plugin:react/recommended', |
| 10 | + 'plugin:@typescript-eslint/recommended' |
| 11 | + ], |
| 12 | + 'parser': '@typescript-eslint/parser', |
| 13 | + 'parserOptions': { |
| 14 | + 'ecmaVersion': 2015, |
| 15 | + 'sourceType': 'module' |
| 16 | + }, |
| 17 | + 'plugins': [ |
| 18 | + 'react', |
| 19 | + '@typescript-eslint', |
| 20 | + 'import' |
| 21 | + ], |
| 22 | + 'rules': { |
| 23 | + 'indent': ['error', 2, { 'SwitchCase': 1 }], |
| 24 | + 'quotes': ['warn', 'single', 'avoid-escape'], |
| 25 | + 'linebreak-style': ['error', 'unix'], |
| 26 | + 'camelcase': ['error', { 'properties': 'never' }], |
| 27 | + 'no-use-before-define': ['error', 'nofunc'], |
| 28 | + 'eol-last': ['error', 'always'], |
| 29 | + 'keyword-spacing': 'error', |
| 30 | + 'no-trailing-spaces': 'error', |
| 31 | + 'space-before-function-paren': ['error', {'named': 'never'}], |
| 32 | + 'react/display-name': 'off', |
| 33 | + '@typescript-eslint/no-empty-function': 'off', |
| 34 | + '@typescript-eslint/no-inferrable-types': 'off', |
| 35 | + '@typescript-eslint/no-explicit-any': 'off', |
| 36 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 37 | + '@typescript-eslint/no-unused-vars': ['warn', { 'argsIgnorePattern': '^_' }], |
| 38 | + }, |
| 39 | + 'overrides': [{ |
| 40 | + 'files': ['src/**/*.ts', 'src/**/*.tsx'], |
| 41 | + 'excludedFiles': ['src/**/__tests__/**'], |
| 42 | + 'extends': [ |
| 43 | + 'plugin:compat/recommended' |
| 44 | + ], |
| 45 | + 'settings': { |
| 46 | + 'polyfills': [ |
| 47 | + 'Promise' // required as a polyfill by the user |
| 48 | + ] |
| 49 | + }, |
| 50 | + 'rules': { |
| 51 | + 'no-restricted-syntax': ['error', 'ForOfStatement', 'ForInStatement'], |
| 52 | + 'compat/compat': ['error', 'defaults, not ie < 11'], |
| 53 | + 'no-throw-literal': 'error', |
| 54 | + 'import/no-self-import': 'error', |
| 55 | + // 'import/no-default-export': 'error', // Default exports are a common practice in React |
| 56 | + } |
| 57 | + }] |
| 58 | +} |
0 commit comments