Skip to content

Commit

Permalink
fix(typescript-estree): fix the issue of single run inferring in the …
Browse files Browse the repository at this point in the history
…pnpm repo (typescript-eslint#3811)
  • Loading branch information
xqxian committed Mar 17, 2024
1 parent 3856c67 commit 0aa1098
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -35,11 +35,17 @@ export function inferSingleRun(options: TSESTreeOptions | undefined): boolean {

// Currently behind a flag while we gather real-world feedback
if (options.allowAutomaticSingleRunInference) {
const possibleEslintBinPaths = [
'node_modules/.bin/eslint', // npm or yarn repo
'node_modules/eslint/bin/eslint.js', // pnpm repo
];
if (
// Default to single runs for CI processes. CI=true is set by most CI providers by default.
process.env.CI === 'true' ||
// This will be true for invocations such as `npx eslint ...` and `./node_modules/.bin/eslint ...`
process.argv[1].endsWith(normalize('node_modules/.bin/eslint'))
possibleEslintBinPaths.some(path =>
process.argv[1].endsWith(normalize(path)),
)
) {
return true;
}
Expand Down

0 comments on commit 0aa1098

Please sign in to comment.