Last active
July 21, 2021 10:30
-
-
Save guidobouman/7e035cd761c2619028dd1511133243af to your computer and use it in GitHub Desktop.
Make ESlint import resolver work with Vue & Webpack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
}] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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