SoftboxLab / gandalf-lint-vue

Vue Bad Code Shall Not Pass
https://www.npmjs.com/package/@softboxlab/eslint-config-gandalf-lint-vue
MIT License
0 stars 0 forks source link

Fix problem with eslint-plugin-vue new rules #8

Closed vilaboim closed 5 years ago

vilaboim commented 5 years ago

I added eslint-plugin-vue@next as a peerDependency, fixing the problem reported at #6 😅

pablohpsilva commented 5 years ago

I've created a simple Home.vue file and ran the eslint on it and got an error. Both the file and the error can be found below:

<template>
  <span>{{ vaca }}</span>
</template>

<script>
export default {
  data () {
    return {
      vaca: 'vaca'
    }
  }
}
</script>
/Users/pablohpsilva/Code/gandalf-lint-vue/test/Home.vue
  1:1  error  Definition for rule 'vue/no-spaces-around-equal-signs-in-attribute' was not found  vue/no-spaces-around-equal-signs-in-attribute

✖ 1 problem (1 error, 0 warnings)
vilaboim commented 5 years ago

@pablohpsilva did you install eslint-plugin-vue? Can you show your package.json and .eslintrc?

alexbruno commented 5 years ago

Hello everybody!

I tried it in a @vue/cli project and it works, but needs some workaround.

Only .vue files can be linted. Many .js files shall not pass.

It tries to lint all .js files into the project (including .eslintrc.js, .postcssrc.js, babel.config.js, jest.config.js, vue.config.js) when using default eslint settings at the project, just switching extends to @softboxlab/eslint-config-gandalf-lint-vue and running default lint script from package.json.

It is necessary to create a new script command to lint only .vue files, like:

"glint": "npx eslint src/**/*.vue"

vilaboim commented 5 years ago

@alexbruno and @pablohpsilva, I'm working on it. 😉

vilaboim commented 5 years ago

@alexbruno I guess we cannot have a .eslintignore on our side, but I improved the README to help the users.