standard / ts-standard

Typescript style guide, linter, and formatter using StandardJS
https://www.npmjs.com/package/ts-standard
MIT License
473 stars 36 forks source link

Can't integrate eslint-plugin-react-hooks into Next app #141

Closed Powell-v2 closed 3 years ago

Powell-v2 commented 3 years ago

What version of this package are you using? "ts-standard": "^10.0.0"

What operating system, Node.js, and npm version? Ubuntu 20.04.1 LTS "Focal Fossa" (on WSL2)

What happened? eslint-plugin-react-hooks reports no errors - even though there are a couple of spots in the inspected files where rules of React hooks are broken.

Here's my config in package.json:

"ts-standard": {
    "ignore": [
      "next-env.d.ts"
    ],
    "plugins": [
      "react-hooks"
    ]
  }

eslint-plugin-react-hooks is installed as a dev dependency:

  "eslint-plugin-react-hooks": "^4.2.0",

I'm running the following command: ts-standard --fix

What did you expect to happen? Expected to see errors reported by ts-standard

Are you willing to submit a pull request to fix this bug? Depends. I suspect my setup is missing something.

theoludwig commented 3 years ago

Hey! :wave: @Powell-v2

Thanks for your report! There is an open PR to integrate eslint-plugin-react-hooks inside eslint-config-standard-react, which means that it will be there by default with ts-standard.

Powell-v2 commented 3 years ago

Hey @Divlo.

Thanks for your reply! Am I correct in my understanding that ts-standard cannot be extended at will?

theoludwig commented 3 years ago

Yes! @Powell-v2 As said in README: https://github.com/standard/ts-standard#-please-change-x-rule

If you want to add or personalize some rules, you can instead use eslint and use eslint-config-standard-with-typescript.