Skip to content

Instantly share code, notes, and snippets.

@guidobouman
Last active July 21, 2021 10:30
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guidobouman/7e035cd761c2619028dd1511133243af to your computer and use it in GitHub Desktop.
Save guidobouman/7e035cd761c2619028dd1511133243af to your computer and use it in GitHub Desktop.
Make ESlint import resolver work with Vue & Webpack
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
extends: 'airbnb-base',
// required to lint *.vue files
plugins: [
'html'
],
'settings': {
'import/resolver': {
'webpack': {
'config': 'build/webpack.base.conf.js'
}
}
},
// add your custom rules here
'rules': {
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'import/extensions': ['error', 'always', {
'js': 'never',
'vue': 'never'
}]
}
}
npm i eslint-import-resolver-webpack --save-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment