Skip to content

chore: eslint v10 upgrade#2983

Draft
AmberFryar wants to merge 10 commits intomainfrom
eslint-testing
Draft

chore: eslint v10 upgrade#2983
AmberFryar wants to merge 10 commits intomainfrom
eslint-testing

Conversation

@AmberFryar
Copy link
Copy Markdown
Contributor

@AmberFryar AmberFryar commented Mar 2, 2026

Description

Upgrade to eslint 10 and make required updates.
...

End to End Test:
(See Pepr Excellent Examples)

Related Issue

Fixes #

Relates to #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@AmberFryar AmberFryar requested a review from a team as a code owner March 2, 2026 19:03
@AmberFryar AmberFryar marked this pull request as draft March 2, 2026 19:03
@AmberFryar AmberFryar changed the title Eslint testing chore: eslint testing Mar 2, 2026
@AmberFryar AmberFryar marked this pull request as ready for review March 2, 2026 20:49
@AmberFryar AmberFryar changed the title chore: eslint testing chore: eslint v10 upgrade Mar 5, 2026
@samayer12
Copy link
Copy Markdown
Contributor

@greptileai

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 17, 2026

Greptile Summary

This PR upgrades ESLint from v9 to v10 and migrates all config files from FlatCompat-wrapped configs to native flat config syntax (tsPlugin.configs["flat/recommended"]). It also removes fileURLToPath/__dirname boilerplate in favour of import.meta.dirname, adds { cause } chaining to re-thrown errors in several source files, and pins previously range-versioned devDependencies to exact versions.

Confidence Score: 5/5

Safe to merge; all findings are P2 style suggestions that do not block functionality

The ESLint v10 migration is mechanically correct — FlatCompat removed, flat/recommended adopted, import.meta.dirname substituted for __dirname boilerplate. Source-code linting fixes (cause chaining, const promotion, unused assignment removal) are all valid improvements. The three P2 comments on package.json (engines field accuracy, @types/eslint version, @types/command-line-args version) are housekeeping items that won't break anything at runtime.

package.json — engines field and type package versions deserve a follow-up

Important Files Changed

Filename Overview
package.json ESLint 10.0.1 added to dependencies; engines field unchanged at >=20.0.0 despite ESLint 10 requiring ^20.19.0+; @types/command-line-args@5.x alongside command-line-args@6.x
config/eslint.root.config.mjs Correctly migrated to native flat config using tsPlugin.configs["flat/recommended"] and import.meta.dirname; FlatCompat removed
config/eslint.integration.config.mjs Cleanly migrated to flat config; tsParser/typescriptEslint explicit registrations removed in favour of flat/recommended
config/eslint.test.config.mjs Migrated to flat config; correctly dropped path import since import.meta.dirname is now used directly
src/templates/eslint.config.mjs Template updated to flat/recommended pattern; uses import.meta.dirname consistent with ESLint 10's node requirements
src/lib/controller/migrateStore.ts Removed redundant reassignment of storeCache after sendUpdatesAndFlushCache; correct since storeCache is unused after that point
src/cli/init/templates.test.ts Updated test assertion to check for flat/recommended string instead of parser: tsParser — correctly reflects the new config format

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["npm run format:*"] --> B["eslint CLI v10"]
    B --> C{Config target}
    C -->|src/**| D["eslint.root.config.mjs"]
    C -->|src/**/*.test.ts| E["eslint.test.config.mjs"]
    C -->|integration/**| F["eslint.integration.config.mjs"]
    D --> G["js.configs.recommended"]
    D --> H["tsPlugin.configs['flat/recommended']"]
    D --> I["Custom rules\n(no-floating-promises, etc.)"]
    E --> G
    E --> H
    E --> J["Test-specific rules\n(max-nested-callbacks: 8)"]
    F --> G
    F --> H
    F --> K["Integration rules\n(complexity, max-depth, etc.)"]
    H --> L["@typescript-eslint/parser\nauto-registered"]
    M["src/templates/eslint.config.mjs\n(generated into user projects)"] -->|same flat/recommended pattern| H
Loading

Comments Outside Diff (1)

  1. package.json, line 9-11 (link)

    P2 engines field not updated for ESLint 10

    ESLint 10 (@eslint/core, @eslint/config-array, @eslint/js) requires "node": "^20.19.0 || ^22.13.0 || >=24", but the engines field still declares >=20.0.0. Any user (or CI runner) on Node 20.0.0–20.18.x will get an engines mismatch warning from npm and ESLint will fail to execute. The generated template (src/templates/eslint.config.mjs) also uses import.meta.dirname, which was only added in Node 20.11.0, compounding the risk for end-users of the scaffold.

Reviews (1): Last reviewed commit: "chore: update deps" | Re-trigger Greptile

Comment thread package.json
"@semantic-release/npm": "13.1.4",
"@semantic-release/release-notes-generator": "14.1.0",
"@types/command-line-args": "5.2.3",
"@types/eslint": "9.6.1",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 @types/eslint@9.6.1 may conflict with ESLint 10's bundled types

ESLint 10 was rewritten in TypeScript and ships its own type definitions. @types/eslint@9.6.1 is the DefinitelyTyped community package targeting the ESLint 9 API surface. Having both on the resolution path can cause duplicate/conflicting type declarations. Consider either removing @types/eslint entirely (relying on ESLint 10's own types) or checking whether a @types/eslint@10.x exists before keeping this entry.

Comment thread package.json Outdated
},
"devDependencies": {
"@commitlint/cli": "20.4.3",
"@commitlint/config-conventional": "20.4.3",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 @types/command-line-args@5.x types for a command-line-args@6.x runtime

command-line-args was bumped to 6.0.1 in dependencies (new direct dep in this PR), but @types/command-line-args remains at 5.2.3 in devDependencies. A major version bump typically means breaking API changes; if the 6.x API surface diverged from the 5.x types, TypeScript will silently accept incorrect call signatures. Consider updating @types/command-line-args to a version that targets v6, or verifying the API is identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants