How to configure atom-beautify package to format with babel/jsx javascript files?

I searched for a package to auto-indent and beautify my React/babel code. I just tried atom-beautify which seems to have good feeback on Atom. But the result on an usual babel file is not good enough: “HTML tag” doesn’t indent as wanted. Has anyone tried to use atom-beautify with babel? Answer I currently use the … Read more

SyntaxError with Jest and React and importing CSS files

I am trying to get my first Jest Test to pass with React and Babel. I am getting the following error: SyntaxError: /Users/manueldupont/test/avid-sibelius-publishing-viewer/src/components/TransportButton/TransportButton.less: Unexpected token > 7 | @import ‘../variables.css’; | ^ My package.json config for jest look like this: “babel”: { “presets”: [ “es2015”, “react” ], “plugins”: [ “syntax-class-properties”, “transform-class-properties” ] }, “jest”: { … Read more

Extended Errors do not have message or stack trace

When running this snippet through BabelJS: class FooError extends Error { constructor(message) { super(message); } } let error = new FooError(‘foo’); console.log(error, error.message, error.stack); it outputs {} which is not what I expect. Running error = new Error(‘foo’); console.log(error, error.message, error.stack); produces {} foo Error: foo at eval (eval at <anonymous> (https://babeljs.io/scripts/repl.js?t=2015-05-21T16:46:33+00:00:263:11), <anonymous>:24:9) at REPL.evaluate … Read more

Plugin 0 specified in babel-preset-es2015 provided an invalid property of _c

Getting above error with below configuration, commenting passPerPreset removes the error however. Is there any configuration missing ? .babelrc : { “passPerPreset”: true, “presets”: [{ “plugins”: [ “./build/babelRelayPlugin”, “transform-runtime”, “transform-es2015-classes” ] }, “es2015”, “stage-0”, “react”], “env”: { “development”: { “presets”: [“react-hmre”] } } } package.json : “babel-cli”: “^6.5.1”, “babel-core”: “^6.5.2”, “babel-eslint”: “^4.1.8”, “babel-loader”: “^6.2.2”, “babel-plugin-react-transform”: … Read more

How to use mobx in react-native 0.56 (Babel 7) with Decorators

i’ve upgraded my RN app from 0.55.4 to 0.56 that use Babel 7. In 0.55.4 to use decorators for MOBX i use “babel-plugin-transform-decorators-legacy” but is not compatible with Babel 7… react-native ver: 0.56.0 mobx ver: 5.0.3 mobx-react ver: 5.2.3 does anyone have the solution? Thanks UPDATE: The app works in DEBUG with this configuration package.json … Read more

How to use babel/corejs3/webpack correctly for IE11?

With my current config (see below), I’m getting this error: [object Error]{description: “Argument ob…”, message: “Argument ob…”, name: “TypeError”, number: -2147418113, stack: “TypeError: …”, Symbol()_7.bs7gi3oa3wi: undefined} I tried to dig based on Symbol()_ … : undefined} but I couldn’t find any clear indication. This is my .babel.config.js: module.exports = function (api) { api.cache(true); const presets … Read more

Whats the difference when configuring webpack babel-loader vs configuring it within package.json?

Hi please help me understand the differences between setting babel config inside .babelrc vs webpack loader options, vs inserting it in package.json. For example, Would it make any difference if I put the presets in the webpack babel-loader options vs package.json or a separate .babelrc config file? In webpack config: { test: /\.(js|jsx|mjs)$/, loader: require.resolve(‘babel-loader’), … Read more

babel-node vs babel-register in development

Is there any difference between using babel-register or babel-node when running my code in development? The two options are: require(‘babel-register’)({ “presets”: [“es2015”] }); at entry-point.js and npm start script node entry-point.js simply have npm start script babel-node entry-point.js –preset=es2015 Do they do the exact same thing? And is one way recommended over the other? Answer … Read more

Error with gulp serve: Requiring external module babel-register

Running yeoman generator “Webapp”, I’m getting an error when running gulp serve. Here are the following versions for a better background : sw_vers && node -e ‘console.log(process.platform, process.versions)’ ProductName: Mac OS X ProductVersion: 10.11.3 BuildVersion: 15D21 darwin { http_parser: ‘2.6.0’, node: ‘5.2.0’, v8: ‘4.6.85.31’, uv: ‘1.7.5’, zlib: ‘1.2.8’, ares: ‘1.10.1-DEV’, icu: ‘56.1’, modules: ’47’, openssl: … Read more