question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hardcoded babel presets

See original GitHub issue

jscodeshift does not allow me to parse my files properly. After some investigation I found out that it calls babel-register with hardcoded presets and plugins:

https://github.com/facebook/jscodeshift/blob/ccab1fca7adc185cf51ad9a5321e4a60b4406308/src/Worker.js#L57

I could track the origin of this code at https://github.com/facebook/jscodeshift/pull/85 but I couldn’t understand why the presets are hardcoded there. Would it be possible to, instead of setting the babelrc option always as a boolean, send a path to a custom .babelrc?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
fklingcommented, Dec 4, 2018

The part of the code you are referring to is used to convert the transform code itself, not the source files to codemod.

A bunch of additional options have been added to the parser configs in the meantime and it is now also possible to provide your own options from the CLI via --parse-config.

Hopefully this will help you.

0reactions
afilpcommented, Jun 20, 2018

@maddrag0n I am afraid I will do the same, too bad that this is not working. Thx!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Options - Babel.js
Instructs Babel to run each of the presets in the presets array as an independent pass. This option tends to introduce a lot...
Read more >
Come on. Buble *is* Babel, just with a few presets hardcoded ...
Buble is Babel, just with a few presets hardcoded. Yeah, it's better usability, until you need to run a production application.
Read more >
babel-preset-env | Yarn - Package Manager
A Babel preset that compiles ES2015+ down to ES5 by automatically determining the Babel plugins and polyfills you need based on your targeted...
Read more >
Babel JS from the ground up - Jim Fisher
// babel.config.json { "presets": [ "./my-preset.js" ] } // Usage import * as babel from "@babel ...
Read more >
Babel - skuba - GitHub Pages
Build command is hardcoded to input directory src and output directory lib . The babel-node REPL is fairly primitive. While it can import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found