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

PhpStorm `no-unused-var` highlight issue in JSX #650

Closed
kinyat opened this issue Oct 6, 2016 · 2 comments

Comments

@kinyat
Copy link

commented Oct 6, 2016

My PhpStorm generates wrong highlights for no-unused-var in JSX when using the given default .eslintrc by StandardJS.

If I run eslint or standard in command line, there are no any rule conflicts.

By changing the default .eslintrc to the following, it will solve the issue in PhpStorm.

{
  "extends": ["standard"],
  "parser": "babel-eslint",
  "plugins": [
    "react"
  ],
  "rules": {
    "react/jsx-uses-vars": "error"
  }
}

@kinyat kinyat changed the title PhpStorm jsx-uses-vars highlight issue PhpStorm `no-unused-var` highlight issue Oct 6, 2016

@kinyat kinyat changed the title PhpStorm `no-unused-var` highlight issue PhpStorm `no-unused-var` highlight issue in JSX Oct 6, 2016

@feross

This comment has been minimized.

Copy link
Member

commented Oct 7, 2016

Oh, this is because the Webstorm instructions don't tell users to install eslint-config-standard-jsx. Your solution works, but you're not getting the full set of rules that standard adds for JSX.

I'll send a PR to update the instructions.

@feross

This comment has been minimized.

Copy link
Member

commented Oct 7, 2016

PR is sent: #651

@feross feross closed this in #651 Oct 7, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.