Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update templates for eslint v9 #179

Merged
merged 8 commits into from
May 22, 2024
Merged

feat: update templates for eslint v9 #179

merged 8 commits into from
May 22, 2024

Conversation

aladdin-add
Copy link
Member

@aladdin-add aladdin-add commented Apr 18, 2024

  1. use flat config
  2. add .npmrc (package-lock=false), just same as eslint repo
  3. update required node.js & eslint

fixes #172

@aladdin-add aladdin-add marked this pull request as draft April 18, 2024 09:31
@aladdin-add
Copy link
Member Author

@mdjermanovic can you push a new release of eslint-config-eslint, to update eslint-plugin-unicorn for eslint v9 support?

.github/workflows/ci.yml Show resolved Hide resolved
package.json Show resolved Hide resolved
@aladdin-add
Copy link
Member Author

friendly ping @mdjermanovic

@mdjermanovic
Copy link
Member

@mdjermanovic can you push a new release of eslint-config-eslint, to update eslint-plugin-unicorn for eslint v9 support?

Sorry, I missed this.

I believe eslint-config-eslint is fully ready for a new release in terms of its flat config part. But it still exports an eslintrc config, which we haven't been updating for a while and is probably out-of-sync with the flat config. Since it's a public package, my thinking was to wait for eslint/eslint#18011 (which drops the eslintrc export) before releasing new eslint-config-eslint, but I'm open to other ideas.

@aladdin-add
Copy link
Member Author

The exported eslinrc was exclusively utilized within the eslint repo. Additionally, the progress of eslint/eslint#18011 was blocked by vscode-eslint😅. I am in favor of pushing a release to unblock eslint repos upgrading to eslint v9.

@mdjermanovic
Copy link
Member

The exported eslinrc was exclusively utilized within the eslint repo

That's true for our repos, but it's still a public package used by others as well, so the expectation would be that the flat config and eslintrc exports are equivalent, which most likely isn't the case anymore. I left an idea in eslint/eslint#18011 (comment).

@aladdin-add
Copy link
Member Author

Actually eslintrc was not published to npm, so there should be no external users.

image

@mdjermanovic
Copy link
Member

Actually eslintrc was not published to npm, so there should be no external users.

Yes, but there might be when we release it. And I think it's anyway best to release eslint-config-eslint v10 without eslintrc.

@aladdin-add aladdin-add marked this pull request as ready for review April 30, 2024 02:20
Copy link
Contributor

@MikeMcC399 MikeMcC399 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are a couple of suggestions:

  • Since Node.js 21 reaches end-of-life on June 1, 2024 I suggest to replace it with Node.js 22, which was released already on April 24, 2024. (Also in .github/workflows/ci.yml)
  • Replace the unmaintained npm-run-all (last released 5 years ago) with the compatible, maintained fork npm-run-all2

@aladdin-add
Copy link
Member Author

Since Node.js 21 reaches end-of-life on June 1, 2024 I suggest to replace it with Node.js 22, which was released already on April 24, 2024. (Also in .github/workflows/ci.yml)

yes, but node v21 is still supported - dropping it is a breaking change. I just added v22.

@MikeMcC399
Copy link
Contributor

@aladdin-add

You are right about the breaking change. Sorry I didn't notice that!

@MikeMcC399
Copy link
Contributor

npm reports peer dependency issues due to eslint-doc-generator after using yo eslint:plugin.

"eslint-doc-generator": "^1.0.0",


export default [
pluginJs.configs.recommended,
pluginNode.configs["flat/recommended"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran yo eslint:plugin to create a plugin and it was successful.

But, running npm run lint:js in the plugin reports:

C:\projects\tmp\tmp\eslint.config.mjs
  1:1  error  Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

✖ 1 problem (1 error, 0 warnings)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in ed00e49

1. use flat config
2. add .npmrc (package-lock=false), just same as eslint repo
3. update required node.js & eslint
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit c383e9c into main May 22, 2024
10 checks passed
@mdjermanovic mdjermanovic deleted the feat/eslint-v9 branch May 22, 2024 08:41
@github-actions github-actions bot mentioned this pull request May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Update to generate eslint 9.0 plugins
4 participants