Skip to content

[New] version: detect-no-warn #2718

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

Closed
wants to merge 2 commits into from
Closed

Conversation

aminya
Copy link

@aminya aminya commented Jul 19, 2020

Fixes #2717

This adds an option to set the version to "version": "detect-no-warn", which is the same as "detect", but does not give a warning.

This is useful if someone wants to use a single Eslint preset for multiple projects no matter if they are using react or not (common in organizations).

  "settings": {
    "react": {
      "version": "detect-no-warn"
    }
  }

@aminya aminya changed the title Detect no warn [New] version: detect-no-warn Jul 19, 2020
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentionally not desired; please see #2717 (comment) and #2276.

It's not possible (or imo sensible) to have a single eslint config that works for both react and non-react projects.

@ljharb ljharb closed this Jul 19, 2020
@aminya
Copy link
Author

aminya commented Jul 19, 2020

It's not possible (or imo sensible) to have a single eslint config that works for both react and non-react projects.

Why is it not possible to do so?

@ljharb
Copy link
Member

ljharb commented Jul 19, 2020

For one, because if it's a non-react project, it's likely to be using a different component framework, many of which use jsx - so this plugin's linting rules will give you lots of false positives.

See https://npmjs.com/eslint-config-airbnb and https://npmjs.com/eslint-config-airbnb-base; that's the approach I'd suggest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

react version "detect-no-warn"
2 participants