Follow-up from the review of #240 (merged), which migrated eslint 8 -> 9 and added a flat config. Two items in eslint.config.mjs, neither affecting current behaviour.
1. The comment inverts the rule it states
eslint.config.mjs currently opens with:
// Flat-config port of the previous .eslintrc. The .mjs extension is required:
// this package is "type": "module".
That is backwards. package.json does declare "type": "module", and that is precisely the case where the .mjs rename is not required — a plain eslint.config.js is already parsed as ESM, so eslint loads it as-is. .mjs is what a CommonJS package needs, in order to write an ESM config in a package whose .js files are CJS.
The reviewer verified this empirically: renaming the file to eslint.config.js and running eslint loaded it fine.
Fix: either rename to eslint.config.js and delete the comment, or keep .mjs (harmless, and eslint resolves it) and correct the comment to say it is a stylistic choice rather than a requirement. Leaving the inverted claim in place will mislead whoever ports the next repo by copying this file.
2. ecmaVersion: 2021 is now the only thing capping the parser
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
...
}
2021 was carried over faithfully from the old .eslintrc, which is the right default for a migration PR — it preserves behaviour. But flat config defaults ecmaVersion to latest, so under .eslintrc the cap was one setting among the file's inherited defaults, and now it is an explicit and deliberate-looking restriction. Nothing in the repo needs post-2021 syntax today, so this is not breaking anything; it just means the next person to use, say, Array.prototype.at chaining or newer syntax hits a parse error for no reason.
Fix: drop the ecmaVersion line and let it default to latest. globals.es2021 in the same block can stay or move to globals.es2025 independently — it controls globals, not syntax.
References
Follow-up from the review of #240 (merged), which migrated eslint 8 -> 9 and added a flat config. Two items in
eslint.config.mjs, neither affecting current behaviour.1. The comment inverts the rule it states
eslint.config.mjscurrently opens with:That is backwards.
package.jsondoes declare"type": "module", and that is precisely the case where the.mjsrename is not required — a plaineslint.config.jsis already parsed as ESM, so eslint loads it as-is..mjsis what a CommonJS package needs, in order to write an ESM config in a package whose.jsfiles are CJS.The reviewer verified this empirically: renaming the file to
eslint.config.jsand running eslint loaded it fine.Fix: either rename to
eslint.config.jsand delete the comment, or keep.mjs(harmless, and eslint resolves it) and correct the comment to say it is a stylistic choice rather than a requirement. Leaving the inverted claim in place will mislead whoever ports the next repo by copying this file.2.
ecmaVersion: 2021is now the only thing capping the parser2021was carried over faithfully from the old.eslintrc, which is the right default for a migration PR — it preserves behaviour. But flat config defaultsecmaVersiontolatest, so under.eslintrcthe cap was one setting among the file's inherited defaults, and now it is an explicit and deliberate-looking restriction. Nothing in the repo needs post-2021 syntax today, so this is not breaking anything; it just means the next person to use, say,Array.prototype.atchaining or newer syntax hits a parse error for no reason.Fix: drop the
ecmaVersionline and let it default tolatest.globals.es2021in the same block can stay or move toglobals.es2025independently — it controls globals, not syntax.References