aladdin-add / eslint-plugin

autofix some errors reported by eslint rules.
107 stars 10 forks source link

feat: eslint-plugin-no-autofix support 3rd party plugin #61

Closed barroudjo closed 3 years ago

barroudjo commented 4 years ago

Would it be possible to use your plugin with non core rules (for instance, a react specific rule: react-hooks/exhaustive-deps) ?

Thanks for your work !

aladdin-add commented 4 years ago

atm it does not, I was thinking of some hack ways to support it. :)

aladdin-add commented 4 years ago

I use a proxy to support it. please try v1.0.0 ❤️

barroudjo commented 4 years ago

Wow that was fast ! I'll try it tomorrow.

Le jeu. 13 févr. 2020 à 21:29, 薛定谔的猫 notifications@github.com a écrit :

I use a proxy to support it. please try v1.0.0 ❤️

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aladdin-add/eslint-plugin/issues/61?email_source=notifications&email_token=ABY45AX57NYGHXVQOE3UFBDRCWUT5A5CNFSM4KUXIHI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELWP45A#issuecomment-585956980, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABY45AQV62WZRLNZZXXYUGDRCWUT5ANCNFSM4KUXIHIQ .

barroudjo commented 4 years ago

Sorry, it doesn't work at least in some cases... Here's the error it gives me:
1:1 error Definition for rule 'no-autofix/react-hooks/exhaustive-deps' was not found no-autofix/react-hooks/exhaustive-deps

Here is my .eslintrc in case it can help !

{
  "env": {
    "browser": true
  },
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  "plugins": ["no-autofix", "@typescript-eslint", "react-hooks"],
  "rules": {
    "no-useless-escape": 0,
    "space-before-function-paren": ["error", "always"],
    "react/prop-types": 0,
    "semi": [2, "always"],
    "no-extra-semi": 2,
    "@typescript-eslint/strict-boolean-expressions": 0,
    "@typescript-eslint/no-explicit-any": "warn",
    "@typescript-eslint/no-floating-promises": 0,
    "@typescript-eslint/promise-function-async": 0,
    "@typescript-eslint/restrict-template-expressions": ["error", { "allowNumber": true }],
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn",
    "no-autofix/react-hooks/exhaustive-deps": "warn"
  },
  "extends": ["standard-react", "standard-with-typescript"],
  "settings": {
    "import/resolver": {
      "node": {
        "extensions": [".js", ".jsx", ".ts", ".tsx"]
      }
    },
    "react": {
      "version": "detect"
    }
  }
}

And I'm using the latest versions of eslint, here are my versions:

{
    "@typescript-eslint/eslint-plugin": "^2.19.2",
    "@typescript-eslint/parser": "^2.19.2",
    "eslint": "^6.8.0",
    "eslint-config-standard-react": "^9.2.0",
    "eslint-config-standard-with-typescript": "^13.0.0",
    "eslint-plugin-import": "^2.20.1",
    "eslint-plugin-no-autofix": "^1.0.0",
    "eslint-plugin-node": "^11.0.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-react": "^7.18.3",
    "eslint-plugin-react-hooks": "^2.3.0",
    "eslint-plugin-standard": "^4.0.1"
  }
aladdin-add commented 4 years ago

thanks for letting me know, I reverted that change, and published v1.0.1.

I didn't noticed a proxy object is not allowed being exported in eslint plugin. so it seems there is no easy way to fix it. 😥

aladdin-add commented 3 years ago

released in 1.1.0 https://www.npmjs.com/package/eslint-plugin-no-autofix/v/1.1.0