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

docs: update to eslint v9 in custom-rule-tutorial #18383

Merged
merged 3 commits into from
Apr 23, 2024

Conversation

aladdin-add
Copy link
Member

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

fixes #18382

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Is there anything you'd like reviewers to focus on?

@aladdin-add aladdin-add requested a review from a team as a code owner April 23, 2024 02:08
@eslint-github-bot eslint-github-bot bot added the documentation Relates to ESLint's documentation label Apr 23, 2024
Copy link

netlify bot commented Apr 23, 2024

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 31a4e1e
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/662787b13884870008b947cd
😎 Deploy Preview https://deploy-preview-18383--docs-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@aladdin-add aladdin-add added the accepted There is consensus among the team that this change meets the criteria for inclusion label Apr 23, 2024
parserOptions: { ecmaVersion: 2015 }
languageOptions: { ecmaVersion: 2015 }
Copy link
Member

Choose a reason for hiding this comment

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

We should update the same in the example project that is linked from the tutorial:

const ruleTester = new RuleTester({
// Must use at least ecmaVersion 2015 because
// that's when `const` variable were introduced.
parserOptions: { ecmaVersion: 2015 }
});

Copy link
Member

Choose a reason for hiding this comment

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

We should probably also update all references to ESLint v8 (e.g, devDependencies, peerDependencies) to ESLint v9.

Copy link
Member Author

Choose a reason for hiding this comment

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

@aladdin-add aladdin-add marked this pull request as draft April 23, 2024 07:32
@aladdin-add aladdin-add marked this pull request as ready for review April 23, 2024 08:49
@@ -1,5 +1,6 @@
{
"name": "eslint-plugin-example",
"private": true,
Copy link
Member Author

Choose a reason for hiding this comment

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

I also added this property - to avoid it being published unexpectedly.

@mdjermanovic
Copy link
Member

Few more places to update to v9:

1. `"peerDependencies"`: Add `"eslint": ">=8.0.0"` as a peer dependency. Any version greater than or equal to that is necessary to use the plugin. Declaring `eslint` as a peer dependency requires that users add the package to the project separately from the plugin.

// Add eslint>=8.0.0 as a peer dependency.
"peerDependencies": {
"eslint": ">=8.0.0"
},

"devDependencies": {
"eslint": "^8.36.0"
}

@aladdin-add aladdin-add changed the title docs: update rule tester options in custom-rule-tutorial docs: update to eslint v9 in custom-rule-tutorial Apr 23, 2024
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion documentation Relates to ESLint's documentation
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Docs: custom rule tutorial doesn't work with v9
2 participants