From 30845c85fe457888851c7d93a734fb6b5a74b01d Mon Sep 17 00:00:00 2001 From: Brody McKee Date: Wed, 2 Jun 2021 20:08:32 +0300 Subject: [PATCH] Remove ESLint verification when opting-out (#10499) --- .../react-scripts/scripts/utils/verifyPackageTree.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/react-scripts/scripts/utils/verifyPackageTree.js b/packages/react-scripts/scripts/utils/verifyPackageTree.js index 210043ff7c4..d23d8c54265 100644 --- a/packages/react-scripts/scripts/utils/verifyPackageTree.js +++ b/packages/react-scripts/scripts/utils/verifyPackageTree.js @@ -13,6 +13,8 @@ const fs = require('fs'); const semver = require('semver'); const path = require('path'); +const isESLintPluginEnabled = process.env.DISABLE_ESLINT_PLUGIN !== 'true'; + // We assume that having wrong versions of these // in the tree will likely break your setup. // This is a relatively low-effort way to find common issues. @@ -21,14 +23,15 @@ function verifyPackageTree() { // These are packages most likely to break in practice. // See https://github.com/facebook/create-react-app/issues/1795 for reasons why. // I have not included Babel here because plugins typically don't import Babel (so it's not affected). - 'babel-eslint', 'babel-jest', 'babel-loader', - 'eslint', 'jest', 'webpack', 'webpack-dev-server', - ]; + isESLintPluginEnabled && 'babel-eslint', + isESLintPluginEnabled && 'eslint', + ].filter(Boolean); + // Inlined from semver-regex, MIT license. // Don't want to make this a dependency after ejecting. const getSemverRegex = () =>