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

JSX files are not formatted #96

Closed
justin808 opened this issue Mar 29, 2015 · 3 comments

Comments

@justin808
Copy link

commented Mar 29, 2015

Here's the output and here's the sample code repository:
https://github.com/justin808/react-webpack-rails-tutorial

➜  ~/j/react/react-webpack-rails-tutorial/client/assets/javascripts (master u=) ✗ npm install -g "feross/standard"                                                                                                                                         127 ↵ ✚ [16:51:35]
/usr/local/bin/standard -> /usr/local/lib/node_modules/standard/bin/cmd.js
standard@3.3.0 /usr/local/lib/node_modules/standard
├── get-stdin@4.0.1
├── uniq@1.0.1
├── find-root@0.1.1
├── run-parallel@1.1.0
├── eslint-plugin-react@1.6.1
├── minimist@1.1.1
├── dezalgo@1.0.1 (asap@1.0.0, wrappy@1.0.1)
├── glob@5.0.3 (inherits@2.0.1, once@1.3.1, inflight@1.0.4, minimatch@2.0.4)
├── standard-format@1.3.4 (esformatter-spaced-lined-comment@2.0.1, stdin@0.0.1, esformatter-quotes@1.0.1, glob@4.5.3, esformatter-eol-last@1.0.0, minimatch@2.0.4, esformatter-literal-notation@1.0.0, esformatter@0.5.1)
└── eslint@0.17.1 (object-assign@2.0.0, escape-string-regexp@1.0.3, strip-json-comments@1.0.2, xml-escape@1.0.0, user-home@1.1.1, estraverse-fb@1.3.1, globals@6.4.1, estraverse@2.0.0, text-table@0.2.0, mkdirp@0.5.0, minimatch@2.0.4, espree@1.12.3, debug@2.1.3, chalk@1.0.0, doctrine@0.6.4, concat-stream@1.4.7, optionator@0.5.0, escope@2.0.6, js-yaml@3.2.7)
➜  ~/j/react/react-webpack-rails-tutorial/client/assets/javascripts (master u=) ✗ ls                                                                                                                                                                             ✚ [16:51:55]
CommentBox.jsx example.jsx
➜  ~/j/react/react-webpack-rails-tutorial/client/assets/javascripts (master u=) ✗ standard --format *.jsx                                                                                                                                                        ✚ [16:52:54]

/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:4365
            throw e;
                  ^
Error: Line 21: Unexpected token <
    at createError (/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:2015:21)
    at unexpectedTokenError (/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:2083:13)
    at throwUnexpectedToken (/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:2088:15)
    at parsePrimaryExpression (/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:2566:13)
    at parseLeftHandSideExpressionAllowCall (/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:2639:61)
    at parsePostfixExpression (/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:2687:16)
    at parseUnaryExpression (/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:2743:20)
    at parseBinaryExpression (/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:2832:16)
    at parseConditionalExpression (/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:2888:16)
    at parseAssignmentExpression (/usr/local/lib/node_modules/standard/node_modules/standard-format/node_modules/esformatter/node_modules/rocambole/node_modules/esprima/esprima.js:3004:16)
@feross

This comment has been minimized.

Copy link
Member

commented Mar 29, 2015

Right now, jsx is not supported by esformatter (used by standard-format). Once that's implemented by them, standard-format, and thus standard, will get support. :)

maxogden/standard-format#45

@feross feross closed this Mar 29, 2015

@kevinsimper

This comment has been minimized.

Copy link

commented Aug 20, 2015

@feross It has been implemented and the issue closed :) maxogden/standard-format#45

@feross

This comment has been minimized.

Copy link
Member

commented Aug 20, 2015

Cool!

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.