Skip to content

Commit bd2a389

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

File tree

1 file changed

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

1 file changed

+16
-4
lines changed

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

Lines changed: 16 additions & 4 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-
const outputFile = path.join(outputDir, filename);
39+
4040
// running as CLI because ESLint#lintFiles() runs out of memory
4141
await executeProcess({
4242
command: 'npx',
@@ -45,18 +45,30 @@ async function executeLint({
4545
...(eslintrc ? [`--config=${filePathToCliArg(eslintrc)}`] : []),
4646
...(typeof eslintrc === 'object' ? ['--no-eslintrc'] : []),
4747
'--no-error-on-unmatched-pattern',
48-
'--format=json',
49-
`--output-file=${outputFile}`,
48+
`--format=${path.join(
49+
path.dirname(fileURLToPath(import.meta.url)),
50+
'../formatter/multiple-formats.js',
51+
)}`,
5052
...toArray(patterns).map(pattern =>
5153
// globs need to be escaped on Unix
5254
platform() === 'win32' ? pattern : `'${pattern}'`,
5355
),
5456
],
5557
ignoreExitCode: true,
5658
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+
},
5767
});
5868

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

6274
function loadRuleOptionsPerFile(

0 commit comments

Comments
 (0)