@@ -6,6 +6,7 @@ import type {
66} from './packages/models/src/index.js' ;
77import axePlugin from './packages/plugin-axe/src/index.js' ;
88import coveragePlugin , {
9+ type CoveragePluginConfig ,
910 getNxCoveragePaths ,
1011} from './packages/plugin-coverage/src/index.js' ;
1112import eslintPlugin , {
@@ -174,17 +175,22 @@ export const eslintCoreConfigNx = async (
174175) : Promise < CoreConfig > => ( {
175176 plugins : [
176177 projectName
177- ? await eslintPlugin ( {
178- eslintrc : `packages/${ projectName } /eslint.config.js` ,
179- patterns : [ '.' ] ,
180- } )
181- : await eslintPlugin ( await eslintConfigFromAllNxProjects ( ) , {
182- artifacts : {
183- // We leverage Nx dependsOn to only run all lint targets before we run code-pushup
184- // generateArtifactsCommand: 'npx nx run-many -t lint',
185- artifactsPaths : [ 'packages/**/.eslint/eslint-report.json' ] ,
178+ ? await eslintPlugin (
179+ {
180+ eslintrc : `packages/${ projectName } /eslint.config.js` ,
181+ patterns : [ '.' ] ,
186182 } ,
187- } ) ,
183+ {
184+ artifacts : {
185+ // We leverage Nx dependsOn to only run all lint targets before we run code-pushup
186+ // generateArtifactsCommand: 'npx nx run-many -t lint',
187+ artifactsPaths : [
188+ `packages/${ projectName } /.eslint/eslint-report.json` ,
189+ ] ,
190+ } ,
191+ } ,
192+ )
193+ : await eslintPlugin ( await eslintConfigFromAllNxProjects ( ) ) ,
188194 ] ,
189195 categories : eslintCategories ,
190196} ) ;
@@ -199,21 +205,24 @@ export const typescriptPluginConfig = async (
199205export const coverageCoreConfigNx = async (
200206 projectName ?: string ,
201207) : Promise < CoreConfig > => {
202- const targetNames = [ 'unit-test' , 'int-test' ] ;
208+ const config : CoveragePluginConfig = projectName
209+ ? // We do not need to run a coverageToolCommand. This is handled over the Nx task graph.
210+ {
211+ reports : [
212+ {
213+ pathToProject : `packages/${ projectName } ` ,
214+ resultsPath : `packages/${ projectName } /coverage/lcov.info` ,
215+ } ,
216+ ] ,
217+ }
218+ : {
219+ reports : await getNxCoveragePaths ( [ 'unit-test' , 'int-test' ] ) ,
220+ coverageToolCommand : {
221+ command : 'npx nx run-many -t unit-test,int-test' ,
222+ } ,
223+ } ;
203224 return {
204- plugins : [
205- await coveragePlugin ( {
206- // We do not need to run a coverageToolCommand. This is handled over the Nx task graph.
207- reports : projectName
208- ? [
209- {
210- pathToProject : `packages/${ projectName } ` ,
211- resultsPath : `packages/${ projectName } /coverage/lcov.info` ,
212- } ,
213- ]
214- : await getNxCoveragePaths ( targetNames ) ,
215- } ) ,
216- ] ,
225+ plugins : [ await coveragePlugin ( config ) ] ,
217226 categories : coverageCategories ,
218227 } ;
219228} ;
0 commit comments