-
-
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
Update no-typos rule to check static lifecycle methods #2006
Update no-typos rule to check static lifecycle methods #2006
Conversation
}, { | ||
code: ` | ||
class Hello extends React.Component { | ||
getDerivedStateFromProps() { } |
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.
let's please add a "valid" rule for static getDerivedStateFromProps
, and also an invalid one for static getDERIVEDStateFromProps
:-)
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 added a test to check that static getDerivedStateFromProps
is valid.
Regarding the second, there is already a test that checks static GetDerivedStateFromProps
is invalid. Is it necessary to check static getDERIVEDStateFromProps
too?
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.
as long as the checks cover a) the proper spelling and capitalization, b) any miscapitalization, c) any misspelling, and then those three with 1) static and 2) instance, then we should be good.
@bsonntag i've rebased this; the tests are still failing. are you still interested in completing this PR? |
@ljharb not really, sorry. |
This updates the `no-typos` rule so that it checks for lifecycle methods that should be static, like `getDerivedStateFromProps`.
This updates the
"no-typos"
rule so that it checks for lifecycle methods that should be static, likegetDerivedStateFromProps
.Closes #1999