Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Configurable Props and State interface names #311

Closed

Conversation

niik
Copy link
Contributor

@niik niik commented Nov 4, 2016

We currently use the tslint interface-name rule to enforce a naming convention of all interfaces beginning with the capital letter I and we would very much like to use the react-unused-props-and-state.

Unfortunately, since that only looks at interfaces named Props or State it fails to pick up on our unused fields.

This PR adds an (optional) configuration for the rule which lets consumers pass a regular expression to match the names of their Props and State interfaces. We now use this to pass the following configuration:

"react-unused-props-and-state": [ true,
  {
    "props-interface-regex": "Props$",
    "state-interface-regex": "State$"
  }
],

Which tells the rule to include all interfaces ending in Props or State.

@msftclas
Copy link

msftclas commented Nov 4, 2016

Hi @niik, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

@msftclas
Copy link

msftclas commented Nov 4, 2016

@niik, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, MSBOT;

@HamletDRC
Copy link
Member

Thanks for the PR. I will definitely merge this, but I won't have time until tomorrow.

@niik
Copy link
Contributor Author

niik commented Nov 15, 2016

@HamletDRC No sweat, please let me know if there's anything I can do to help you get this merged

@HamletDRC HamletDRC closed this in d5629c6 Nov 20, 2016
@HamletDRC HamletDRC added this to the 2.0.14 milestone Nov 20, 2016
@HamletDRC
Copy link
Member

This is available on our "releases" branch now. You can point your npm dependency there if you need the latest files.

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

Successfully merging this pull request may close these issues.

3 participants