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

jsx-use-translation-function option to specify which prop/attribute to check #98

Closed
MastroLindus opened this issue May 31, 2017 · 3 comments

Comments

@MastroLindus
Copy link

the jsx-use-translation-function is very useful already, but it cannot identify problems when strings that need to be translated are passed in as certain props.
For example, if a component accepts a prop "label", we might want to be sure that is not a string literal.

The rule contains some hardcoded names (e.g. "title") that do get checked, but there's no way to specify extra ones in case a component uses one that is not part of that hardcoded list.

It would be very useful if the rule would accept an option to specify a list of prop/attribute names to check.

@adidahiya
Copy link
Contributor

Makes sense. There are core TSLint rules with similar configuration options. I'd accept a PR for this enhancement.

@Kolombiken
Copy link

Seems very useful!
I would very much also like to have an option of passing in empty strings as alt-attributes. If I can set a rule that says that empty string literal is totally ok for alt-attributes that would be great.

(In case someone is not sure about why I would want to do that this is why: https://www.w3.org/WAI/tutorials/images/decorative/)

@adidahiya
Copy link
Contributor

Closing due to deprecation, see #210

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

Successfully merging a pull request may close this issue.

3 participants