Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typescript-estree): fix the issue of single run inferring in the pnpm repo (#3811) #8702

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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