Warning: React version not specified in eslint-plugin-react settings (Part 2)

See original GitHub issue

Related to #1955

I seem to still be having this issue on v7.31.8, discussed in the above issue, and would love some insight if I’m just setting things up incorrectly. This is a brand new React/TS project being set up using VS Code and Vite, so what you see is all I have currently. The eslint library is being loaded in successfully, and I don’t have any errors, but I am still getting this warning: Screen Shot 2022-09-22 at 1 26 35 PM

  • I have tried running eslint via the command line, and am still getting the same warning.

The contents of my .eslintrc.js:

module.exports = {
  root: true,
  env: {
    node: true,
    browser: true
  },
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 2022,
    sourceType: 'module',
    ecmaFeatures: {
      jsx: true
    },
    settings: {
      react: {
        version: 'detect'
      },
      'import/resolver': {
        node: {
          paths: ['src'],
          extensions: ['.js', '.jsx', '.ts', '.tsx']
        }
      }
    }
  },
  extends: [
    'eslint:recommended',
    'plugin:react/recommended',
    'plugin:import/recommended',
    'plugin:import/typescript',
    'plugin:@typescript-eslint/recommended',
    'eslint-config-prettier'
  ],
  rules: {
    'react/react-in-jsx-scope': 'off',
    semi: [2, 'always']
  }
};

Here is a repro repo where I’m currently having the issue: https://github.com/juliehchung/test-dash

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
MidKnightXIcommented, Dec 8, 2022

Can you put

settings: {
  react: {
    version: "detect"
  },
}

Outside of parserOptions ?

1reaction
javiercastaneda303commented, Dec 7, 2022

insert this code at at .eslintrc.json { … settings: { react: { version: ‘detect’ }, } … }

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Warning: React version not specified in 'eslint-plugin ...
Issue. Git bash shows Warning: React version not specified in eslint-plugin-react settings. · How to produce. create-react-app my-app cd app npm ...
Read more >
eslint-plugin-react - npm
Start using eslint-plugin-react in your project by running `npm i ... You should also specify settings that will be shared across all the ......
Read more >
eslint/eslint - Gitter
I have configured eslint in my application with eslint-config-react-app . ... true Warning: React version not specified in eslint-plugin-react settings.
Read more >
eslint-plugin-react | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >
12 essential ESLint rules for React - LogRocket Blog
ESLint has a comprehensive set of rules for JavaScript code that ... { ...other ESLint config settings: { react: { version: 'detect' }...
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