From 49de0592fa97effed1cc0f8e8241a43ca73df78c Mon Sep 17 00:00:00 2001 From: alex-peck <53013351+alex-peck@users.noreply.github.com> Date: Mon, 19 Oct 2020 12:13:19 -0400 Subject: [PATCH] Block extra dev dependencies for now (#13731) * Block extra dev dependencies for now * oops --- make-util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make-util.js b/make-util.js index 01f827360cbb..f91ffa9d53f1 100644 --- a/make-util.js +++ b/make-util.js @@ -161,7 +161,7 @@ var buildNodeTask = function (taskPath, outDir) { // verify no dev dependencies // we allow a TS dev-dependency to indicate a task should use a different TS version var packageJson = JSON.parse(fs.readFileSync(packageJsonPath).toString()); - var devDeps = packageJson.devDependencies ? Object.keys(packageJson.devDependencies).length != 0 : 0; + var devDeps = packageJson.devDependencies ? Object.keys(packageJson.devDependencies).length : 0; if (devDeps == 1 && packageJson.devDependencies["typescript"]) { var version = packageJson.devDependencies["typescript"]; if (!allowedTypescriptVersions.includes(version)) { @@ -170,7 +170,7 @@ var buildNodeTask = function (taskPath, outDir) { overrideTscPath = path.join(taskPath, "node_modules", "typescript"); console.log(`Detected Typescript version: ${version}`); } else if (devDeps >= 1) { - fail('The package.json should not contain dev dependencies. Move the dev dependencies into a package.json file under the Tests sub-folder. Offending package.json: ' + packageJsonPath); + fail('The package.json should not contain dev dependencies other than typescript. Move the dev dependencies into a package.json file under the Tests sub-folder. Offending package.json: ' + packageJsonPath); } run('npm install');