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

prevent-abbreviations is too eager #367

Closed
dasZGFz opened this issue Sep 14, 2019 · 1 comment · Fixed by #404
Closed

prevent-abbreviations is too eager #367

dasZGFz opened this issue Sep 14, 2019 · 1 comment · Fixed by #404

Comments

@dasZGFz
Copy link

dasZGFz commented Sep 14, 2019

This code:

const image = new Image();
image.src = '';

outputs this as an error:

The property src should be named source. A more descriptive name will do too.  unicorn/prevent-abbreviations

My current workaround is to disable eslint for that line but I wonder if there's a way to fix it in the plugin.

@garyking
Copy link
Contributor

garyking commented Sep 14, 2019

sindresorhus's own package, execa, uses env as an option, yet this rule reports an error for that abbreviation, too. So I agree that sometimes the rule is too aggressive.

It shouldn't report on arguments that we pass to a function, or values returned from a function. Since if those were functions that we created ourselves and were in our own scripts, then those occurrences would already be reported.

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 a pull request may close this issue.

2 participants