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.
ESLint is providing a new config format (typically called flat config). The old config format will be deprecated in ESLint 9.0 (currently in rc), and will be removed in ESLint 10. This commit migrate from the old
config format at .eslintrc.js to the new flat config one at
eslint.config.js.
In addition, 3 packages were added:
@types/eslint: A dev dependency used to provide ESLint rules code suggestion.
This dependency is used to provide linting through jsdoc for
styleRule
function. It has a very weak consumption (only 1 function relies on
it), but it is a small types package. The old config file also relies
on it (but does not install it as a npm package).
globals: A dev dependency used to configure ESLint global linting environment.
It is consumed by various other package, and already present on the path. Although, some package depend on a very old version of globals (babel), and with how terrible npm symlinking is, ESLint would import version 11.x.x, with a tragic yet funny bug that will break ESLint.
typescript-eslint: A dev dependency that provide first class Typescript integration with ESLint.
It provides a convenient config function fully typed to create ESLint flat config array. Additionally, provide the recommended Typescript/ESLint settings that can be conveniently extended.
This commit also deleted 2 other dependencies:
Both these two packages are no longer needed to be explicitly declared as typescript-eslint already import them. And it will make better decision on which version of them it should depend on.
chore: ESM support
package.json is changed to declare module (ESM), practically mark the project as an ESM first class. Additionally, using ESM module to configure Playwright and ESLint.
Note
This additionally apply more Typescript type checking linting rules, so a lot more linting errors would be apparent. This is not a problem of configuration, but a problem of code quality. I restricted some additional type linting to Typescript files (ts/tsx) only, but expect a lot more linting problems to surface.
Script
The lint script (
npm run lint
) is also modified to reflect the new change to the config file format, as the--ext
options are not used with the new config format anymore.Related Issue
Closes #233
Part of #44
Checklist