Commit 8cb669b
authored
ci: migrate e2e to eslint v9 flat config (#6699)
## What's the problem this PR addresses?
- supersedes #6690
The workflow
[.github/workflows/e2e-eslint-workflow.yml](https://github.com/yarnpkg/berry/blob/master/.github/workflows/e2e-eslint-workflow.yml)
fails with
```text
Oops! Something went wrong! :(
ESLint: 9.20.1
ESLint couldn't find an eslint.config.(js|mjs|cjs) file.
```
It was last successful 11 months ago on Apr 5, 2024 coinciding with the
release of [ESLint
9.0.0](https://eslint.org/blog/2024/04/eslint-v9.0.0-released/) which
changed the default config to flat.
The workflow installs `eslint` with no version specified, therefore
`eslint@latest` is used (currently `[email protected]`).
## How did you fix it?
In the workflow
[.github/workflows/e2e-eslint-workflow.yml](https://github.com/yarnpkg/berry/blob/master/.github/workflows/e2e-eslint-workflow.yml)
each `.estlintrc` is changed to `eslint.config.mjs`
### Validating ESLint
The ESLint rule [semi](https://eslint.org/docs/latest/rules/semi) was
[deprecated](https://eslint.org/blog/2023/10/deprecating-formatting-rules/)
in [ESLint
v8.53.0](https://eslint.org/blog/2023/11/eslint-v8.53.0-released/) and
moved instead to
[@stylistic/eslint-plugin-js](https://eslint.style/packages/js).
Following the [ESLint Stylistic Migration
Guide](https://eslint.style/guide/migration) and using the recommended
approach of one single plugin, additionally install
[@stylistic/eslint-plugin](https://www.npmjs.com/package/@stylistic/eslint-plugin).
Use the rule [@stylistic/semi](https://eslint.style/rules/default/semi).
### Running the TypeScript integration test
[typescript-eslint
v7](https://typescript-eslint.io/blog/announcing-typescript-eslint-v7/)
allows
[switching](https://typescript-eslint.io/blog/announcing-typescript-eslint-v7/#switching-to-typescript-eslint)
from
[@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser)
and
[@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
to [typescript-eslint](https://www.npmjs.com/package/typescript-eslint).
## Checklist
- [X] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).
- [X] I have set the packages that need to be released for my changes to
be effective. (none)
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.1 parent 83b7a26 commit 8cb669b
1 file changed
+28
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
32 | 45 | | |
33 | 46 | | |
34 | 47 | | |
| |||
41 | 54 | | |
42 | 55 | | |
43 | 56 | | |
44 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
45 | 61 | | |
46 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
47 | 71 | | |
48 | 72 | | |
49 | 73 | | |
| |||
0 commit comments