Skip to content

Commit 7c2d615

Browse files
author
John Doe
committed
fix: wip
1 parent 961dd6b commit 7c2d615

File tree

1 file changed

+4
-16
lines changed
  • packages/plugin-eslint/src/lib/runner

1 file changed

+4
-16
lines changed

packages/plugin-eslint/src/lib/runner/lint.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function executeLint({
3636
const outputDir =
3737
providedOutputDir ?? path.join(DEFAULT_PERSIST_OUTPUT_DIR, 'eslint');
3838
const filename = `eslint-report-${++rotation}`;
39-
39+
const outputFile = path.join(outputDir, filename);
4040
// running as CLI because ESLint#lintFiles() runs out of memory
4141
await executeProcess({
4242
command: 'npx',
@@ -45,30 +45,18 @@ async function executeLint({
4545
...(eslintrc ? [`--config=${filePathToCliArg(eslintrc)}`] : []),
4646
...(typeof eslintrc === 'object' ? ['--no-eslintrc'] : []),
4747
'--no-error-on-unmatched-pattern',
48-
`--format=${path.join(
49-
path.dirname(fileURLToPath(import.meta.url)),
50-
'../formatter/multiple-formats.js',
51-
)}`,
48+
'--format=json',
49+
`--output-file=${outputFile}`,
5250
...toArray(patterns).map(pattern =>
5351
// globs need to be escaped on Unix
5452
platform() === 'win32' ? pattern : `'${pattern}'`,
5553
),
5654
],
5755
ignoreExitCode: true,
5856
cwd: process.cwd(),
59-
env: {
60-
ESLINT_FORMATTER_CONFIG: JSON.stringify({
61-
outputDir,
62-
filename,
63-
formats: ['json'], // Always write JSON to file for tracking
64-
terminal: 'stylish', // Always show stylish terminal output for DX
65-
}),
66-
},
6757
});
6858

69-
return readJsonFile<ESLint.LintResult[]>(
70-
path.join(outputDir, `${filename}.json`),
71-
);
59+
return readJsonFile<ESLint.LintResult[]>(outputFile);
7260
}
7361

7462
function loadRuleOptionsPerFile(

0 commit comments

Comments
 (0)