Skip to content

Conversation

Maryyeruva24
Copy link

@Maryyeruva24 Maryyeruva24 commented Jan 10, 2025

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

@Maryyeruva24 Maryyeruva24 requested a review from a team as a code owner January 10, 2025 23:12
Copy link

CLA Missing ID CLA Not Signed

Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit fd296a1
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/6781a96053ac660008270d2e
😎 Deploy Preview https://deploy-preview-19335--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.

@Tanujkanti4441
Copy link
Contributor

Hi @Maryyeruva24. thanks for the PR, can you please sign the CLA as well?

@Tanujkanti4441 Tanujkanti4441 changed the title fix(docs): replace var with let or const in rules docs: replace var with let or const in rules Jan 11, 2025
@Tanujkanti4441 Tanujkanti4441 added the documentation Relates to ESLint's documentation label Jan 11, 2025
@amareshsm amareshsm added the accepted There is consensus among the team that this change meets the criteria for inclusion label Jan 12, 2025
Copy link
Member

@amareshsm amareshsm 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!

/*eslint no-magic-numbers: ["error", { "enforceConst": true }]*/

var TAX = 0.25;
const TAX = 0.25;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Member

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me.

Copy link
Member

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const dutyFreePrice = 100,
let dutyFreePrice = 100,

Same for this one.

@amareshsm amareshsm self-requested a review January 22, 2025 20:18
Copy link

github-actions bot commented Feb 1, 2025

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.

@github-actions github-actions bot added the Stale label Feb 1, 2025
@Tanujkanti4441
Copy link
Contributor

@Maryyeruva24 are you working this?

@github-actions github-actions bot removed the Stale label Feb 2, 2025
@mdjermanovic
Copy link
Member

Closing due to inactivity.

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.

4 participants