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/jsx-quotes is deprecated. Use jsx-quotes instead #513

Closed
brad-decker opened this issue Sep 16, 2015 · 12 comments
Closed

react/jsx-quotes is deprecated. Use jsx-quotes instead #513

brad-decker opened this issue Sep 16, 2015 · 12 comments

Comments

@brad-decker
Copy link

React/jsx-quotes has been deprecated in latest version of eslint.

@notxt
Copy link

notxt commented Sep 16, 2015

👍

@nackjicholson
Copy link

👍 We're getting these errors when linting as well.

@brad-decker
Copy link
Author

Just a heads up, to get rid of these errors override the react/jsx-quotes rule in your eslintrc file with 0. Then you can specify jsx-quotes rule. You can also just not specify the extra rule to avoid causing issues in 3P packages that may have not updated eslint (gulp-eslint seems to fail)

// Use this file as a starting point for your project's .eslintrc.
// Copy this file, and add rule overrides as needed.
{
  "extends": "airbnb",
  "rules": {
    "react/jsx-quotes": 0,
    "jsx-quotes": [2, "prefer-double"]
  }
}

@nackjicholson
Copy link

We were actually running into it on a code base that doesn't use react at all, so we just did:

{
  "extends": "airbnb/base"
}

which doesn't load the react linting modules.

@brad-decker
Copy link
Author

👍 @nackjicholson

@tarun
Copy link

tarun commented Sep 18, 2015

👍 @brad-decker

And there already are PRs for upgrading eslint and the config in eslint-config-airbnb/react.js

#518
#514

@ljharb ljharb changed the title react/jsx-quotes is depreceted. Use jsx-quotes instead react/jsx-quotes is deprecated. Use jsx-quotes instead Sep 18, 2015
@olalonde
Copy link

@nackjicholson thanks for the tip, I'm not using react either but my lint tests started failing because of that deprecation error.

mute added a commit to mute/boilerplate-koa-redux-react that referenced this issue Nov 5, 2015
@nackjicholson
Copy link

Just a ping. What's going on with these issues #513 #514 #518

These are all aimed at fixing this issue with jsx-quotes deprecation.

But I've noticed another issue. I'm using both the airbnb presets for JSCS and ESLint, and they disagree on this point about whether to use a single quote or double quote in jsx.

airbnb JSCS says it wants singles: <Hello text='world'/>
airbnb ESLint says it wants doubles: <Hello text="world"/>

@nackjicholson
Copy link

I can fix it by doing this in my jscsConfig:

{
  "validateQuoteMarks": { "mark": "'", "escape": true, "ignoreJSX": true }
}

Maybe that should just be turned on by default in the airbnb preset for JSCS.

@ljharb
Copy link
Collaborator

ljharb commented Dec 7, 2015

@nackjicholson JSX should be using double quotes, everything else, single quotes - a PR is very welcome to fix that.

Similarly, a separate PR to use jsx-quotes instead of react/jsx-quotes is welcome!

@nackjicholson
Copy link

Airbnb JSCS preset updated here: jscs-dev/node-jscs#2007 (comment)

@ljharb
Copy link
Collaborator

ljharb commented Dec 23, 2015

This is fixed in #521.

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

No branches or pull requests

6 participants