Eslint-plugin-vue goes crazy on normal js but not working in vue files
See original GitHub issueTell us about your environment
- ESLint Version: eslint@4.1.1
- eslint-plugin-vue Version: eslint-plugin-vue@3.5.1
- Node Version: v6.10.2
Please show your full configuration:
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
},
// required to lint *.vue files
plugins: [
'html',
'vue'
],
extends: [
'eslint:recommended',
'plugin:vue/recommended'
],
// add your custom rules here
'rules': {
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-undef': 'off',
'quotes': ['warn', 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': ['warn', 'always']
}
}
What did you do? Please include the actual source code causing the issue.
A bunch of eslint-plugin-vue
rules gets triggered in a normal js file, which is actually a mixin file I used for my global object for state management.
import store from './store';
export default {
data () {
return {
//...
};
},
computed: {
//...
},
methods: {
//...
}
};
What did you expect to happen?
eslint-plugin-vue
is only triggered in *.vue
files, or just wonder if there is a way to disable just the eslint-plugin-vue
rules on normal .js
What actually happened? Please include the actual, raw output from ESLint. Eslint-plugin-vue goes crazy in Atom on normal js
but not actually working in vue files (note I took the key out of the v-for, and I actually have v-for and v-if in the same component.)
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
ESLint is ignoring .vue files · Issue #327 - GitHub
ESLint is throwing the classic ELIFECYCLE error with the current config. It was linting .js files in the root folder, but I can't...
Read more >1 - Stack Overflow
This plugin is not designed to work well for split files. ... Answer from Github: https://github.com/vuejs/eslint-plugin-vue/issues/1875.
Read more >How to set up ES Lint for Airbnb, Vue JS, and VS Code
Today, I will show you how to get ES Lint working with Vue JS. If you are using Laravel ... Take careful note...
Read more >How To Use Vue - Quasar Framework
Quick tutorial about Vue principles and how to use it with Quasar.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I did all the setup to get
babel-eslint
work in vue file, and I did notice that movingparser: 'babel-eslint',
toparserOptions
also breaks my normal babel js linting in vue file.That was a good question, I actually not sure if Atom fully support running eslint on vue files yet. I guess I haven’t fully understood the setup here, and I’m just gonna roll back to my previous setup for now. Hopefully there will be an official vue-linting package for vue in the future.
Thanks for the help.
Is your editor configured that it runs eslint on
.vue
files? I’m not familiar with Atom, but for example, VSCode does not run eslint on.vue
files by default.