Skip to content

Commit

Permalink
feat: auto fix for unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 29, 2023
1 parent 6e750c6 commit f466ac5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
11 changes: 10 additions & 1 deletion packages/basic/index.js
Expand Up @@ -37,6 +37,7 @@ module.exports = {
'unicorn',
'antfu',
'no-only-tests',
'unused-imports',
],
settings: {
'import/resolver': {
Expand Down Expand Up @@ -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',
Expand All @@ -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 }],
Expand Down
1 change: 1 addition & 0 deletions packages/basic/package.json
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions packages/typescript/index.js
Expand Up @@ -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',
Expand Down
21 changes: 21 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f466ac5

Please sign in to comment.