Closed NicolaeTelescu closed 3 years ago
As an user told me: It might be because it's a JSX prop value, not a JS string literal (try if it can detect className={'flex-container'}). In this way ESLint could see the problem :).
Hi @NicolaeTelescu, thanks for the issue!
The quotes
rule works as intended in this case, because it checks only string literals.
For JSX attributes you can use the jsx-quotes rule, as in this demo.
Thank you for the response!
I really didn't know that for those attributes was another rule for quotes. I will close this issue.
Tell us about your environment
What parser (default,
@babel/eslint-parser
,@typescript-eslint/parser
, etc.) are you using? I don't know. In my config file are some options about a parser, maybe that information can help you.Please show your full configuration:
Configuration
``` { "env": { "browser": true, "es2021": true, "node": true, "amd": true, "jquery": true }, "extends": [ "eslint:recommended", "plugin:react/recommended" ], "parserOptions": { "ecmaVersion": 12, "sourceType": "module" }, "rules": { "react/prop-types": "off", "react/jsx-uses-react": "warn", "react/react-in-jsx-scope": "off", "quotes": [ "error", "double", { "avoidEscape": true } ] }, "globals": { "React": true, "ReactDOM": true, "ReactRedux": true, "ReactRouterDOM": true, "Redux": true }, "settings": { "react": { "version": "detect" } } } ```What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
I use VS Code with the ESLint extension so text editor shows me the errors.
What did you expect to happen? I wanted to see the 'flex-container' and 'path' value as a problem because they have simple quotes, not double quotes, as I can see at the second and at the third line in the code, where are imports.
What actually happened? Please copy-paste the actual, raw output from ESLint.
Steps to reproduce this issue:
Are you willing to submit a pull request to fix this bug? Unfortunately no, but I wish to see where and how code will be modified to know more and be more prepared in the future to submit some pull requests, if they can help.
Images: This image can show that there are no more errors than quotes and that the errors are happening just for the imports, as I said.