-
Notifications
You must be signed in to change notification settings - Fork 65
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
lint against non-kebab-cased enum values #548
Conversation
ae0445d
to
e69e569
Compare
src/lint/rules/enum-casing.ts
Outdated
continue; | ||
} | ||
const text = item.contents[0]; | ||
if (/[A-Z ]/.test(text.contents)) { |
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.
if (/[A-Z ]/.test(text.contents)) { | |
if (!/^[\p{Ll}\d]+(?:-[\p{Ll}\d]+)*$/v.test(text.contents)) { |
src/lint/rules/enum-casing.ts
Outdated
const location = offsetToLineAndColumn(algorithmSource, text.location.start.offset); | ||
report({ | ||
ruleId, | ||
message: 'enum values should be kebab-cased', |
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.
message: 'enum values should be kebab-cased', | |
message: 'enum values should be lowercase and kebab-cased', |
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.
Wait what? Doesn't kebab-case imply lowercase?
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.
THIS-IS-STILL-KEBAB
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 otherwise
ea96684
to
0101fc4
Compare
Fixes #544.