-
Notifications
You must be signed in to change notification settings - Fork 40
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
SyntaxError: Unexpected token
when encountering React Fragment shorthand syntax
#73
Comments
Interesting! I probably need to update some dependencies. looks like the break is way down there in babylon. Can you show me the code it was trying to parse it that broke it, or maybe throw up a repo that reproduces this? man that could really help me fix this! Especially that second thing!! |
@the-simian hello, I have the same problem. Can you fix it? THX ^_^ |
@luckykun can you post me a snippet of code you got that's breaking so I can use it to test? It might be in the underlying parser also. |
@luckykun I'll be updating the underlying parser very soon might fix this. |
(possibly duplicate of #79 ) |
I updated the underlying parser, lets see if this is still an issue @luckykun |
Yes, still an issue. It throws the error for each file. |
thanks for the update @rayno , can you post a snippet that throws so I can reproduce your exact usecase? |
Environment: Windows 10 64-bit file: import React from 'react'
function Comp() {
return (
<>
<h1>Hello</h1>
<p>Text</p>
</>
)
} file: let plato = require('es6-plato')
let src = './test.js'
let outputDir = './plato'
let lintRules = {
rules: {
indent: [2, 'tab'],
quotes: [2, 'single'],
semi: [2, 'always'],
'no-console': [1],
curly: ['error'],
'no-dupe-keys': 2,
'func-names': [1, 'always'],
},
env: {
es6: true,
},
globals: ['require'],
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
modules: true,
},
},
}
let complexityRules = {}
let platoArgs = {
title: 'example',
eslint: lintRules,
complexity: complexityRules,
}
return plato.inspect(src, outputDir, platoArgs) Console output from
|
@rayno, thank you! |
I have the same problem |
I have the same problem. Any chance this is going to be fixed? Or an alternative? 🤔 |
when it encounters Babel 7's shorthand of React.Fragment,
<>
.The text was updated successfully, but these errors were encountered: