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 shared settings example #18251

Merged
merged 2 commits into from Apr 1, 2024

Conversation

Tanujkanti4441
Copy link
Contributor

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)

Added custom plugin example to show how shared data can be used in custom plugin.

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

Fixes: #16507

@Tanujkanti4441 Tanujkanti4441 requested a review from a team as a code owner March 31, 2024 15:31
@eslint-github-bot eslint-github-bot bot added the documentation Relates to ESLint's documentation label Mar 31, 2024
Copy link

netlify bot commented Mar 31, 2024

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 4beafb3
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/660ab11819ced4000820ab03
😎 Deploy Preview https://deploy-preview-18251--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.

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.

For consistent indentation.

Comment on lines 290 to 310
plugins: {
customPlugin: {
rules: {
"my-rule": {
meta: {
// custom rule's meta information
},

create(context) {
const sharedData = context.settings.sharedData;

return {
// code
}
}
}
}
}
},
rules: {
"customPlugin/my-rule": "error"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
plugins: {
customPlugin: {
rules: {
"my-rule": {
meta: {
// custom rule's meta information
},
create(context) {
const sharedData = context.settings.sharedData;
return {
// code
}
}
}
}
}
},
rules: {
"customPlugin/my-rule": "error"
plugins: {
customPlugin: {
rules: {
"my-rule": {
meta: {
// custom rule's meta information
},
create(context) {
const sharedData = context.settings.sharedData;
return {
// code
};
}
}
}
}
},
rules: {
"customPlugin/my-rule": "error"

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 b93f408 into eslint:main Apr 1, 2024
19 checks passed
@Tanujkanti4441 Tanujkanti4441 deleted the shared-example branch April 2, 2024 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Relates to ESLint's documentation
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Docs: Better example for shared setting
2 participants