我正在使用create-react-app,并已为我的项目配置了eslint。以下是我的.eslintrc文件。
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"react-hooks"
],
"extends": [
"plugin:prettier/recommended",
"airbnb-typescript-prettier",
"prettier",
"plugin:import/typescript"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
// Make prettier code formatting suggestions more verbose.
"prettier/prettier": [
"warn"
],
"camelcase": "warn",
"no-console": "error",
"no-prototype-builtins": "warn",
"arrow-body-style": "warn",
"prefer-arrow-callback": "warn",
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/no-noninteractive-element-interactions": "warn",
// Disable <Fragment> => <> replacement. Feel free to change
"react/jsx-fragments": "off",
"react/destructuring-assignment": "warn",
"react/no-unused-prop-types": "warn",
//TODO: Remove this rule later
"react/jsx-props-no-spreading": "off",
"react/require-default-props": 0,
"react-hooks/exhaustive-deps": "warn",
// Disable prefer default export
"import/prefer-default-export": "off",
"no-underscore-dangle": "off",
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-inferrable-types": "warn",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
]
}
}
问题在于,在构建阶段它占用了大量内存。因此我无法使用8GB内存的docker。有没有办法 仅在构建阶段 禁用eslint? 我需要这些规则进行开发,但不希望它们影响我的构建阶段。可以请有人帮忙吗? 先感谢您。