Skip to content

Commit ed2b006

Browse files
committedAug 23, 2023
feat: do not auto fix unused-imports/no-unused-imports in editors
1 parent 6427846 commit ed2b006

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
module.exports = {
26
env: {
37
es6: true,
@@ -233,7 +237,7 @@ module.exports = {
233237
'quotes': ['error', 'single'],
234238
'quote-props': ['error', 'consistent-as-needed'],
235239

236-
'unused-imports/no-unused-imports': 'error',
240+
'unused-imports/no-unused-imports': offInEditor,
237241
'unused-imports/no-unused-vars': [
238242
'warn',
239243
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },

0 commit comments

Comments
 (0)
Please sign in to comment.