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-curly-brace-presence and jsx-no-comment-textnodes conflict with each other #2716
Comments
Thanks for the repro! I'm having trouble reproducing this - the test cases pass (the curly-brace-presence warning doesn't appear), both in my local tests and in your codesandbox. Are you sure you're using the latest version of eslint-plugin-react locally? |
This is what I see when I run
Can you show me what output you get for {
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parserOptions": { "ecmaVersion": 6, "sourceType": "module" },
"rules": {
"react/jsx-curly-brace-presence": [
"error",
{ "props": "never", "children": "never" }
],
"react/jsx-no-comment-textnodes": "error"
}
} |
Is there a way I can just clone the sandbox directly? The passing tests I landed in bb2b8db use the same eslint config as in the sandbox. |
There doesn't seem to be a way to clone a sandbox directly. Here's a new repo that contains the same test case, along with instructions on how to reproduce: https://github.com/nwalters512/eslint-plugin-react-conflicting-rules-repro Following my own instructions, I see the following output for
|
Thanks, I was able to reproduce and make a fix/test. |
Thanks much! |
I have both
react/jsx-curly-brace-presence
andreact/jsx-no-comment-textnodes
enabled. I want to render the string/*
as the child of a component:This errors for
react/jsx-no-comment-textnodes
as expected:Per the docs for
react/jsx-no-comment-textnodes
, I should be able to use curly braces to fix this:However, this now errors for
react/jsx-curly-brace-presence
:Playing whack-a-mole with linter errors won't get me anywhere here. I could always disable one of the rules for this file, but ideally
react/jsx-curly-brace-presence
could be smart enough to know that this is something that needs to be in curly braces because of other rules in play and not report this particular code as an error.Codesandbox (fork and run
yarn lint
from the terminal): https://codesandbox.io/s/cocky-darwin-1zfs5?file=/src/Component.jsxThe text was updated successfully, but these errors were encountered: