File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
packages/plugin-eslint/src/lib/runner Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,14 @@ import type { ESLintTarget } from '../config.js';
1313import { setupESLint } from '../setup.js' ;
1414import type { LinterOutput , RuleOptionsPerFile } from './types.js' ;
1515
16+ /**
17+ * Regex pattern to match ESLint report filename format with OS-agnostic path separators.
18+ * Matches: eslint-report.json or eslint-report-{number}.json
19+ * Handles both forward slashes (/) and backslashes (\) for cross-platform compatibility
20+ */
21+ export const ESLINT_REPORT_FILENAME_PATTERN =
22+ / - - o u t p u t - f i l e = " \. c o d e - p u s h u p [ / \\ ] e s l i n t [ / \\ ] e s l i n t - r e p o r t (?: - \d + ) ? \. j s o n " / ; // eslint-disable-line unicorn/better-regex
23+
1624export async function lint ( {
1725 eslintrc,
1826 patterns,
Original file line number Diff line number Diff line change @@ -2,16 +2,7 @@ import { ESLint, type Linter } from 'eslint';
22import { expect } from 'vitest' ;
33import { executeProcess } from '@code-pushup/utils' ;
44import type { ESLintPluginConfig } from '../config.js' ;
5- import { lint } from './lint.js' ;
6-
7- /**
8- * Regex pattern to match ESLint report filename format.
9- * Matches: eslint-report.json or eslint-report-{number}.json
10- * - No number: eslint-report.json (no dash)
11- * - With number: eslint-report-123.json (with dash and digits)
12- */
13- const ESLINT_REPORT_FILENAME_PATTERN =
14- / - - o u t p u t - f i l e = " \. c o d e - p u s h u p \/ e s l i n t \/ e s l i n t - r e p o r t (?: - \d + ) ? \. j s o n " / ;
5+ import { ESLINT_REPORT_FILENAME_PATTERN , lint } from './lint.js' ;
156
167class MockESLint {
178 calculateConfigForFile = vi . fn ( ) . mockImplementation (
You can’t perform that action at this time.
0 commit comments