Skip to content

Commit 7ac3ee5

Browse files
committed
feat: do not auto fix unused-imports/no-unused-imports in editors
1 parent 6d2b142 commit 7ac3ee5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/eslint-config-basic/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// eslint-disable-next-line n/prefer-global/process
2+
const isInEditor = (process.env.VSCODE_PID || process.env.JETBRAINS_IDE) && !process.env.CI
3+
const offInEditor = isInEditor ? 'off' : 'error'
4+
15
/** @type {import('eslint-define-config').ESLintConfig} */
26
module.exports = {
37
env: {
@@ -232,7 +236,7 @@ module.exports = {
232236
'quotes': ['error', 'single'],
233237
'quote-props': ['error', 'consistent-as-needed'],
234238

235-
'unused-imports/no-unused-imports': 'error',
239+
'unused-imports/no-unused-imports': offInEditor,
236240
'unused-imports/no-unused-vars': ['warn', { vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' }],
237241

238242
'no-param-reassign': 'off',

0 commit comments

Comments
 (0)