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

Promote --fix when standard detects issues #576

Closed
timoxley opened this issue Jul 26, 2016 · 1 comment · Fixed by standard/standard-engine#115
Closed

Promote --fix when standard detects issues #576

timoxley opened this issue Jul 26, 2016 · 1 comment · Fixed by standard/standard-engine#115

Comments

@timoxley
Copy link
Contributor

timoxley commented Jul 26, 2016

Problem

standard --fix does a lot of hard work for the user and should reduce instances of linter-rage when faced with sweeping changes, such as the new JSX single -> double quote rule: standard/eslint-config-standard#27.

However, standard --fix is new and many users will not know to even look for it. Some recent anecdotal evidence:

image

This new & handy feature could do with more promotion, especially when it's most applicable: when the user is staring at a wall of linter errors.

Suggestion

Mention --fix whenever standard reports an error.

Issue stemming from this comment: #564 (comment)


I'd submit a PR but it's not obvious what the wording should be or how this should be achieved.

Ideally the error message would span multiple lines like:

standard: Use JavaScript Standard Style (http://standardjs.com)
Try `standard --fix` to automatically fix problems.

But that's probably not possible in current setup as is. The tagline is printed in between standard: and the (homepage) in the following:

standard: Use JavaScript Standard Style (http://standardjs.com)

Without looking too deeply it looks like the formatting of the error message is applied by eslint. Perhaps there are other options to get it to print a different thing?

Embedding it on the one line as a part of the tagline looks like:

standard: Use JavaScript Standard Style. Try `standard --fix` to automatically fix problems. (http://standardjs.com)

This is maybe just acceptable in this form, though it is a bit wordy.

The tagline is not really the right place for this as it also infects --help (and perhaps other places?):

> standard --help
standard - Use JavaScript Standard Style. Try `standard --fix` to automatically fix problems. (http://standardjs.com)

Usage:
    standard <flags> [FILES...]

    If FILES is omitted, then all JavaScript source files (*.js, *.jsx) in the current
    working directory are checked, recursively.

    Certain paths (node_modules/, .git/, coverage/, *.min.js, bundle.js, vendor/) are
    automatically ignored.

Flags:
…

Maybe this is ok though?

Overall: ¯\_(ツ)_/¯

@feross
Copy link
Member

feross commented Jul 26, 2016

Great idea -- this is easy to add in standard-engine which is where the support for --fix was added. PR here: standard/standard-engine#115

@feross feross closed this as completed Jul 26, 2016
@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants