Skip to content

Commit

Permalink
fix: webpack ESLintPlugin honours SKIP_PREFLIGHT_CHECK (facebook#9887)
Browse files Browse the repository at this point in the history
  • Loading branch information
abraidwood committed Oct 27, 2020
1 parent 027b03b commit 39452df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-scripts/config/webpack.config.js
Expand Up @@ -62,6 +62,9 @@ const imageInlineSizeLimit = parseInt(
// Check if TypeScript is setup
const useTypeScript = fs.existsSync(paths.appTsConfig);

// Check SKIP_PREFLIGHT_CHECK to disable ESLint
const useESLint = process.env.SKIP_PREFLIGHT_CHECK !== 'true';

// Get the path to the uncompiled service worker (if it exists).
const swSrc = paths.swSrc;

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

0 comments on commit 39452df

Please sign in to comment.