eslint: Autoremove unused imports

Also clean config a bit
This commit is contained in:
nikolark committed 2024-07-05 22:26:55 +02:00
1 parent 62ea54a313
commit 4e3bf22e93
3 files changed
+43 -9

No files matched your search

+11 -9
View File
@@ -9,20 +9,22 @@ module.exports = {
'plugin:import/warnings',
],
rules: {
'no-plusplus': 0,
'no-console': 0,
'no-underscore-dangle': 0,
'no-param-reassign': 0,
'no-plusplus': 'off',
'no-console': 'off',
'no-underscore-dangle': 'off',
'no-param-reassign': 'off',
'no-unused-vars': 'off',
'react/prefer-stateless-function': 1,
'react/prop-types': 'off', // FIXME: typescript
'class-methods-use-this': 1, // FIXME: refactor
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/sort-comp': 0,
'max-len': 0,
'class-methods-use-this': 'error', // FIXME: refactor
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }],
'react/sort-comp': 'off',
'max-len': 'off',
'no-use-before-define': ['error', { functions: true, classes: true, variables: false }], // disable the rule for variables, but enable it for functions and classes
'react-native/no-inline-styles': 'off', // FIXME: refactor
'unused-imports/no-unused-imports': 'error',
},
plugins: ['prettier'],
plugins: ['prettier', 'unused-imports'],
parser: '@babel/eslint-parser',
settings: {
react: {
+31
View File
@@ -56,6 +56,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-unused-imports": "^3.2.0",
"prettier": "^3.3.2"
}
},
@@ -11258,6 +11259,36 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/eslint-plugin-unused-imports": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.2.0.tgz",
"integrity": "sha512-6uXyn6xdINEpxE1MtDjxQsyXB37lfyO2yKGVVgtD7WEWQGORSOZjgrD6hBhvGv4/SO+TOlS+UnC6JppRqbuwGQ==",
"dev": true,
"dependencies": {
"eslint-rule-composer": "^0.3.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "6 - 7",
"eslint": "8"
},
"peerDependenciesMeta": {
"@typescript-eslint/eslint-plugin": {
"optional": true
}
}
},
"node_modules/eslint-rule-composer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz",
"integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==",
"dev": true,
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
+1
View File
@@ -58,6 +58,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-unused-imports": "^3.2.0",
"prettier": "^3.3.2"
},
"private": true