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

Add optional static enum lint #36759

Merged
merged 4 commits into from
Nov 5, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply suggestions from code review
  • Loading branch information
jridgewell authored Nov 4, 2021
commit 5356cc2e0fa48d60e394896c685c4a668b26d1ec
10 changes: 1 addition & 9 deletions build-system/eslint-rules/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,7 @@ module.exports = function (context) {
// isEnumValue(Enum, value)
if (callee.type === 'Identifier') {
const {name} = callee;
if (
name === 'isEnumValue' // ||
// name === 'enumValues' ||
// name === 'enumKeys' ||
// name === 'enumToObject'
) {
if (name === 'isEnumValue') {
return;
}
}
Expand All @@ -138,9 +133,6 @@ module.exports = function (context) {
`Improper use of enum, you may only do:`,
`- \`${node.name}.key\` get access.`,
`- \`isEnumValue(${node.name}, someValue)\` value checks.`,
// `- \`enumKeys(${node.name})\` keys gathering.`,
// `- \`enumValues(${node.name})\` values gathering.`,
// `- \`enumToObject(${node.name})\` conversion (AVOID if you can, it cannot be minified).`,
].join('\n\t'),
});
}
Expand Down