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

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

Merged
merged 4 commits into from Mar 14, 2020

Conversation

IWANABETHATGUY
Copy link
Contributor

implement proposal #1058

feat #1058

Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR.

I like to allow users to ignore variables with specific names.

But, I think it should be an option like varsIgnorePattern, just like ESLint's no-unused-vars.

https://eslint.org/docs/rules/no-unused-vars

The vue/no-unused-vars rule cannot distinguish between varsIgnorePattern and argsIgnorePattern, so I think it's better to add ignorePattern option.

Also, if we change the variable name by auto fix, it may conflict with other variables. So, could you change it so that it does not autofix it.

@IWANABETHATGUY
Copy link
Contributor Author

okay, i will do that.

lib/rules/no-unused-vars.js Outdated Show resolved Hide resolved
lib/rules/no-unused-vars.js Outdated Show resolved Hide resolved
lib/rules/no-unused-vars.js Outdated Show resolved Hide resolved
lib/rules/no-unused-vars.js Show resolved Hide resolved
tests/lib/rules/no-unused-vars.js Outdated Show resolved Hide resolved
docs/rules/no-unused-vars.md Outdated Show resolved Hide resolved
Copy link
Member

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you very match!

@IWANABETHATGUY
Copy link
Contributor Author

LGTM! Thank you very match!
😀

@ota-meshi ota-meshi merged commit 60a5f6c into vuejs:master Mar 14, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants