feat(ui): add eslint unused-imports plugin

Provides autofix for unused imports
This commit is contained in:
psychedelicious 2023-12-08 17:00:08 +11:00
parent ca07449fb4
commit 9661fa5f76
3 changed files with 34 additions and 2 deletions

View File

@ -27,6 +27,7 @@ module.exports = {
'eslint-plugin-react-hooks',
'i18next',
'path',
'unused-imports',
],
root: true,
rules: {
@ -45,9 +46,16 @@ module.exports = {
radix: 'error',
'space-before-blocks': 'error',
'import/prefer-default-export': 'off',
'@typescript-eslint/no-unused-vars': [
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',

View File

@ -142,6 +142,7 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-unused-imports": "^3.0.0",
"madge": "^6.1.0",
"openapi-types": "^12.1.3",
"openapi-typescript": "^6.7.2",

View File

@ -262,6 +262,9 @@ devDependencies:
eslint-plugin-storybook:
specifier: ^0.6.15
version: 0.6.15(eslint@8.55.0)(typescript@5.3.3)
eslint-plugin-unused-imports:
specifier: ^3.0.0
version: 3.0.0(@typescript-eslint/eslint-plugin@6.13.2)(eslint@8.55.0)
madge:
specifier: ^6.1.0
version: 6.1.0(typescript@5.3.3)
@ -8129,6 +8132,26 @@ packages:
- typescript
dev: true
/eslint-plugin-unused-imports@3.0.0(@typescript-eslint/eslint-plugin@6.13.2)(eslint@8.55.0):
resolution: {integrity: sha512-sduiswLJfZHeeBJ+MQaG+xYzSWdRXoSw61DpU13mzWumCkR0ufD0HmO4kdNokjrkluMHpj/7PJeN35pgbhW3kw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
peerDependencies:
'@typescript-eslint/eslint-plugin': ^6.0.0
eslint: ^8.0.0
peerDependenciesMeta:
'@typescript-eslint/eslint-plugin':
optional: true
dependencies:
'@typescript-eslint/eslint-plugin': 6.13.2(@typescript-eslint/parser@6.13.2)(eslint@8.55.0)(typescript@5.3.3)
eslint: 8.55.0
eslint-rule-composer: 0.3.0
dev: true
/eslint-rule-composer@0.3.0:
resolution: {integrity: sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==}
engines: {node: '>=4.0.0'}
dev: true
/eslint-scope@5.1.1:
resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}
engines: {node: '>=8.0.0'}