-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
docs: replace var with let or const in rules #19335
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
Conversation
|
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @Maryyeruva24. thanks for the PR, can you please sign the CLA as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
/*eslint no-magic-numbers: ["error", { "enforceConst": true }]*/ | ||
|
||
var TAX = 0.25; | ||
const TAX = 0.25; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const TAX = 0.25; | |
let TAX = 0.25; |
This is an incorrect
example for enforceConst: true
option of no-magic-numbers
which enforces the use of const
for storing numbers, so here we use let
to make it incorrect
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I got confused because I thought it was the correct example. Other options have both incorrect and correct eg Should we do the same for the enforceConst
options as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Maryyeruva24 pls review the comments and make the necessary revisions.
const TAX = 0.25; | ||
|
||
var dutyFreePrice = 100, | ||
const dutyFreePrice = 100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const dutyFreePrice = 100, | |
let dutyFreePrice = 100, |
Same for this one.
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
@Maryyeruva24 are you working this? |
Closing due to inactivity. |
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 let or const in the below rule examples
no-continue.md
no-magic-numbers.md
no-labels.md
no-sequences.md
unicode-bom.md
Is there anything you'd like reviewers to focus on?
ref: #19240