Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Failed to load config "plugin:react-hooks/recommended" to extend from. #18520

Closed
WillSquire opened this issue Apr 7, 2020 · 2 comments
Closed
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@WillSquire
Copy link

react-scripts version: 3.4.1

Steps To Reproduce

  1. Created project with CRA typescript
  2. Added .eslintrc.js:
module.exports = {
  root: true,
  parser: '@typescript-eslint/parser',
  parserOptions: {
    tsconfigRootDir: __dirname,
    project: ['./tsconfig.json'],
    ecmaFeatures: {
      jsx: true,
    },
  },
  plugins: ['@typescript-eslint', 'jest', 'react', 'react-hooks', 'sonarjs'],
  extends: [
    'standard-with-typescript',
    'plugin:jest/recommended',
    'plugin:react/recommended',
    'plugin:react-hooks/recommended',
    'plugin:@typescript-eslint/recommended-requiring-type-checking',
    'plugin:sonarjs/recommended',
  ],
  settings: {
    react: {
      version: 'detect',
    },
  },
}
  1. Added lints not included with react-scripts to devDependencies:
    "eslint-config-standard-with-typescript": "^15.0.1",
    "eslint-plugin-jest": "^23.8.2",
    "eslint-plugin-node": "11",
    "eslint-plugin-promise": "4",
    "eslint-plugin-sonarjs": "^0.5.0",
    "eslint-plugin-standard": "4"
  1. Run with npx eslint --fix --ext .js,.jsx,.ts,.tsx .

Worked around adding rules individually:

rules: {
    'react-hooks/rules-of-hooks': 'error',
    'react-hooks/exhaustive-deps': 'warn',
},
@WillSquire WillSquire added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Apr 7, 2020
@dougbacelar
Copy link

Perhaps a duplicate of: #18208

Check out the first comment from @threepointone

The commit that landed that behaviour (#14762) hasn't been released yet. We could probably do a release sometime, but the workaround right now is to copy paste the recommended config. I'll leave this open till we do.

@WillSquire
Copy link
Author

Yep, sounds the same to me! Thanks @dougbacelar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

2 participants