feat: auto fix for unused imports

This commit is contained in:
Anthony Fu
2023-01-29 01:58:08 +01:00
parent 6e750c6000
commit f466ac5446
4 changed files with 32 additions and 3 deletions

View File

@@ -37,6 +37,7 @@ module.exports = {
'unicorn',
'antfu',
'no-only-tests',
'unused-imports',
],
settings: {
'import/resolver': {
@@ -177,6 +178,8 @@ module.exports = {
'@typescript-eslint/comma-dangle': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
'import/no-unresolved': 'off',
'unused-imports/no-unused-imports': 'off',
'unused-imports/no-unused-vars': 'off',
'no-alert': 'off',
'no-console': 'off',
'no-restricted-imports': 'off',
@@ -199,7 +202,13 @@ module.exports = {
'curly': ['error', 'multi-or-nest', 'consistent'],
'quotes': ['error', 'single'],
'quote-props': ['error', 'consistent-as-needed'],
'no-unused-vars': 'warn',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
'no-param-reassign': 'off',
'array-bracket-spacing': ['error', 'never'],
'brace-style': ['error', 'stroustrup', { allowSingleLine: true }],

View File

@@ -29,6 +29,7 @@
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^45.0.2",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-yml": "^1.4.0",
"jsonc-eslint-parser": "^2.1.0",
"yaml-eslint-parser": "^1.1.0"

View File

@@ -113,8 +113,6 @@ module.exports = {
],
offsetTernaryExpressions: true,
}],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
'no-use-before-define': 'off',