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 Parser should ignore className attribute on extraction #634

Closed
thmsobrmlr opened this issue Jul 28, 2021 · 2 comments
Closed

JSX Parser should ignore className attribute on extraction #634

thmsobrmlr opened this issue Jul 28, 2021 · 2 comments
Assignees

Comments

@thmsobrmlr
Copy link

Currently the JSX parser is extracting hard-coded strings from the className attribute of JSX elements. As I understand the source code, it is currently not possible to configure the JSX parser in the same way as it is possible for the HTML parser.

It would be great if the parser could ignore the className attribute or allow configuration similar to the HTML parser.

Let me know if I can help out.

@antfu
Copy link
Contributor

antfu commented Jul 29, 2021

I think we already excluded it from the extraction result, can you share code snippet that you are using with false positive? Thanks.

@antfu antfu added the detail-requested Further information is requested label Jul 29, 2021
@thmsobrmlr
Copy link
Author

I have added a minimal repro here: https://github.com/thomas88/next-i18n-ally-repro.

This is how the false positive looks for me:
Screenshot_2021-07-30_at_16_29_00

The className="h1 mt-4" is falsely found as a hardcoded string. Note how this is not true for the other className="hardcoded" however.

@terales terales removed the detail-requested Further information is requested label Aug 2, 2021
@terales terales added this to the Weekly cycle 023 milestone Aug 4, 2021
@antfu antfu closed this as completed in 6c2ea99 Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants