-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
configurationProject setup and configuration filesProject setup and configuration filesenhancementNew feature or requestNew feature or request
Milestone
Description
feat(eslint): migrate to ESLint 9 flat config
| β±οΈ Estimate | π Priority | π Size | π Start | π End |
|---|---|---|---|---|
| 2h | P3 | S | 24-01-2026 | 24-01-2026 |
πΈ Screenshots
| Current | Expected |
|---|---|
| N/A β This change has no visual impact. | N/A β This change has no visual impact. |
π Summary
- Migrate from
ESLint 8toESLint 9 - Migrate from legacy
.eslintrc.jsto flat configeslint.config.js - Update all
ESLintplugins toESLint 9compatible versions
π‘ Why this change?
ESLint 8is approaching end of active support;ESLint 9is the current major version- Flat config is the new standard; legacy
.eslintrc.*format is deprecated - Current plugins require
ESLint 9compatible versions for latest features .eslintignoreis deprecated in favor ofignoresin flat config
β Benefits
- Simpler, more explicit configuration without cascading confusion
- Native ESM support and better module composition
- Single configuration file replaces
.eslintrc.*+.eslintignore - Access to latest
ESLintrules and plugin features
π Steps
Phase 1: Update ESLint and plugins
- Update
ESLintto v9 asdevDependencies:
npm install -D eslint@9- Update
ESLintplugins toESLint 9compatible versions asdevDependencies:
npm install -D eslint-plugin-vue@latest eslint-plugin-prettier@latest eslint-config-prettier@latest- Install new required packages as
devDependencies:
npm install -D @eslint/js globalsPhase 2: Create flat config
- Create
eslint.config.js:
import eslint from "@eslint/js";
import pluginVue from "eslint-plugin-vue";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import globals from "globals";
export default [
{
ignores: [
"dist/**",
"node_modules/**",
"*.min.js",
],
},
eslint.configs.recommended,
...pluginVue.configs["flat/recommended"],
eslintPluginPrettierRecommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
ecmaVersion: "latest",
sourceType: "module",
},
rules: {
// Add your custom rules here
"vue/multi-word-component-names": "off",
"vue/no-v-html": "off",
// ... migrate rules from .eslintrc.js
},
},
];Phase 3: Migrate rules
- Migrate all rules from
.eslintrc.jstoeslint.config.js - Update rule format where needed (some rules changed in
ESLint 9) - Remove deprecated rules
Phase 4: Update package.json scripts
- Update
ESLintscript (if needed):
"eslint:fix": "eslint \"**/*.{js,cjs,mjs,vue}\" --fix"Phase 5: Clean up
- Remove
.eslintrc.jsfile - Remove
.eslintignorefile (useignoresin config)
π§ͺ Tests
- Verify
ESLintauto-fix runs without errors:
npm run eslint:fix- Check all files are linted correctly
- Check Vue files are linted correctly
- Test
pre-commithook works correctly
π Notes
- This issue requires completing the Vite migration first
ESLint 9is not compatible with@vue/cli-plugin-eslint- Flat config uses ES modules, so
"type": "module"is needed inpackage.json
π References
Files to create
eslint.config.js
Files to modify
package.json
Files to remove
.eslintrc.js.eslintignore
Documentation
- https://eslint.org/docs/latest/use/configure/configuration-files-new
- https://eslint.org/docs/latest/use/configure/migration-guide
- https://eslint.vuejs.org/user-guide/#usage
Related Issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
configurationProject setup and configuration filesProject setup and configuration filesenhancementNew feature or requestNew feature or request