Skip to content

Migrate to ESLint 9 flat config and add Prettier config#101

Open
cusxy wants to merge 1 commit into
nvuillam:mainfrom
cusxy:feat/eslint9-flat-config
Open

Migrate to ESLint 9 flat config and add Prettier config#101
cusxy wants to merge 1 commit into
nvuillam:mainfrom
cusxy:feat/eslint9-flat-config

Conversation

@cusxy

@cusxy cusxy commented Mar 14, 2026

Copy link
Copy Markdown

Summary

  • Migrate ESLint to v9 flat config: Replace legacy .eslintrc.js with eslint.config.js using ESLint 9's flat config format
  • Remove @babel/eslint-parser: The project uses plain JavaScript with no experimental syntax, so the built-in ESLint parser is sufficient
  • Add .prettierrc: Explicit Prettier configuration (tabWidth: 2, printWidth: 150, semi: true, singleQuote: false) replacing inline CLI flags
  • Update lint:fix script: Use proper quoted glob pattern and rely on .prettierrc instead of CLI flags
  • Add new devDependencies: @eslint/js, globals, prettier
  • Remove "use strict" class body statements: These were no-ops inside ES2015+ class bodies
  • Apply consistent formatting: Prettier reformatted source files to match the new 2-space / 150-char-width config

Details

ESLint Config (eslint.config.js)

  • Uses @eslint/js recommended rules
  • ecmaVersion: 2022, sourceType: "commonjs" (corrects the old config which incorrectly had sourceType: "module")
  • Separate config block for test files with globals.mocha
  • Proper ignore patterns for node_modules/, coverage/, .nyc_output/

Removed Dependencies

  • @babel/eslint-parser (and its transitive dep @nicolo-ribaudo/eslint-scope-5-internals)

Added Dependencies

  • @eslint/js ^9.39.4
  • globals ^17.4.0
  • prettier ^3.8.1

Test plan

  • npm test — all 9 tests passing
  • npm run lint:fix — runs cleanly with no changes needed

🤖 Generated with Claude Code

Replace legacy .eslintrc.js with eslint.config.js flat config, remove
@babel/eslint-parser in favor of the built-in parser, add .prettierrc,
and apply consistent 2-space formatting across source files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant