build: add eslint.flat.config.js for ESLint v8 - #10967
Conversation
676204c to
1b253a7
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
1b253a7 to
fd4e835
Compare
fd4e835 to
6cba0ae
Compare
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
6cba0ae to
338fb5d
Compare
eslint.config.cjs for JavaScript targets on ESLint v8eslint.config.cjs for JavaScript targets on ESLint v8 (gh54 part V)
0d008d7 to
0705d6b
Compare
2f7e85f to
0a351ef
Compare
This could be a very large gap in time to effectively disable ALL of our custom ESLint rules. Have you thought through the implications of this? How are we going to handle linting in the interim and ensure we don't accumulate a bunch of technical debt? |
81ff4c7 to
ca7663f
Compare
eslint.config.cjs for JavaScript targets on ESLint v8 (gh54 part V)eslint.flat.config.js for JavaScript targets on ESLint v8 (gh54 part V)
Renamed the file to |
ca7663f to
6a92161
Compare
Add flat config alongside the legacy `.eslintrc.*` configuration:
- Create `eslint.config.cjs` with base JS config, override blocks
for benchmarks, examples, tests, and REPL namespace files
- Inline stdlib rules as a runtime plugin object via
`lib/node_modules/@stdlib/_tools/eslint/rules/scripts/plugin.js`
- Reuse existing rule definitions from `etc/eslint/rules/`
- Separate non-clonable rule options (remark plugin instances) from
the main rules object to work around `structuredClone` limitations
in ESLint's flat config internals
- Add `globals` package for flat config environment definitions
- Legacy `.eslintrc.*` files remain in place as the default workflow
Usage (requires ESLint v8 with flat config enabled):
ESLINT_USE_FLAT_CONFIG=true npx eslint -c eslint.config.cjs <file>
Note: files under `lib/node_modules/` are hard-ignored by ESLint v8
flat config. Full `lib/` linting via flat config requires ESLint v9,
which allows `!**/node_modules/` ignore overrides.
Ref: stdlib-js/metr-issue-tracker#54
Add a configPath option to stdlib/jsdoc-markdown-remark so the rule loads remark plugins internally while flat config receives only clonable data. Retain the existing config option and cover both forms in the rule tests. Use the complete rule catalog directly, share the restricted-syntax policy by name, avoid object spread, and keep flat config opt-in through eslint.flat.config.js.
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
54e2f61 to
3f8fbc0
Compare
eslint.flat.config.js for JavaScript targets on ESLint v8 (gh54 part V)eslint.flat.config.js for ESLint v8
Progresses stdlib-js/metr-issue-tracker#54.
Description
This pull request:
eslint.config.cjsflat config alongside the legacy.eslintrc.*configurationlib/node_modules/@stdlib/_tools/eslint/rules/scripts/plugin.js.etc/eslint/rules/.structuredClonelimitations in ESLint's flat config internals.globalspackage for flat config environment definitions..eslintrc.*files remain in place as the default workflow.Related Issues
This pull request has the following related issues:
Questions
Files under
lib/node_modules/are hard-ignored by ESLint v8 flat config (**/node_modules/**is always ignored). Fulllib/linting via flat config requires ESLint v9, which allows!**/node_modules/ignore overrides. This is expected and will be resolved in PR 11.Other
Stacked on #10966. Usage:
ESLINT_USE_FLAT_CONFIG=true npx eslint -c eslint.config.cjs <file>.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