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
[member-ordering] Rule crashes on TSAbstractMethodDefinition #307
Comments
Same problem here. I threw this console log in,
|
It looks like this would at least not crash after #304. |
I'm still seeing this with 1.4.1. I added
I'm not sure what particular source file is being linted here, if you let me know how I can log that from the plugin I can share its rough shape. |
Actually looks like 1.4.1 was a bad publish: #317 |
Repro
Expected Result
No crash, maybe an error.
Actual Result
Additional Info
It seems like what's happening is that it's hitting the
Number.MAX_SAFE_INTEGER
case in member-ordering'sgetRank
(which has the comment// shouldn't happen but just in case, put it on the end
). That's becausegetNodeType
doesn't handleTSAbstractMethodDefinition
and returnsnull
(it also seems to be missing at leastTSIndexSignature
).Once the rank is set to
Number.MAX_SAFE_INTEGER
, if an error is triggered, that rank gets passed togetLowestRank
, which ends up looking atorder[Number.MAX_SAFE_INTEGER]
, which isundefined
, and then callsundefined.replace
and crashes.Versions
@typescript-eslint/eslint-plugin
1.4.0
@typescript-eslint/parser
1.4.0
TypeScript
3.3.3
ESLint
5.14.1
node
10.15.0
npm
6.7.0
The text was updated successfully, but these errors were encountered: