Skip to content

Commit

Permalink
fix(linter): check for both nrwl/nx and eslint for terminal runs (#9340)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav authored and FrozenPandaz committed Mar 21, 2022
1 parent 0261e1f commit f172ac6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/workspace/src/utils/runtime-lint-utils.ts
Expand Up @@ -304,10 +304,14 @@ export function mapProjectGraphFiles<T>(
};
}

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))
);
}

Expand Down

0 comments on commit f172ac6

Please sign in to comment.