Skip to content

Commit bd71a1f

Browse files
committed
fix: webpack ESLintPlugin honours SKIP_PREFLIGHT_CHECK (facebook#9887)
1 parent 027b03b commit bd71a1f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-scripts/config/webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ const imageInlineSizeLimit = parseInt(
6262
// Check if TypeScript is setup
6363
const useTypeScript = fs.existsSync(paths.appTsConfig);
6464

65+
// Check SKIP_PREFLIGHT_CHECK to disable ESLint
66+
const useESLint = process.env.SKIP_PREFLIGHT_CHECK === 'true';
67+
6568
// Get the path to the uncompiled service worker (if it exists).
6669
const swSrc = paths.swSrc;
6770

@@ -746,7 +749,7 @@ module.exports = function (webpackEnv) {
746749
// The formatter is invoked directly in WebpackDevServerUtils during development
747750
formatter: isEnvProduction ? typescriptFormatter : undefined,
748751
}),
749-
new ESLintPlugin({
752+
useESLint && new ESLintPlugin({
750753
// Plugin options
751754
extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
752755
formatter: require.resolve('react-dev-utils/eslintFormatter'),

0 commit comments

Comments
 (0)