From f172ac6487c6f7865502e90c245d699cd0f43474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Jona=C5=A1?= Date: Wed, 16 Mar 2022 09:42:29 +0100 Subject: [PATCH] fix(linter): check for both nrwl/nx and eslint for terminal runs (#9340) --- packages/workspace/src/utils/runtime-lint-utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/workspace/src/utils/runtime-lint-utils.ts b/packages/workspace/src/utils/runtime-lint-utils.ts index c1dfbf18491ca..7763aa2e3bfa9 100644 --- a/packages/workspace/src/utils/runtime-lint-utils.ts +++ b/packages/workspace/src/utils/runtime-lint-utils.ts @@ -304,10 +304,14 @@ export function mapProjectGraphFiles( }; } +const ESLINT_REGEX = /node_modules.*\/eslint$/; +const NRWL_CLI_REGEX = /@nrwl\/cli\/lib\/run-cli\.js$/; + export function isTerminalRun(): boolean { return ( process.argv.length > 1 && - !!process.argv[1].match(/@nrwl\/cli\/lib\/run-cli\.js$/) + (!!process.argv[1].match(NRWL_CLI_REGEX) || + !!process.argv[1].match(ESLINT_REGEX)) ); }