question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: React version not specified in eslint-plugin-react settings, though it is specified

See original GitHub issue

Versions:

  • prettier-eslint version: 4.7.1
  • node version: v10.5.0
  • npm (or yarn) 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:

React in .eslint config

Suggested solution:

Not sure, as I do not receive this error when simply performing an eslint on the files directly.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
timrccommented, Oct 4, 2018

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"”

2reactions
cjones26commented, Oct 2, 2018

@thetoine – I have not yet been able to fix the problem, unfortunately.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Warning: React version not specified in 'eslint-plugin ...
The problem is in the eslint-plugin-react v.7.30.1. Downgrade it to v.7.30.0 and it will work "eslint-plugin-react": "^7.30.0".
Read more >
Warning: React version not specified in eslint-plugin ... - GitHub
Hello,. Since I've updated this plugin, i've got a message like Warning: React version not specified in eslint-plugin-react settings.
Read more >
ESLint:Warning: React version not specified in ... - もためも
Warning : React version not specified in eslint-plugin-react settings ... It will default to "latest" and warn if missing, and to "detect" in ......
Read more >
eslint error - React version not specified in eslint-plugin-react
Warning : React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration .
Read more >
eslint-plugin-react - npm
Start using eslint-plugin-react in your project by running `npm i ... If you do not use a preset you will need to specify...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found