build: switch Makefiles and pre-commit to flat config (gh54 part VII) - #10973
Draft
Planeshifter wants to merge 4 commits into
Draft
build: switch Makefiles and pre-commit to flat config (gh54 part VII)#10973Planeshifter wants to merge 4 commits into
Planeshifter wants to merge 4 commits into
Conversation
Planeshifter
force-pushed
the
philipp/gh54-switch-to-flat-config
branch
from
March 15, 2026 18:08
c3dab8a to
c6bab92
Compare
7 tasks
Planeshifter
force-pushed
the
philipp/gh54-switch-to-flat-config
branch
from
August 20, 2026 05:57
c6bab92 to
3bdcf70
Compare
Planeshifter
force-pushed
the
philipp/gh54-switch-to-flat-config
branch
from
August 20, 2026 06:11
3bdcf70 to
9610469
Compare
Planeshifter
force-pushed
the
philipp/gh54-switch-to-flat-config
branch
from
August 20, 2026 06:25
9610469 to
92735cb
Compare
kgryte
force-pushed
the
philipp/gh54-switch-to-flat-config
branch
from
August 21, 2026 10:06
92735cb to
bcb201a
Compare
kgryte
force-pushed
the
philipp/gh54-switch-to-flat-config
branch
from
August 21, 2026 10:14
bcb201a to
86526e2
Compare
Planeshifter
force-pushed
the
philipp/gh54-switch-to-flat-config
branch
from
August 25, 2026 03:49
86526e2 to
00d646f
Compare
Add TypeScript-specific flat config blocks for `**/*.d.ts` and `**/test/**/*.ts` files: - Configure `@typescript-eslint/parser` with `parserOptions.project` pointing to the root `tsconfig.json` - Register `@typescript-eslint`, `@stylistic/ts`, `jsdoc`, `import`, `expect-type`, and `stdlib` plugins - Reuse the existing TypeScript rules from `etc/eslint/rules/typescript.js` - Disable `jsdoc/require-jsdoc` for TypeScript test files Ref: stdlib-js/metr-issue-tracker#54
Upgrade ESLint from v8 to v9 and fix all v9-specific breakages:
- Bump `eslint` from `^8.57.0` to `^9.0.0`
- Add `!**/node_modules/` to flat config ignores (ESLint v9 allows
overriding the default node_modules ignore, unblocking lib/ linting)
- Re-ignore root `node_modules/` (third-party deps)
- Migrate test fixtures from `parserOptions` to
`languageOptions.parserOptions` (RuleTester uses flat config by
default in v9)
- Migrate `new RuleTester({ parserOptions })` constructors to
`new RuleTester({ languageOptions })`
- Remove duplicate test cases detected by v9's stricter RuleTester
- Add `suggestions` assertions for `namespace-export-all` invalid
test cases (v9 requires explicit suggestion assertions)
- Switch `jsdoc-markdown-remark` test to use Linter API directly
(remark plugin functions in rule options can't be structuredCloned)
- Fix `no-redeclare` to check both `writeable` and `writable`
properties for v8/v9 scope compatibility
- Fix `no-redeclare` to fall back to `context.parserOptions` when
`context.languageOptions` is unavailable
- Remove `builtinGlobals` invalid test cases that rely on implicit
globals (not available in v9 flat config mode)
- All 123 custom rule tests pass on ESLint v9
Ref: stdlib-js/metr-issue-tracker#54
Follow-up to the ESLint v9 upgrade:
- Migrates the `format-args` rule tests to `languageOptions`. The rule
landed on `develop` after this branch was written, so the rebase
pulled it in unmigrated and its tests errored under v9 with "Key
\"parserOptions\": This appears to be in eslintrc format rather than
flat config format".
- Narrows the flat config un-ignore from `!**/node_modules/` to
`!lib/node_modules/`. The broad pattern un-ignored nested
`node_modules` directories inside packages (e.g. `nyc` caches under
`math/base/special/*/node_modules/`), which then got linted. The
narrow pattern leaves those to ESLint's default ignores, making the
separate `node_modules/` re-ignore unnecessary. Verified identical
behavior across all tracked source files.
- Restores the two `no-redeclare` `builtinGlobals` invalid fixtures
using `languageOptions.sourceType: 'script'`. They failed under flat
config because its default `sourceType` is `module`, which places
`var` declarations in module rather than global scope; they do not
depend on how v9 exposes implicit globals.
- Regenerates `etc/npm/deps.txt` for the `eslint` and
`eslint-plugin-expect-type` version bumps.
All 124 custom rule tests pass on ESLint v9.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Update build tooling to use ESLint flat config (`eslint.config.js`) instead of legacy `.eslintrc.*` files: - Remove `ESLINT_USE_FLAT_CONFIG=false` from JS eslint.mk - Remove `--ignore-path`, `--config`, and per-target config variables from both JS and TS eslint.mk (flat config autodiscovery handles all of this via `eslint.config.js`) - Remove per-directory tsconfig.json copy mechanism from TS eslint.mk (the flat config's TS block points to the root tsconfig.json) - Remove legacy config path variables from pre-commit hook ESLint now autodiscovers `eslint.config.js` at the repo root and applies the correct rules based on file patterns (benchmarks, tests, examples, TypeScript) defined in the flat config. Ref: stdlib-js/metr-issue-tracker#54
kgryte
force-pushed
the
philipp/gh54-switch-to-flat-config
branch
from
August 26, 2026 01:17
00d646f to
a1f1006
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Progresses stdlib-js/metr-issue-tracker#54.
Description
This pull request:
.eslintrc.*config to flat config autodiscoveryESLINT_USE_FLAT_CONFIG=false,--ignore-path,--config, and per-target config variables from JS and TS eslint.mk.tsconfig.jsoncopy mechanism from TS eslint.mk (flat config's TS block handles this).eslint.config.cjsand applies rules based on file patterns.Related Issues
This pull request has the following related issues:
Questions
No.
Other
Stacked on #10972.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code.
@stdlib-js/reviewers