-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Support createClass in no-typos #1828
Support createClass in no-typos #1828
Conversation
if (propertyName === 'propTypes' || propertyName === 'contextTypes' || propertyName === 'childContextTypes') { | ||
checkValidPropObject(node); | ||
} | ||
STATIC_CLASS_PROPERTIES.forEach(CLASS_PROP => { | ||
if (propertyName && CLASS_PROP.toLowerCase() === propertyName.toLowerCase() && CLASS_PROP !== propertyName) { | ||
const message = isClassProperty | ||
? 'Typo in static class property declaration' |
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.
i think it's fine to have different messages, but "static class property" is a conceptual term prior to the feature landing in the language, so i think that'd be reasonable.
07232ad
to
d641900
Compare
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.
d641900
to
7b70462
Compare
Resolves #1721
Also added some more tests for good measure.
Not sure about the exact message for an ES5 component, but mentioning
static class property
didn't make sense.