Skip to content

Commit

Permalink
feat(react-scripts/webpack): do not lint *.bs.js files, generated by …
Browse files Browse the repository at this point in the history
…BuckleScript
  • Loading branch information
emmenko committed Jan 8, 2018
1 parent 7ecbc02 commit fe5f598
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ module.exports = {
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|jsx|mjs)$/,
test: function testForJsFilesExcludingBsFiles(fileName) {
// Do not lint `*.bs.js` files, generated by BuckleScript.
if (fileName.endsWith('.bs.js')) {
return false;
}
return /\.(js|jsx|mjs)$/.test(fileName);
},
enforce: 'pre',
use: [
{
Expand Down
8 changes: 7 additions & 1 deletion packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,13 @@ module.exports = {
// First, run the linter.
// It's important to do this before Babel processes the JS.
{
test: /\.(js|jsx|mjs)$/,
test: function testForJsFilesExcludingBsFiles(fileName) {
// Do not lint `*.bs.js` files, generated by BuckleScript.
if (fileName.endsWith('.bs.js')) {
return false;
}
return /\.(js|jsx|mjs)$/.test(fileName);
},
enforce: 'pre',
use: [
{
Expand Down

0 comments on commit fe5f598

Please sign in to comment.