ESLint-Formatter icon indicating copy to clipboard operation
ESLint-Formatter copied to clipboard

Error: Failed to load plugin 'import'

Open IPWright83 opened this issue 2 years ago • 0 comments

I've started hitting an error recently, which is almost certainly due to configuration somewhere. But I'm a little stumped as to why/how to go about fixing it. Hoping that I might get a little bit of guidance :)

My error is this

Error: Failed to load plugin 'import' declared in '.eslintrc » ../../../.eslintrc': ENOENT: no such file or directory, open '/home/ian/src/webclient/node_modules/.pnpm/[email protected]/node_modules/es-abstract/2021/RequireObjectCoercible.js'
Referenced from: /home/ian/src/webclient/.eslintrc

.eslintrc

{
    "root": true,
    "parser": "@typescript-eslint/parser", 
    "extends": [
        "react-app",
        "airbnb-typescript",
        "prettier",
        "plugin:import/typescript",
        "plugin:json/recommended",
        "plugin:react/jsx-runtime"
    ],
    "globals": {
        "jest": false,
        "describe": false,
        "test": false,
        "expect": false
    },
    "settings": {
        "import/resolver": {
            "node": {
                "paths": ["src"]
            }
        }
    },
    "plugins": [
        "babel",
        "import",
        "react-hooks",
        "react-prefer-function-component",
        "json",
        "lodash"
    ],
...

I'm running a monorepo (this hasn't caused me problems before), the root package.json has the following defined, although my eslint_d is installed globally.

      "eslint": "8.25.0",
        "eslint-config-airbnb": "18.2.1",
        "eslint-config-airbnb-typescript": "14.0.0",
        "eslint-config-prettier": "8.5.0",
        "eslint-config-react-app": "6.0.0",
        "eslint-plugin-babel": "5.3.1",
        "eslint-plugin-flowtype": "8.0.0",
        "eslint-plugin-import": "2.26.0",
        "eslint-plugin-jest": "27.2.1",
        "eslint-plugin-jest-dom": "4.0.3",
        "eslint-plugin-json": "3.1.0",
        "eslint-plugin-jsx-a11y": "6.4.1",
        "eslint-plugin-react": "7.26.1",
        "eslint-plugin-react-hooks": "4.6.0",
        "eslint-plugin-react-prefer-function-component": "0.0.7",
        "eslint-plugin-testing-library": "5.6.4",

IPWright83 avatar Apr 18 '23 15:04 IPWright83