2 changed files with 4 additions and 72 deletions
@ -1,76 +1,8 @@ |
|||
const eslintConfig = require('umi-lint/config/.eslintrc.js'); |
|||
module.exports = { |
|||
extends: [ |
|||
'airbnb', |
|||
'prettier', |
|||
'plugin:compat/recommended', |
|||
'airbnb-typescript', |
|||
'plugin:@typescript-eslint/recommended', |
|||
'plugin:eslint-comments/recommended', |
|||
'plugin:jest/recommended', |
|||
'plugin:promise/recommended', |
|||
'prettier', |
|||
'prettier/react', |
|||
'prettier/@typescript-eslint', |
|||
], |
|||
env: { |
|||
browser: true, |
|||
node: true, |
|||
es6: true, |
|||
mocha: true, |
|||
jest: true, |
|||
jasmine: true, |
|||
}, |
|||
...eslintConfig, |
|||
globals: { |
|||
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true, |
|||
page: true, |
|||
}, |
|||
rules: { |
|||
'react/jsx-filename-extension': [1, { extensions: ['.js'] }], |
|||
'react/jsx-wrap-multilines': 0, |
|||
'react/prop-types': 0, |
|||
'react/forbid-prop-types': 0, |
|||
'react/jsx-one-expression-per-line': 0, |
|||
'import/no-unresolved': [2, { ignore: ['^@/', '^umi/'] }], |
|||
'import/no-extraneous-dependencies': [ |
|||
2, |
|||
{ |
|||
optionalDependencies: true, |
|||
devDependencies: ['**/tests/**.js', '/mock/**/**.js', '**/**.test.js'], |
|||
}, |
|||
], |
|||
'jsx-a11y/no-noninteractive-element-interactions': 0, |
|||
'jsx-a11y/click-events-have-key-events': 0, |
|||
'jsx-a11y/no-static-element-interactions': 0, |
|||
'jsx-a11y/anchor-is-valid': 0, |
|||
'linebreak-style': 0, |
|||
// Too restrictive, writing ugly code to defend against a very unlikely scenario: https://eslint.org/docs/rules/no-prototype-builtins
|
|||
'no-prototype-builtins': 'off', |
|||
'import/prefer-default-export': 'off', |
|||
'import/no-default-export': [true, 'camel-case'], |
|||
// Too restrictive: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
|
|||
'react/destructuring-assignment': 'off', |
|||
// No jsx extension: https://github.com/facebook/create-react-app/issues/87#issuecomment-234627904
|
|||
'react/jsx-filename-extension': 'off', |
|||
// Use function hoisting to improve code readability
|
|||
'no-use-before-define': ['error', { functions: false, classes: true, variables: true }], |
|||
// Makes no sense to allow type inferrence for expression parameters, but require typing the response
|
|||
'@typescript-eslint/explicit-function-return-type': [ |
|||
'off', |
|||
{ allowTypedFunctionExpressions: true }, |
|||
], |
|||
'@typescript-eslint/no-use-before-define': [ |
|||
'error', |
|||
{ functions: false, classes: true, variables: true, typedefs: true }, |
|||
], |
|||
// Common abbreviations are known and readable
|
|||
'unicorn/prevent-abbreviations': 'off', |
|||
'@typescript-eslint/explicit-member-accessibility': 0, |
|||
'import/no-cycle': 0, |
|||
}, |
|||
plugins: ['@typescript-eslint', 'eslint-comments', 'jest', 'promise', 'unicorn'], |
|||
settings: { |
|||
// support import modules from TypeScript files in JavaScript files
|
|||
'import/resolver': { node: { extensions: ['.js', '.ts', '.tsx'] } }, |
|||
polyfills: ['fetch', 'Promise', 'URL', 'object-assign'], |
|||
}, |
|||
}; |
|||
|
|||
Loading…
Reference in new issue