Skip to content

Commit a8e38cb

Browse files
committed
refactor: wip
1 parent 06f55a1 commit a8e38cb

File tree

20 files changed

+419
-97
lines changed

20 files changed

+419
-97
lines changed

code-pushup.preset.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import coveragePlugin, {
1111
} from './packages/plugin-coverage/src/index.js';
1212
import eslintPlugin, {
1313
eslintConfigFromAllNxProjects,
14+
eslintConfigFromNxProject,
1415
} from './packages/plugin-eslint/src/index.js';
1516
import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js';
1617
import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js';
@@ -43,18 +44,15 @@ export async function configureEslintPlugin(
4344
return {
4445
plugins: [
4546
projectName
46-
? await eslintPlugin(
47-
{ eslintrc: `packages/${projectName}/eslint.config.js` },
48-
{
49-
artifacts: {
50-
// We leverage Nx dependsOn to only run all lint targets before we run code-pushup
51-
// generateArtifactsCommand: 'npx nx run-many -t lint',
52-
artifactsPaths: [
53-
`packages/${projectName}/.eslint/eslint-report.json`,
54-
],
55-
},
47+
? await eslintPlugin(await eslintConfigFromNxProject(projectName), {
48+
artifacts: {
49+
// We leverage Nx dependsOn to only run all lint targets before we run code-pushup
50+
// generateArtifactsCommand: 'npx nx run-many -t lint',
51+
artifactsPaths: [
52+
`packages/${projectName}/.eslint/eslint-report.json`,
53+
],
5654
},
57-
)
55+
})
5856
: await eslintPlugin(await eslintConfigFromAllNxProjects()),
5957
],
6058
categories: [

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ import node from '@code-pushup/eslint-config/node.js';
77
import typescript from '@code-pushup/eslint-config/typescript.js';
88
import vitest from '@code-pushup/eslint-config/vitest.js';
99

10+
if (process.env['CP_DEBUG_ESLINT_IMPORTS'] === 'true') {
11+
// eslint-disable-next-line no-console
12+
console.log('[CP_DEBUG] Loaded root eslint.config.js', {
13+
typescriptLength: typescript.length,
14+
nodeLength: node.length,
15+
vitestLength: vitest.length,
16+
});
17+
}
18+
1019
export default tseslint.config(
1120
...typescript,
1221
...node,

0 commit comments

Comments
 (0)