Comments (5)
I did all the setup to get babel-eslint
work in vue file, and I did notice that moving parser: 'babel-eslint',
to parserOptions
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.
from eslint-plugin-vue.
Thank you for the report.
However, it seems an npm problem.
eslint-plugin-vue
is using vue-eslint-parser
, but in your environment, npm seems to install an old vue-eslint-parser
. So the error message says "Use the latest vue-eslint-parser".
Please try to remove node_modules
and package-lock.json
then npm install
. (and mind that re-start your editor.)
from eslint-plugin-vue.
Ah, no, sorry.
You have parser: "babel-eslint"
in your configuration. It overwrites parser: "vue-eslint-parser"
of plugin:vue/recommended
. It makes that eslint-plugin-vue
does not work.
Please move the parser: "babel-eslint"
into parserOptions
.
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
- parser: 'babel-eslint',
parserOptions: {
+ parser: 'babel-eslint',
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']
}
}
from eslint-plugin-vue.
Thanks @mysticatea
The errors do go away now, but it still doesn't quite work in vue files as shown in the screenshot above, as if it's not recognising my vue files. Is there anything else you can see from my settings? Thanks.
from eslint-plugin-vue.
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.
from eslint-plugin-vue.
Related Issues (20)
- `vue/no-unused-property` false positive with camelCase `v-bind` same-name shorthand HOT 7
- vue/define-macros-order does not support multiple defineModel macro calls
- Typescript: Eslint can't detect types exported from Vue SFC
- `vue/require-default-prop` gives false positive for optional Function props HOT 2
- attribute-hyphenation: Ignore tag name pattern or function
- didn't set vue-eslint-parser, but checked the rules defined in eslint-plugin-vue HOT 1
- vue/define-macros-order Ignore TS type sorting HOT 1
- Require default export on `<script>` HOT 1
- `vue/no-useless-mustaches` auto-fix produces invalid HTML
- [Rule change request] `vue/no-unused-properties`: New option to take `expose` into account HOT 1
- `vue/no-unused-emit-declarations` would throw Error when using dynamic render
- `require-explicit-slots` does not recognize slot names enclosed in quotes HOT 2
- defineModel not working with eslint:recommended rules HOT 4
- Invalid config? vue/html-closing-bracket-spacing not working. HOT 2
- `vue/no-useless-v-bind` auto-fix adds extra whitespace HOT 1
- `vue/require-explicit-slots` doesn't recognize interface passed to the macro
- Add `slots` to `vue/order-in-components` default order HOT 2
- vue/html-indent conflicting with prettier (Expected indentation of xx spaces but found xx spaces) HOT 1
- Is this expected with no-undef-properties and defineModel in <script setup>? HOT 2
- Add component-name-in-template-casing: 'PascalCaseNamespaced' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-vue.