eslint-plugin-import-order-autofix icon indicating copy to clipboard operation
eslint-plugin-import-order-autofix copied to clipboard

ESLint can't find the plugin

Open joepio opened this issue 8 years ago • 1 comments

#Hi Alex, thanks for all your hard work!

Unfortunately, I can't seem to get this to work. I keep getting this error when I try to run my linter:

ESLint couldn't find the plugin "eslint-plugin-import-order-autofix". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-import-order-autofix is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm i eslint-plugin-import-order-autofix@latest --save-dev

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

Of course, I've made sure to check the suggestions.

The eslint plugin is installed and present in node_modules:

// in package.json

    "eslint": "^3.14.1",
    "eslint-config-airbnb": "^14.0.0",
    "eslint-import-resolver-webpack": "^0.8.1",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-import-order-autofix": "^0.8.3",
    "eslint-plugin-jsx-a11y": "^3.0.2",
    "eslint-plugin-react": "^6.9.0",

The rule is added to the ESlint config:

// in .esintrc

{
  "plugins": [
    "react",
    "jsx-a11y",
    "import-order-autofix"
  ],
  "rules": {
    "react/no-array-index-key": 1,
    "import-order-autofix/order": 1
  }
}

I've made sure to run the local ESlint:

./node_modules/.bin/eslint --fix --ext .jsx,.js .

I've tried removing the node_modules folder. I've also tried installing ESlint and this plugin globally, but keep getting the same error.

Do you perhaps know something else I can try?

joepio avatar Feb 07 '17 11:02 joepio

The problem likely is that the package requires ESLint 2/3, but you (and anyone else using ESlint nowadays) are running ESLint 4. You can check if this is a problem by trying to re-install the plug-in; if you see:

warning "[email protected]" has incorrect peer dependency "[email protected] - 3.x".

then you know that's the issue.

As for a fix, it's possible the library author can just update his package.json to require the newer version of ESLint, but it's likely that the new version breaks the plug-in and the author will have to address that issue (or issues) also.

... but since (unfortunately) it seems like this project may be dead/abandoned, I wouldn't hold my breath waiting.

machineghost avatar Aug 02 '17 18:08 machineghost