Created
March 2, 2018 07:57
-
-
Save karanssj4/7188528ab36fb4e78c8fc385510f3136 to your computer and use it in GitHub Desktop.
Make eslint work with vueJs with eslint-plugin-vue (tested with eslint-plugin-vue v4.3.0)
This file contains 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
// 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'] | |
} | |
}, | |
} | |
} |
👍
👍
how to resolve import/no-unresolved
when importing TS files in JS in React, any idea?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
resolves .vue files so that you can import vue components without specifying .vue extension