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

React version set to 'detect' but react not used #91

Closed
1 task
solotoo opened this issue Apr 10, 2024 · 1 comment
Closed
1 task

React version set to 'detect' but react not used #91

solotoo opened this issue Apr 10, 2024 · 1 comment
Labels
bug Something isn't working repro:needed

Comments

@solotoo
Copy link

solotoo commented Apr 10, 2024

Environment

Node version: 20.12.0
npm version: 10.5.0
Local ESLint version: 9.0.0
Global ESLint version: 9.0.0
Operating System: MACOS Sonoma 14.4

What parser are you using?

Default (Espree)

What did you do?

Configuration Following guidance on 'Getting Started with ESLINT' I STARTED BY `npm init @eslint/config`

Giving the following answers:
✔ How would you like to use ESLint? · style
✔ What type of modules does your project use? · commonjs
✔ Which framework does your project use? · none
✔ Does your project use TypeScript? · javascript
✔ Where does your code run? · node
✔ Which style guide do you want to follow? · airbnb

which generated this config

import globals from "globals";

import path from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
import pluginJs from "@eslint/js";

// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({baseDirectory: __dirname, recommendedConfig: pluginJs.configs.recommended});

export default [
  {files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}},
  {languageOptions: { globals: globals.node }},
  ...compat.extends("airbnb"),
];

I then ran npx eslint src/myfile.js

What did you expect to happen?

I didnt expect any warning about react to be given as i chose 'no framework'

What actually happened?

the following warning was generated

Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.

Link to Minimal Reproducible Example

none

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@solotoo solotoo added bug Something isn't working repro:needed labels Apr 10, 2024
@aladdin-add aladdin-add transferred this issue from eslint/eslint Apr 10, 2024
@aladdin-add
Copy link
Member

Duplicate of #87

it was enabled in eslint-config-airbnb. you may need to use eslint-config-airbnb-base in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working repro:needed
Projects
Archived in project
Development

No branches or pull requests

2 participants