Skip to content

chore: move to eslint 10 and neostandard - #60

Open
xiaodoudou wants to merge 1 commit into
masterfrom
chore/eslint-flat-config
Open

xiaodoudou wants to merge 1 commit into
masterfrom
chore/eslint-flat-config

Conversation

@xiaodoudou

Copy link
Copy Markdown
Owner

Stacked on #59. This clears the last npm audit finding: minimatch before 11.0.1 (moderate, GHSA-g3hv-75wg-m249), which came in through eslint 8 and its plugins.

Moving to eslint 10 on its own doesn't fix it. eslint 10.14.0, @eslint/config-array and typescript-estree all still ask for minimatch ^10, and the advisory has no 10.x patch. So package.json gets an overrides entry forcing minimatch ^11.0.1. 11.0 removed makeRe(), .regexp, matchOne() and the AST class, but those three packages only call new Minimatch() and .match(), which are still there.

eslint-config-standard never supported flat config, so it's replaced by neostandard, which bundles the n, promise and stylistic plugins. That takes the dev dependencies from five eslint packages down to eslint and neostandard, and .eslintrc.json becomes eslint.config.js.

The rules are the same as before, checked by diffing --print-config against the old setup:

  • func-call-spacing, no-new-object and no-new-symbol carry over under their new names
  • the six import/* rules are gone, but they only look at ES import statements and this code uses require
  • neostandard drops dot-notation and only warns on comma-dangle and n/no-deprecated-api, so the config sets those three back to errors

Flat config doesn't skip dot-folders the way eslintrc did, so .claude/ is ignored explicitly. Without that, a local npm run lint also walks the agent worktrees.

  • npm audit, dev included: 0 vulnerabilities
  • npm run lint: 46 files, 0 errors, 0 warnings, and a file with deliberate violations still gets flagged
  • npm test: 222 pass, 2 skipped
  • neostandard needs Node ^22.13.0 || >=24. CI lints on 22.x, so that's fine, but it's higher than the >=22.0.0 in engines (which is about running the app, not linting it)

eslint-config-standard never supported flat config, so this swaps it for
neostandard, which bundles the n, promise and stylistic plugins, and
replaces .eslintrc.json with eslint.config.js.

eslint 10.14.0 still depends on minimatch ^10, and GHSA-g3hv-75wg-m249
covers every version before 11.0.1, so minimatch is overridden to
^11.0.1. eslint, @eslint/config-array and typescript-estree only use
new Minimatch() and .match(), which 11 keeps.

The rules match the old config: renamed rules carry over, the dropped
import/* rules only apply to ES imports, and dot-notation, comma-dangle
and n/no-deprecated-api are set back to errors.
@xiaodoudou
xiaodoudou changed the base branch from fix/undici-7.30.1 to master November 10, 2026 04:28
@xiaodoudou xiaodoudou closed this Nov 10, 2026
@xiaodoudou xiaodoudou reopened this Nov 10, 2026
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