-
-
Notifications
You must be signed in to change notification settings - Fork 681
disable eslint in vue template #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for this issue. There is no way, currently. |
It's particularly frustrating with the |
Any way to disable eslint in pug templates? The solution given apparently doesn't work with pug. |
You need to add ':key="t"', it needs for circle's item. |
@Julia-Lavrova Thanks! |
@Julia-Lavrova thanks. |
@mysticatea how about now??? <!-- eslint-disable-next-line vue/no-v-html -->
<p class="post-excerpt" v-html="post.excerpt || post.frontmatter.description || '' " /> |
The above |
try |
@willin It seems that it can't resolved this situation
|
your_project/config/index.jschange the value of useEslint from true to false, from line 26, inside:
note: I use the vue webpack template, the version of the template is 1.3.1 |
@aniude you can use it like so;
|
@gluons you need to use it inside the |
@blowsie It still won't work. Not only VSCode. Vue CLI throws the errors. |
We don't support pug templates @gluons Depending on version of |
@michalsnik I've removed
> yarn list --pattern eslint-plugin-vue
yarn list v1.12.3
├─ @vue/[email protected]
│ └─ [email protected]
└─ [email protected]
> yarn list --pattern vue-eslint-parser
yarn list v1.12.3
├─ @vue/[email protected]
│ └─ [email protected]
└─ [email protected] Errors still exist. |
Is there a way to ignore someone specific rule globally in the .eslintrc file? I tried this, but it doesn't work
I want this, because i want to use v-html everywhere and don't need to set ignore on every occurence. |
Went with "plugin:vue/strongly-recommended" [0]. However I (order of importance) * disabled "vue/require-v-for-key" as there are no stable ids for e.g. aliases and from my intuition and [1] there is a risk in making them up and no possibility [2] to selectively disable the rule * bumped "vue/max-attributes-per-line" to allow for up to 3 attributes per line * switched "vue/html-indent" to use tabs Applied auto fix thereafter. Possible IDE warning for "empty tag does not work in some browsers" (after "vue/html-self-closing") would be true in HTML, but vue treats that, so this is actually a matter of IDE settings. Should do at some point. "vue/attribute-hyphenation" changes camelCased attributes to hypentated ones but that should effectively be a no diff [3]. [0] https://eslint.vuejs.org/rules/#priority-b-strongly-recommended-improving-readability [1] https://forum.vuejs.org/t/v-for-with-simple-arrays-what-key-to-use/13692/15 [2] vuejs/eslint-plugin-vue#260 [3] https://vuejs.org/v2/guide/components-props.html#Prop-Casing-camelCase-vs-kebab-case Bug: T220375 Change-Id: I6ccb2a64270e402a962122a4ead702fa1526c0f7
@PayteR I think this rule expects an int rather than a string. I have it working like this:
|
The error exists in VSCode even I try to ignore it:
Software version:
|
Add in App.vue <script> /* eslint-disable */ </script> |
I'm using [email protected] and I'm still experiencing this bug: |
why not just pass |
That is what I've done as a workaround, but it doesn't make this not a bug. |
Because you can't do this: <div>
<component :="{ key: cellData.key, class: cellData.class }"></component>
</div> In this situation, you must do something like this: <div>
<component v-bind="{ key: cellData.key, class: cellData.class }"></component>
</div> |
@rajeshwarpatlolla let me know if you find a solution. I have the exact same problem |
I had the same problem.
reference: https://gitmemory.com/issue/vuejs/eslint-plugin-vue/1269/668921391 If you are using |
Edit: For Pug templates All of the suggestions thus far weren't working for me either until I tried enclosing an actual C-style comment block within the html comment. This works for me:
Hopefully this works for others. Let us know! |
@Plutonan this solution appears to work, for a handful of people at least. |
thanks! this worked for me. |
The only problem is, these comments will show up in the DOM:
We need a way to hide them from the DOM! |
Do this: <!-- eslint-disable vue/require-v-for-key, vue/valid-v-for -->
<template>
<div v-for="..." />
</template> not this: <template>
<!-- eslint-disable vue/require-v-for-key, vue/valid-v-for -->
<div v-for="..." />
</template> |
I guess that works, but only if you want to disable the rule for the entire template. |
There is a problem with Let's say that I have created these modifiers for export const Keycodes = {
multiply: 106,
minus: 109,
plus: 107,
divide: 111,
} If I initialize these custom keycodes with Vue.config.keyCodes = Keycodes and add them to const { Keycodes } = require('./Keycodes')
const customKeycodes = Object.keys(Keycodes)
module.exports = {
//rest of the eslint settings
'rules': {
// Rest of eslint rules
'vue/valid-v-on': ['warn', {'modifiers': customKeycodes }],
}
} It doesn't work in VSCode, but the webpack is compiling without errors. Problem is that I cannot report this error, since it is in a private repository. :-/ So the only way is to completely turn off this specific rule in a template. <template>
<!-- eslint-disable vue/valid-v-on --> |
Hi,
Is there anyway to disable lint in
template
like injs
(e.g.eslint-disable-line
)?The text was updated successfully, but these errors were encountered: