Skip to content
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

Allow underscore prefix to disable no-unused-vars #1058

Closed
fiesh opened this issue Feb 24, 2020 · 2 comments
Closed

Allow underscore prefix to disable no-unused-vars #1058

fiesh opened this issue Feb 24, 2020 · 2 comments

Comments

@fiesh
Copy link

fiesh commented Feb 24, 2020

If one wants to repeat a block n times, a v-for="i in n" comes in handy.

Now vue/no-unused-vars will rightfully complain that i is unused.

In TypeScript, there's a similar issue with function arguments that are not used on purpose. These are ignored as unused if prefixed with a _.

How about allowing this for no-unused-vars as well? So that v-for="_i in n" would not warn, while v-for="i in n" would.

@IWANABETHATGUY
Copy link
Contributor

I think _ is better, which is same as other lint rule, i can provide a pr for this

@IWANABETHATGUY
Copy link
Contributor

IWANABETHATGUY commented Mar 8, 2020

okey, no-unused-var is not only contains v-for stuff, so your proposal is better,    👍

IWANABETHATGUY added a commit to IWANABETHATGUY/eslint-plugin-vue that referenced this issue Mar 8, 2020
ota-meshi pushed a commit that referenced this issue Mar 14, 2020
…1070)

* feat: add fixable, no more error when unused variable with prefix _

implement proposal #1058

feat #1058

* fix: make fix optional,add varIgnorePattern

* feat: change varIgnorepattern to ignorePattern, add test, update readme

* docs: update doc
lisadeloach63 added a commit to lisadeloach63/plugin-develop-vue that referenced this issue Oct 7, 2022
…#1070)

* feat: add fixable, no more error when unused variable with prefix _

implement proposal vuejs/eslint-plugin-vue#1058

feat vuejs/eslint-plugin-vue#1058

* fix: make fix optional,add varIgnorePattern

* feat: change varIgnorepattern to ignorePattern, add test, update readme

* docs: update doc
Viktor949 added a commit to Viktor949/Eslint-Plugin-Vue that referenced this issue Oct 1, 2023
…#1070)

* feat: add fixable, no more error when unused variable with prefix _

implement proposal vuejs/eslint-plugin-vue#1058

feat vuejs/eslint-plugin-vue#1058

* fix: make fix optional,add varIgnorePattern

* feat: change varIgnorepattern to ignorePattern, add test, update readme

* docs: update doc
sebastianmensense added a commit to sebastianmensense/Eslint-Plugin-Vue- that referenced this issue Nov 15, 2023
…#1070)

* feat: add fixable, no more error when unused variable with prefix _

implement proposal vuejs/eslint-plugin-vue#1058

feat vuejs/eslint-plugin-vue#1058

* fix: make fix optional,add varIgnorePattern

* feat: change varIgnorepattern to ignorePattern, add test, update readme

* docs: update doc
Antontokarchuk0302 added a commit to Antontokarchuk0302/Eslint-plugin that referenced this issue Nov 16, 2023
…#1070)

* feat: add fixable, no more error when unused variable with prefix _

implement proposal vuejs/eslint-plugin-vue#1058

feat vuejs/eslint-plugin-vue#1058

* fix: make fix optional,add varIgnorePattern

* feat: change varIgnorepattern to ignorePattern, add test, update readme

* docs: update doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants