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

Add ignoreAttribute option #6

Closed
darcros opened this issue Sep 23, 2019 · 1 comment · Fixed by #7
Closed

Add ignoreAttribute option #6

darcros opened this issue Sep 23, 2019 · 1 comment · Fixed by #7

Comments

@darcros
Copy link
Contributor

darcros commented Sep 23, 2019

I am using this plugin with React and Typescript and I have found it very useful so far.
However, I think it would be useful to add an ignoreAttribute option, similar to ignoreCallee but for JSX attributes.

The reason is:

<TextField
  variant="outlined"
  margin="normal"
  name="newEmail"
  autoComplete="email"
/>

TextField from material-ui

In the example above variant and margin are not reported as errors because their types are defined as a an union type of different strings.
But name and autocomplete are of type string so they get reported.

An ignoreAttribute option is necessary because the other solution would be spamming every file with eslint-disable-next-line comments.
And adding other attributes to the whitelist (like has been done with #4) for every framework and library that comes along would just be unfeasible.

I could work on the PR myself, just need to know if you would merge it.

@edvardchen
Copy link
Owner

It's great. I think there are some cases that UPPERCASE and union type of strings cannot handle in an instinctive way.

Expect your PR.

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

Successfully merging a pull request may close this issue.

2 participants