feat(eslint-config): migrate to native flat config and upgrade to ESLint 10 / @wordpress/eslint-plugin 25 - #140
Conversation
…int 10 / @wordpress/eslint-plugin 25
943d1a1 to
a3e9fb9
Compare
There was a problem hiding this comment.
Pull request overview
This PR upgrades the monorepo’s ESLint stack to ESLint 10 and @wordpress/eslint-plugin 25, and migrates @yardinternet/eslint-config from the FlatCompat bridge to native flat config exports. It also updates dependency alignment in @yardinternet/toolkit and refreshes the config snapshots accordingly.
Changes:
- Migrate
@yardinternet/eslint-configto native flat config by directly exporting@wordpress/eslint-plugin’s recommended flat config and layering local overrides. - Upgrade ESLint to
^10.6.0and@wordpress/eslint-pluginto^25.6.0, with corresponding dependency cleanup/realignment. - Update Vitest snapshots to reflect the new config shape/rulesets.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/toolkit/package.json | Upgrades ESLint/WordPress plugin deps and realigns toolkit dependencies for the new linting stack. |
| packages/eslint-config/src/index.js | Switches config export to native flat config and reworks JS/TS overrides on top of WordPress recommended. |
| packages/eslint-config/package.json | Updates dependencies for the new flat config approach and ESLint 10. |
| packages/eslint-config/tests/snapshots/config.snapshot.test.js.snap | Refreshes snapshots to match the updated config/rules/patterns. |
| package.json | Adjusts the root Prettier alias version range. |
| // Register TS ourselves so it works regardless of whether the consumer has | ||
| // `typescript` installed. Scoped to TS files to keep the babel parser on JS. | ||
| ...tseslint.configs.recommended.map( ( config ) => ( { | ||
| ...config, | ||
| files: [ '**/*.ts', '**/*.tsx' ], |
There was a problem hiding this comment.
True maar we gebruiken nooit .mts of .cts bestanden, dus deze laat ik
| "dependencies": { | ||
| "@babel/eslint-parser": "^7.25.7", | ||
| "@babel/preset-react": "^7.29.7", | ||
| "@eslint/compat": "^2.1.0", | ||
| "@eslint/eslintrc": "^3.3.3", | ||
| "@eslint/js": "^9.39.1", | ||
| "@typescript-eslint/eslint-plugin": "^8.60.1", | ||
| "@typescript-eslint/parser": "^8.60.1", | ||
| "@wordpress/eslint-plugin": "^24.5.0", | ||
| "eslint-config-prettier": "^10.1.8", | ||
| "@wordpress/eslint-plugin": "^25.6.0", | ||
| "eslint-import-resolver-alias": "^1.1.2", | ||
| "eslint-plugin-import": "^2.32.0", | ||
| "eslint-plugin-react-hooks": "^7.1.1", | ||
| "globals": "^17.6.0" | ||
| "globals": "^17.7.0", | ||
| "typescript-eslint": "^8.62.1" |
There was a problem hiding this comment.
Linting gaat via de @yardinternet/toolkit package, en daar staat hij bij. Hier is ie niet nodig
| "stylelint": "^17.13.0", | ||
| "stylelint-config-idiomatic-order": "^10.0.0", | ||
| "stylelint-config-recommended": "^18.0.0" | ||
| "stylelint-config-recommended": "^18.0.0", | ||
| "typescript-eslint": "^8.62.1" | ||
| }, |
There was a problem hiding this comment.
Klopt niet, @typescript-eslint heeft alleen typescript als dependency nodig voor rules die type-aware zijn. En in de recommended config zijn er geen type-aware rules.
FreakyWizard
left a comment
There was a problem hiding this comment.
(beter laat dan nooit)
Lekker bezig! Wel jammer dat mijn werk nu deels overbodig is.
Het kan nog wel van CommonJS naar module worden overgezet
Dependencies geupdatet naar 10 en migreert de eslint config van FlatCamp-bridge naar de native flat config:
@wordpress/eslint-plugineindelijk support heeft)typescript-eslint(werkt ook zonder dat typescript toegevoegd is in de package.json van het project die deze config consumeert)@wordpress/eslint-plugin)@yardinternet/toolkitdependencies rechtgetrokkenTests zijn groen 💚