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

For testing I' try to autoformat minified version of jQuery but getting error #942

Closed
jitendravyas opened this issue Jul 1, 2017 · 2 comments

Comments

@jitendravyas
Copy link

commented Jul 1, 2017

https://code.jquery.com/jquery-3.2.1.min.js

Error

❯ standard --fix /Users/jitendravyas/desktop/jquery-standard.js
standard: Use JavaScript Standard Style (https://standardjs.com)
  /Users/jitendravyas/vwoapp/app-v3/jquery-standard.js:3:29203: Parsing error: Unexpected token .5
@bcomnes

This comment has been minimized.

Copy link
Member

commented Jul 1, 2017

The fix flag is a feature inherited from ESlint, so if they have parsing errors on minified jquery then I imagine this would be an issue to bring upstream to that project.

The --fix flag tends to be a less aggressive formatter, only focusing on linting error found given the ruleset that are enabled. See http://eslint.org/docs/rules/ for a list of rules that have a fix method implemented.

The fix flag works great when writing code day to day IME and allows me the flexibility to format my code the way I like, within the rules of standard, while saving me time by fixing minor formatting issues.

For a more opinionated/generalized format (that can survive a torture test like jquery minified) there is https://github.com/prettier/prettier which is also a quality project, but also ads a bit more to your tooling costs. There is a https://github.com/sheerun/prettier-standard but I've not had a chance to test it out.

@bcomnes

This comment has been minimized.

Copy link
Member

commented Jul 1, 2017

Closing for now, but we can reopen if there are issues identified with standard itself.

@bcomnes bcomnes closed this Jul 1, 2017

@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.
2 participants
You can’t perform that action at this time.