-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: update eslint-all.js to use Object.freeze for rules object
#20116
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
fix: update eslint-all.js to use Object.freeze for rules object
#20116
Conversation
✅ Deploy Preview for docs-eslint canceled.
|
eslint-all.js to use Object.freeze for rules objecteslint-all.js to use Object.freeze for rules object
I think we can treat this as a non-breaking change. @eslint/eslint-tsc thoughts? |
mdjermanovic
left a comment
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.
Changes LGTM. Pending opinions on whether this is a breaking change.
I agree this isn't a breaking change. |
|
Agreed. |
…#20116) fix: update `eslint-all.js` to use `Object.freeze` for rules object
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[x] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
In this PR, I've updated
eslint-all.jsto useObject.freezefor therulesobject.I noticed it was odd that the
allconfiguration didn't useObject.freeze, especially since therecommendedconfiguration does, and the TypeScript type signature indicates that the rules object isreadonly.eslint/packages/js/src/configs/eslint-recommended.js
Lines 19 to 22 in 1ace67d
eslint/packages/js/types/index.d.ts
Line 10 in 1ace67d
So, to keep things consistent across the rule configurations and with the type signature, I've updated
eslint-all.jsto useObject.freezefor therulesobject.Is there anything you'd like reviewers to focus on?
I'm not sure if this should be considered a breaking change. If anyone has another opinion, I'm happy to follow that suggestion.