Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Make eslint work with vueJs with eslint-plugin-vue (tested with eslint-plugin-vue v4.3.0)
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
sourceType: 'module',
parser: 'babel-eslint',
},
env: {
browser: true,
},
// required to lint *.vue files
plugins: [
'vue'
],
extends: [
'eslint:recommended',
'airbnb',
'plugin:vue/recommended'
],
// add your custom rules here
rules: {
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'import/extensions': ['error', 'always', {
js: 'never',
vue: 'never'
}]
},
settings: {
'import/resolver': {
node: {
extensions: ['.js','.jsx','.vue']
}
},
}
}
@karanssj4

This comment has been minimized.

Copy link
Owner Author

@karanssj4 karanssj4 commented Mar 2, 2018

resolves .vue files so that you can import vue components without specifying .vue extension

@starandtina

This comment has been minimized.

Copy link

@starandtina starandtina commented Dec 10, 2018

👍

@Definence

This comment has been minimized.

Copy link

@Definence Definence commented Apr 16, 2020

👍

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