0
I have this mistake in a project Vue js, I know it’s about Eslint I checked the tutorial on the website on how to remove error with command --fix, however it did not take effect, if anyone knows, I thank you if you can help.
Error:
http://eslint.org/docs/rules/key-spacing Missing space before value for key 'Component' src router index.js:9:29 {path:'/',Component:Home} ^
5 problems (5 errors, 0 warnings)
Errors: 3 http://eslint.org/docs/rules/key-spacing 1 http://eslint.org/docs/rules/comma-spacing 1 http://eslint.org/docs/rules/indent
@ ./src/main.js 5:0-30 @multi . /build/dev-client . /src/main.js
Listening at http://localhost:8080
Vue js
import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
Vue.use(Router)
export default new Router({
routes:[
{path:'/',component:Home}
]
})
What command did you use? I created a file with your code and did
eslint eslinttest.js --fix
and worked well– Sergio
Eslint --fix, in this case I should select the file giving the error
– Marcelo Batista
http://eslint.org/docs/rules/indent Expected indentation of 2 Spaces but found 0 src router index.js:11:1 } 4 problems (4 errors, 0 warnings)
– Marcelo Batista
Uses the file name in the command:
eslint ./src/main.js --fix
– Sergio