From 0959d09f5c249da927c9a30234a77a300dad18bf Mon Sep 17 00:00:00 2001 From: Brody McKee Date: Thu, 4 Feb 2021 11:06:19 +0200 Subject: [PATCH] Remove ESLint verification when opting-out --- .../react-scripts/scripts/utils/verifyPackageTree.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/react-scripts/scripts/utils/verifyPackageTree.js b/packages/react-scripts/scripts/utils/verifyPackageTree.js index 210043ff7c4..0de4fab9cf7 100644 --- a/packages/react-scripts/scripts/utils/verifyPackageTree.js +++ b/packages/react-scripts/scripts/utils/verifyPackageTree.js @@ -13,22 +13,27 @@ 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. function verifyPackageTree() { - const depsToCheck = [ + let depsToCheck = [ // 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', ]; + + if (isESLintPluginEnabled) { + depsToCheck = [...depsToCheck, 'babel-eslint', 'eslint']; + } + // Inlined from semver-regex, MIT license. // Don't want to make this a dependency after ejecting. const getSemverRegex = () =>