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: replace var with const and let in rules #19389

Merged
merged 3 commits into from
Feb 1, 2025

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)

replaced var with const and let in rules examples
prefer-destructuring
radix
sort-keys
sort-vars
symbol-description

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

Refs #19240

@Tanujkanti4441 Tanujkanti4441 requested a review from a team as a code owner January 31, 2025 11:19
@eslint-github-bot eslint-github-bot bot added the documentation Relates to ESLint's documentation label Jan 31, 2025
Copy link

netlify bot commented Jan 31, 2025

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 94df6af
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/679dbace54f60f0008f2bf4e
😎 Deploy Preview https://deploy-preview-19389--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.

Comment on lines 54 to 55
const obj1 = object.foo;
const obj2 = object['foo'];
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
const obj1 = object.foo;
const obj2 = object['foo'];
const qux = object.qux;
const quux = object['quux'];

Variable and property should have the same name for this to be incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

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 8b87e00 into eslint:main Feb 1, 2025
30 checks passed
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.

2 participants