Comments can apparently be used in .babelrc files, as is done in react-redux-starter-kit, like so:
// foo bar biz baz
{
"presets": ["es2015", "react", "stage-0"],
"plugins": ["transform-runtime"]
}
Storybook parses .babelrc configuration somewhere and fails when it encounters //.
It's easy to work-around (remove the comments):
start-storybook -p 9001
=> Using custom .babelrc configurations.
=> Error parsing .babelrc file: Unexpected token /
However, Babel allows comments in its config, so Storybook should probably expect to encounter them, right?
yes. We should use cjson parser I guess.
This is the place we should do it. See: https://github.com/kadirahq/react-storybook/blob/master/src/server/config.js#L18
I am open to PRs for this.
Just a note on this - since this shows up in Google - babel uses json5 rather than cjson.
json5 is a little more liberal and supports unquoted keys, single quotes, trailing commas, etc. So if you're using cjson you may still have issues with valid babelrc files.
Most helpful comment
Just a note on this - since this shows up in Google - babel uses json5 rather than cjson.
json5 is a little more liberal and supports unquoted keys, single quotes, trailing commas, etc. So if you're using cjson you may still have issues with valid babelrc files.