Skip to content

Conversation

@jackyho112
Copy link
Contributor

@jackyho112 jackyho112 commented Aug 23, 2017

For #1361.

This sets the no-unused-state rule to ignore computed property keys when the contents aren't literal.

I think it should cover all kinds of literals for checking unused state properties because it could happen in types other than string and could be checked. If that is undesirable, I could change it to only checking string literals.

Other than that, let me know what other improvements you have in mind.

@jackyho112 jackyho112 changed the title Ignore computed property keys for no unused state rule [no-unused-state]Ignore computed property keys for no unused state rule Aug 23, 2017
@jackyho112 jackyho112 changed the title [no-unused-state]Ignore computed property keys for no unused state rule [no-unused-state] Ignore computed property keys for no unused state rule Aug 23, 2017
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome, thanks!

Cold you also add a template literal with no substitutions? That should work just like a string literal.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@EvHaus EvHaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the contribution!

@jackyho112
Copy link
Contributor Author

@EvHaus

You are welcome! Look forward to doing more.

@ljharb ljharb merged commit 096ce98 into jsx-eslint:master Aug 23, 2017
@jackyho112 jackyho112 deleted the ignore-computed-property-keys-for-no-unused-state-rule branch August 23, 2017 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants