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

no-unused-prop-types: Crashes on indexable TypeScript prop declarations #2687

Closed
taion opened this issue Jun 30, 2020 · 3 comments
Closed

no-unused-prop-types: Crashes on indexable TypeScript prop declarations #2687

taion opened this issue Jun 30, 2020 · 3 comments

Comments

@taion
Copy link
Contributor

taion commented Jun 30, 2020

This is an issue with #2661 that makes it crash in certain cases. cc @eltonio450

Consider something like https://astexplorer.net/#/gist/dea688bfbbfb2b2a2ffc3b4e293e0a01/63d1542090fe4a6545194562b88ffa34d7b22c83.

The interface body here consists of a TSPropertySignature and a TSIndexSignature. The foundDeclaredPropertiesList is thus not actually a list of declared properties: https://github.com/yannickcr/eslint-plugin-react/pull/2661/files#diff-3ed4052fa9471077711e82f482c3f819R304

When iterating through them, attempting to access tsPropertySignature.key.name on the index signature in https://github.com/yannickcr/eslint-plugin-react/pull/2661/files#diff-3ed4052fa9471077711e82f482c3f819R317 fails, because the index signature has no key property.

@ljharb ljharb closed this as completed in 830bde7 Jun 30, 2020
@ljharb
Copy link
Member

ljharb commented Jun 30, 2020

Thanks, the repro helped a lot. Will release a patch tomorrow.

@eltonio450
Copy link
Contributor

whoah, it's been fast 😃 !

Thank you, and sorry for missing it :(

@ljharb
Copy link
Member

ljharb commented Jun 30, 2020

v7.20.3 is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants