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

If i want use eslint-plugin-react-hooks, is it necessary to use standardx? #1276

Closed
Junting-Liu opened this issue Apr 21, 2019 · 4 comments

Comments

@Junting-Liu
Copy link

commented Apr 21, 2019

I want to config standard for eslint-plugin-react-hooks, but it doesn't work. So, i replace standard with standardx,like...

 "standardx": {
    "parser": "babel-eslint",
    "plugins": [
      "react-hooks"
    ]
  },
  "eslintConfig": {
    "rules": {
      "react-hooks/rules-of-hooks": "error",
      "react-hooks/exhaustive-deps": "warn"
    }
  },

But, is it the only way?
And, vscode-standardjs can't give the warning about react hook, what should i do ?

@Junting-Liu

This comment has been minimized.

Copy link
Author

commented Apr 21, 2019

I think i find the reason.
It' seem like StandardJS (the vscode plugin) can't read the standardx in package.json.
Will this problem be fixed?

@jousmo

This comment has been minimized.

Copy link

commented Jun 6, 2019

Hello Junting
you were able to configure it ?

@Junting-Liu

This comment has been minimized.

Copy link
Author

commented Jun 7, 2019

Hello Junting
you were able to configure it ?

maybe, you need to see this issue at first. It seems like a bug of vscode-standardjs and It seems can't be solved quickly。

There is my final config。 I have to use both vscode-standardjs and eslint extension in vscode,It means the real tips about hooks come from eslint。I think my config is not good,but i don't have any other better solutions right now.

  "standardx": {
    "parser": "babel-eslint",
    "plugins": [
      "react-hooks"
    ]
  },
  "eslintConfig": {
    "parser": "babel-eslint",
    "plugins": [
      "react-hooks"
    ],
    "rules": {
      "react-hooks/rules-of-hooks": "error",
      "react-hooks/exhaustive-deps": "warn"
    }
  },
  "standard": {
    "parser": "babel-eslint"
  },
@feross

This comment has been minimized.

Copy link
Member

commented Aug 13, 2019

@Junting-Liu This will be fixed once we release a new version of vscode-standardjs. Sorry that this hack is required in the meantime.

@feross feross closed this Aug 13, 2019

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