You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
some string literals are not detected by this rule and I wonder if there is a reason for it.
Example:
importReactfrom'react';functionTestComponent(){return(<divpropError1={`test`}propError2={"test"}propError3={'test'}propNoError1="test"propNoError2='test'>{/* these are obvious errors */}
Test
{"Test"}</div>);}exportdefaultTestComponent;
as you can see, the props propNoError1 and propNoError2 slip through this rule (but are generally allowed code). I would expect 7 problems in this file, but we only get 5:
6:20 warning Strings not allowed in JSX files: “`test`” react/jsx-no-literals
7:20 warning Strings not allowed in JSX files: “"test"” react/jsx-no-literals
8:20 warning Strings not allowed in JSX files: “'test'” react/jsx-no-literals
12:39 warning Strings not allowed in JSX files: “Test” react/jsx-no-literals
14:9 warning Strings not allowed in JSX files: “"Test"” react/jsx-no-literals
✖ 5 problems (0 errors, 5 warnings)
some string literals are not detected by this rule and I wonder if there is a reason for it.
Example:
as you can see, the props
propNoError1
andpropNoError2
slip through this rule (but are generally allowed code). I would expect 7 problems in this file, but we only get 5:.eslintrc
One of the use cases when it would be preferable for this rule to warn:
Is there any way to enforce this with this rule?
The text was updated successfully, but these errors were encountered: