Editor Integration
@eienjs/eslint-config is designed to serve as both your linter and code formatter inside your IDE.
VS Code Setup
Install the official ESLint extension for VS Code.
If you ran the CLI Wizard, .vscode/settings.json is already configured for you. Otherwise, add the following to .vscode/settings.json:
{
"prettier.enable": false,
"editor.formatOnSave": false,
"eslint.format.enable": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.organizeImports": "never"
},
"eslint.runtime": "node",
"eslint.validate": [
"javascript",
"typescript",
"vue",
"html",
"markdown",
"json",
"json5",
"jsonc",
"yaml",
"toml",
"xml",
"astro",
"css",
"less",
"scss",
"pcss",
"postcss"
]
}
Smart Editor Mode (isInEditor)
When ESLint runs inside an editor (VS Code, JetBrains IDEs, Vim, Neovim, or Zed), @eienjs/eslint-config automatically enables isInEditor mode so that auto-fixing on save never deletes work-in-progress code:
- Unused Imports (
unused-imports/no-unused-imports): Reported in the editor, but auto-fix is disabled so imports are not stripped while you are still typing. - Focused Tests (
test/no-only-tests): Downgraded to'warn'with auto-fix disabled so.onlyis not removed while debugging tests. prefer-const: Auto-fix is disabled in the editor soletvariables are not prematurely converted toconstbefore you write a reassignment.- pnpm Workspace Settings: Disables aggressive autofixes in
package.jsonwhile editing.
When running ESLint from the terminal, in CI (CI=true), or inside Git hooks / lint-staged, isInEditor automatically resolves to false and all strict errors and auto-fixes apply.
Overriding isInEditor
You can explicitly force editor mode on or off in eslint.config.js:
import { eienjs } from '@eienjs/eslint-config';
export default eienjs({
isInEditor: false,
});
Inspecting Your Config
You can visually inspect all active rules, plugins, and matching files in your project using @eslint/config-inspector:
npx @eslint/config-inspector
