|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + parser: '@typescript-eslint/parser', |
| 4 | + parserOptions: { |
| 5 | + project: './tsconfig.json', |
| 6 | + ecmaVersion: 6, |
| 7 | + ecmaFeatures: { |
| 8 | + impliedStrict: true, |
| 9 | + jsx: true, |
| 10 | + }, |
| 11 | + sourceType: 'module', |
| 12 | + }, |
| 13 | + ignorePatterns: ['.eslintrc.js', 'rollup.config.js'], |
| 14 | + env: { |
| 15 | + es6: true, |
| 16 | + node: true, |
| 17 | + }, |
| 18 | + globals: { |
| 19 | + __DEV__: 'readonly', |
| 20 | + }, |
| 21 | + plugins: [ |
| 22 | + '@typescript-eslint', |
| 23 | + 'promise' |
| 24 | + ], |
| 25 | + extends: [ |
| 26 | + 'plugin:@typescript-eslint/recommended', |
| 27 | + 'plugin:promise/recommended', |
| 28 | + 'eslint:recommended' |
| 29 | + ], |
| 30 | + rules: { |
| 31 | + // eslint |
| 32 | + 'consistent-return': ['warn'], |
| 33 | + curly: ['warn', 'all'], |
| 34 | + indent: ['warn', 2], |
| 35 | + 'linebreak-style': ['warn', 'unix'], |
| 36 | + 'no-async-promise-executor': ['warn'], |
| 37 | + 'no-await-in-loop': ['warn'], |
| 38 | + 'no-constructor-return': ['warn'], |
| 39 | + 'no-global-assign': ['warn'], |
| 40 | + 'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'], |
| 41 | + 'no-param-reassign': ['warn'], |
| 42 | + 'no-promise-executor-return': ['warn'], |
| 43 | + 'no-return-await': ['warn'], |
| 44 | + 'no-var': ['warn'], |
| 45 | + 'no-undef': ['warn'], |
| 46 | + 'no-useless-return': ['warn'], |
| 47 | + quotes: ['warn', 'single'], |
| 48 | + 'require-await': ['warn'], |
| 49 | + 'require-atomic-updates': ['warn'], |
| 50 | + semi: ['warn', 'always'], |
| 51 | + // promise plugin |
| 52 | + 'promise/always-return': ['warn'], |
| 53 | + 'promise/avoid-new': ['warn'], |
| 54 | + 'promise/catch-or-return': ['warn'], |
| 55 | + 'promise/no-callback-in-promise': ['warn'], |
| 56 | + 'promise/no-native': 'off', |
| 57 | + 'promise/no-nesting': ['warn'], |
| 58 | + 'promise/no-new-statics': ['warn'], |
| 59 | + 'promise/no-promise-in-callback': ['warn'], |
| 60 | + 'promise/no-return-in-finally': ['warn'], |
| 61 | + 'promise/no-return-wrap': ['warn'], |
| 62 | + 'promise/param-names': ['warn'], |
| 63 | + 'promise/valid-params': ['warn'], |
| 64 | + // typescript |
| 65 | + '@typescript-eslint/explicit-function-return-type': ['warn'], |
| 66 | + '@typescript-eslint/no-floating-promises': ['warn', { ignoreVoid: false }], |
| 67 | + '@typescript-eslint/no-misused-promises': ['warn'], |
| 68 | + '@typescript-eslint/no-unnecessary-condition': ['warn'], |
| 69 | + '@typescript-eslint/no-unnecessary-type-constraint': ['warn'], |
| 70 | + '@typescript-eslint/no-unsafe-assignment': ['warn'], |
| 71 | + '@typescript-eslint/no-unsafe-return': ['warn'], |
| 72 | + '@typescript-eslint/no-unused-vars': ['warn'], |
| 73 | + '@typescript-eslint/no-use-before-define': ['warn'], |
| 74 | + '@typescript-eslint/strict-boolean-expressions': ['warn'], |
| 75 | + }, |
| 76 | +}; |
0 commit comments