[react-scripts] Do not lint *.bs.js files, generated by BuckleScript #3714
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-source
option active you will get the compiled JS sources (*.bs.js
) next to the Reason source file.Those files will therefore "live" inside the
src
folder, 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-scripts
which is basically a "clone" ofreact-scripts
, with some things adapted to compile Reason files out of the box (e.g. entry pointindex.re
instead ofindex.js
).However, as I pointed out in this issue, I don't think it's necessary to have
reason-scripts
in the first place.@rrdelaney also pointed out (correctly if I'm wrong) that
bs-loader
should 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-scripts
package.Anyway, this is another story...
Hopefully this gives you enough background/context to understand this change.
I'm open to any feedback/suggestion.
Thanks 🙏