Skip to content

no-unresolved error when linting using eslint-import-resolver-webpack  #1050

@Yahkob

Description

@Yahkob

I installed eslint-plugin-import/resolver-webpack so I could correctly resolve webpack aliases using eslint.

Before setting up eslint-plugin-import and eslint-import-resolver-webpack I would just get this error due to eslint not being able to resolve an alias I set up in webpack.
Unable to resolve path to module 'src/picture.jpg

Now I get a ton of errors am I doing something wrong? I've googled and looked through issues for the last couple hours but can't figure out what I'm missing.

package.json:

        "eslint": "^3.12.0",
        "eslint-import-resolver-webpack": "~0.8.4",
        "eslint-plugin-import": "^2.9.0",
        "webpack": "3.8.1",

.eslintrc:

    "plugins": [
        "react",
        "import"
    ],
    "settings": {
        "import/resolver": {
            "webpack": {
                "config": "webpack.config.js"
            }
        }
    }

webpack.config.js:

        alias: {
            'src': path.resolve(__dirname, 'src')
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions