fix: 去掉eslint的prettier规则,生成的工程会因为这些规则大量报错
This commit is contained in:
26
.eslintrc.js
26
.eslintrc.js
@@ -5,41 +5,27 @@ module.exports = {
|
|||||||
'eslint:recommended',
|
'eslint:recommended',
|
||||||
'plugin:react/recommended',
|
'plugin:react/recommended',
|
||||||
'plugin:@typescript-eslint/recommended',
|
'plugin:@typescript-eslint/recommended',
|
||||||
'prettier',
|
|
||||||
'prettier/prettier',
|
|
||||||
'plugin:prettier/recommended',
|
|
||||||
'plugin:react-hooks/recommended',
|
'plugin:react-hooks/recommended',
|
||||||
'plugin:json/recommended',
|
'plugin:json/recommended',
|
||||||
],
|
],
|
||||||
parser: '@typescript-eslint/parser',
|
parser: '@typescript-eslint/parser',
|
||||||
plugins: ['react', '@typescript-eslint', 'simple-import-sort'],
|
plugins: ['react', '@typescript-eslint'],
|
||||||
rules: {
|
rules: {
|
||||||
'prettier/prettier': ['error', { singleQuote: true }],
|
|
||||||
'@typescript-eslint/no-unused-vars': [
|
'@typescript-eslint/no-unused-vars': [
|
||||||
'off',
|
'off',
|
||||||
{ argsIgnorePattern: ['^_', 'tocoServices'] },
|
{ argsIgnorePattern: ['^_', 'tocoServices'] },
|
||||||
],
|
],
|
||||||
'simple-import-sort/exports': 'error',
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||||
|
"@typescript-eslint/ban-types": 'off',
|
||||||
'react-hooks/exhaustive-deps': 'error',
|
'react-hooks/exhaustive-deps': 'error',
|
||||||
'react/react-in-jsx-scope': 'off',
|
'react/react-in-jsx-scope': 'off',
|
||||||
'react/prop-types': 'off',
|
'react/prop-types': 'off',
|
||||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
'react/no-children-prop': 'off',
|
||||||
|
'import/no-anonymous-default-export': 'off',
|
||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ['**/*.js'],
|
files: ['**/*.config.js'],
|
||||||
rules: {
|
|
||||||
'react/no-children-prop': 'off',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['**/*.json'],
|
|
||||||
rules: {
|
|
||||||
'prettier/prettier': ['error', { singleQuote: false }],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['**/*.config.js', '**/setupProxy.js', 'script/**/*.js'],
|
|
||||||
rules: {
|
rules: {
|
||||||
'@typescript-eslint/no-var-requires': 'off',
|
'@typescript-eslint/no-var-requires': 'off',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,13 +33,7 @@
|
|||||||
"@types/react": "^18.2.60",
|
"@types/react": "^18.2.60",
|
||||||
"@types/react-dom": "^18.2.19",
|
"@types/react-dom": "^18.2.19",
|
||||||
"craco-alias": "^3.0.1",
|
"craco-alias": "^3.0.1",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
|
||||||
"eslint-plugin-json": "^3.1.0",
|
"eslint-plugin-json": "^3.1.0",
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
|
||||||
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
||||||
"prettier": "^3.2.5",
|
|
||||||
"prettier-plugin-organize-imports": "^3.2.4",
|
|
||||||
"prettier-plugin-packagejson": "^2.4.12",
|
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
|
|||||||
Reference in New Issue
Block a user