Skip to content

Commit f466ac5

Browse files
committedJan 29, 2023
feat: auto fix for unused imports
1 parent 6e750c6 commit f466ac5

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed
 

‎packages/basic/index.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ module.exports = {
3737
'unicorn',
3838
'antfu',
3939
'no-only-tests',
40+
'unused-imports',
4041
],
4142
settings: {
4243
'import/resolver': {
@@ -177,6 +178,8 @@ module.exports = {
177178
'@typescript-eslint/comma-dangle': 'off',
178179
'@typescript-eslint/consistent-type-imports': 'off',
179180
'import/no-unresolved': 'off',
181+
'unused-imports/no-unused-imports': 'off',
182+
'unused-imports/no-unused-vars': 'off',
180183
'no-alert': 'off',
181184
'no-console': 'off',
182185
'no-restricted-imports': 'off',
@@ -199,7 +202,13 @@ module.exports = {
199202
'curly': ['error', 'multi-or-nest', 'consistent'],
200203
'quotes': ['error', 'single'],
201204
'quote-props': ['error', 'consistent-as-needed'],
202-
'no-unused-vars': 'warn',
205+
206+
'unused-imports/no-unused-imports': 'error',
207+
'unused-imports/no-unused-vars': [
208+
'warn',
209+
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
210+
],
211+
203212
'no-param-reassign': 'off',
204213
'array-bracket-spacing': ['error', 'never'],
205214
'brace-style': ['error', 'stroustrup', { allowSingleLine: true }],

‎packages/basic/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"eslint-plugin-no-only-tests": "^3.1.0",
3030
"eslint-plugin-promise": "^6.1.1",
3131
"eslint-plugin-unicorn": "^45.0.2",
32+
"eslint-plugin-unused-imports": "^2.0.0",
3233
"eslint-plugin-yml": "^1.4.0",
3334
"jsonc-eslint-parser": "^2.1.0",
3435
"yaml-eslint-parser": "^1.1.0"

‎packages/typescript/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ module.exports = {
113113
],
114114
offsetTernaryExpressions: true,
115115
}],
116-
'no-unused-vars': 'off',
117-
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
118116
'no-redeclare': 'off',
119117
'@typescript-eslint/no-redeclare': 'error',
120118
'no-use-before-define': 'off',

‎pnpm-lock.yaml

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.