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

[Fix] jsx-no-literals with allowStrings doesn't work in props #2736

Merged
merged 1 commit into from Aug 9, 2020

Conversation

karolina-benitez
Copy link
Contributor

@karolina-benitez karolina-benitez commented Jul 31, 2020

Checks if props string is included in allowedStrings option

Fixes #2720.

@karolina-benitez karolina-benitez changed the title Fixes issue # 2720 [Fix] jsx-no-literals with allowStrings doesn't work in props Jul 31, 2020
tests/lib/rules/jsx-no-literals.js Outdated Show resolved Hide resolved
lib/rules/jsx-no-literals.js Outdated Show resolved Hide resolved
lib/rules/jsx-no-literals.js Outdated Show resolved Hide resolved
}
`,
options: [{noStrings: true, allowedStrings: ['button', 'submit']}],
parser: parsers.BABEL_ESLINT
Copy link
Member

Choose a reason for hiding this comment

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

let's also add the same test case for each of the other parsers (default, and both typescript-eslints)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you please clarify?

Copy link
Member

Choose a reason for hiding this comment

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

This test case works for babel-eslint; but the same test case should pass on the default parser, and on the old typescript-eslint, and on the new typescript eslint parser.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, added!

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

Successfully merging this pull request may close these issues.

jsx-no-literals with allowStrings doesn't work in props
2 participants