Warning: React version not specified in eslint-plugin-react settings, though it is specified
See original GitHub issueVersions:
prettier-eslint
version: 4.7.1node
version: v10.5.0npm
(oryarn
) version: 6.4.1
Have you followed the debugging tips?
Yes
Relevant code or config
{
"extends": ["prettier"],
"settings": {
"react": {
"pragma": "React",
"version": "16.5.2"
}
},
"rules": {
"multiline-comment-style": ["off"],
"no-warning-comments": ["off"],
"react/jsx-filename-extension": ["off"],
"react/jsx-first-prop-new-line": ["off"],
"react/jsx-max-props-per-line": ["off"],
"quotes": ["error", "single", { "avoidEscape": true }]
}
}
What I did: I have configured my package.json scripts with a formatting script as shown below:
"format": "prettier-eslint.cmd --write \"src/**/*.js\" --log-level trace",
What happened:
When attempting to run the formatting script, I receive the following warning:
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration.
Reproduction repository:
Unfortunately I cannot create this repository as my proxy disallows the ability to create public Git repositories, though I may be able to provide this later on.
Problem description:
After following the instructions provided in the warning (as shown in my .eslintrc.json above) and including the version of React which I am currently utilizing the warning still pops up. I have confirmed that this shoudl work by performing a trace which displays that the version is being appropriately picked up by prettier-eslint:
Suggested solution:
Not sure, as I do not receive this error when simply performing an eslint on the files directly.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:5 (2 by maintainers)
Top GitHub Comments
Same issues here. I have set react version but prettier keep saying that it’s not “Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration.”
I’m using latest version of “prettier-eslint-cli”: “^4.7.1” and with that “prettier-eslint”: “8.8.2"”
@thetoine – I have not yet been able to fix the problem, unfortunately.