[react-scripts] Do not lint *.bs.js files, generated by BuckleScript#3714
[react-scripts] Do not lint *.bs.js files, generated by BuckleScript#3714emmenko wants to merge 1 commit intofacebook:masterfrom
Conversation
35f96b4 to
fe5f598
Compare
|
I don't think it makes sense for all people who eject to end up with this configuration as it serves a very narrow use case. |
|
I understand. However there is no way (as far as I know) to use a Do you have any other suggestion to tackle this case? |
|
Btw, if that's the only concern I guess we can simply annotate those extra lines with Update: if you still use Reason and eject you would need to "re-add" those lines back in, so it doesn't help much anyway. |
|
I don't really see us doing this. The config is already complex enough after ejecting, and we need to be very careful about adding things there. Instead I'd suggest doing something to automatically inject |
|
Hmm so is |
Summary
This PR introduces a small change in the eslint rule of webpack.config to exclude files ending with the suffix
*.bs.js(which are compiled files generated by BuckleScript).Background
When working on a React project which includes fully or partially ReasonML, you need BuckleScript to generate the compiled JS sources. When you have the
in-sourceoption active you will get the compiled JS sources (*.bs.js) next to the Reason source file.Those files will therefore "live" inside the
srcfolder, causing eslint to print some warnings:This is a bit annoying and can simply be "solved" by telling eslint to ignore those files.
Wait, ReasonML? What about
reason-scripts?As you might know, there is a package called
reason-scriptswhich is basically a "clone" ofreact-scripts, with some things adapted to compile Reason files out of the box (e.g. entry pointindex.reinstead ofindex.js).However, as I pointed out in this issue, I don't think it's necessary to have
reason-scriptsin the first place.@rrdelaney also pointed out (correctly if I'm wrong) that
bs-loadershould not be included in the package anymore.In fact, you can run the BuckleScript compiler in watch mode as a parallel process, next to
react-scripts start. This way you don't need the loader at all and you can simply use the "normal"react-scriptspackage.Anyway, this is another story...
Hopefully this gives you enough background/context to understand this change.
I'm open to any feedback/suggestion.
Thanks 🙏