Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint-import-resolver-webpack not working when use webpack-merge #1038

Closed
blling opened this issue Mar 6, 2018 · 3 comments
Closed

eslint-import-resolver-webpack not working when use webpack-merge #1038

blling opened this issue Mar 6, 2018 · 3 comments

Comments

@blling
Copy link

blling commented Mar 6, 2018

Eslint no errors when use base.config.js, but give a import/no-unresolved error when use pro.config.js

base.config.js

const path = require('path');

module.exports = {
  resolve: {
    modules: ["app", 'node_modules'],
    mainFiles: ['index'],
    alias: {
      containers: path.resolve(__dirname, 'app/containers'),
    },
  },
};

pro.config.js

const merge = require('webpack-merge');
const webpackBaseConfig = require('./base.config');
module.exports = merge(webpackBaseConfig, {});

.eslintrc

"settings": {
    "import/resolver": {
      "webpack": {
        "config": "./scripts/webpack/pro.config.js"
      }
    }
  }

devDependencies:

    "eslint": "4.18.1",
    "eslint-config-airbnb": "16.1.0",
    "eslint-import-resolver-webpack": "0.8.4",
    "eslint-plugin-import": "2.9.0",
    "eslint-plugin-jsx-a11y": "6.0.3",
    "eslint-plugin-prettier": "2.6.0",
    "eslint-plugin-react": "7.7.0",
    "webpack-merge": "4.1.2",
@blling
Copy link
Author

blling commented Mar 7, 2018

Anyone knows what is the solution?

@ljharb
Copy link
Member

ljharb commented Mar 9, 2018

I have no idea what webpack-merge is, but I'm not sure why you're using it - if you go into a repl and do console.log(require('./pro.config')) what do you get?

@blling
Copy link
Author

blling commented Mar 10, 2018

Here is the introduce of webpack-merge.
I upgrade my IDE to VSCODE 1.21.0, then i do not get this error anymore.
Maybe it is just a IDE problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants