Skip to content

Commit 5c24708

Browse files
author
John Doe
committed
chore: refine preset
1 parent 4ee6001 commit 5c24708

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

code-pushup.preset.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ import eslintPlugin, {
1616
eslintConfigFromNxProject,
1717
} from './packages/plugin-eslint/src/index.js';
1818
import jsPackagesPlugin from './packages/plugin-js-packages/src/index.js';
19-
import jsDocsPlugin, {
20-
JsDocsPluginConfig,
21-
} from './packages/plugin-jsdocs/src/index.js';
19+
import jsDocsPlugin from './packages/plugin-jsdocs/src/index.js';
20+
import type { JsDocsPluginConfig } from './packages/plugin-jsdocs/src/index.js';
2221
import {
2322
PLUGIN_SLUG,
2423
groups,
@@ -65,11 +64,7 @@ export async function loadEnv(
6564
? { project: env.CP_PROJECT }
6665
: { project: projectName }),
6766
};
68-
return (
69-
uploadConfig.apiKey && {
70-
upload: uploadConfig,
71-
}
72-
);
67+
return uploadConfig.apiKey ? { upload: uploadConfig } : {};
7368
}
7469

7570
/**
@@ -221,11 +216,12 @@ export const eslintCoreConfigNx = async (
221216
projectName?: string,
222217
): Promise<CoreConfig> => ({
223218
plugins: [
224-
await eslintPlugin(
225-
await (projectName
226-
? eslintConfigFromNxProject(projectName)
227-
: eslintConfigFromAllNxProjects()),
228-
),
219+
projectName
220+
? await eslintPlugin({
221+
eslintrc: `packages/${projectName}/eslint.config.js`,
222+
patterns: ['.'],
223+
})
224+
: await eslintPlugin(await eslintConfigFromAllNxProjects()),
229225
],
230226
categories: eslintCategories,
231227
});
@@ -259,10 +255,14 @@ export const coverageCoreConfigNx = async (
259255
? ['nx', 'run-many', '-p', projectName, ...targetArgs]
260256
: ['nx', 'run-many', ...targetArgs],
261257
},
262-
reports: await getNxCoveragePaths({
263-
targets: targetNames,
264-
projects: projectName ? [projectName] : undefined,
265-
}),
258+
reports: projectName
259+
? [
260+
// Prefer Jest default dir; adjust if your project uses Vitest
261+
`packages/${projectName}/coverage/lcov.info`,
262+
]
263+
: await getNxCoveragePaths({
264+
targets: targetNames,
265+
}),
266266
}),
267267
],
268268
categories: coverageCategories,

0 commit comments

Comments
 (0)