Skip to content

Commit

Permalink
fix: correctly define quality:format so it can be cached
Browse files Browse the repository at this point in the history
  • Loading branch information
SimeonC committed Feb 6, 2024
1 parent 0f1bea0 commit 791d58f
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 61 deletions.
13 changes: 5 additions & 8 deletions packages/audit/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/audit/**/*.ts"]
}
},
"quality:format": {
"executor": "@tablecheck/nx:quality",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/audit/**/*.ts"],
"fix": true
},
"configurations": {
"format": {
"fix": true
}
}
}
},
Expand Down
12 changes: 5 additions & 7 deletions packages/commitlint-config/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/commitlint-config/index.js"]
}
},
"quality:format": {
"executor": "@tablecheck/nx:quality",
"options": {
"lintFilePatterns": ["packages/commitlint-config/index.js"],
"fix": true
},
"configurations": {
"format": {
"fix": true
}
}
}
},
Expand Down
12 changes: 5 additions & 7 deletions packages/eslint-config/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/eslint-config/**/*.ts"]
}
},
"quality:format": {
"executor": "@tablecheck/nx:quality",
"options": {
"lintFilePatterns": ["packages/eslint-config/**/*.ts"],
"fix": true
},
"configurations": {
"format": {
"fix": true
}
}
}
},
Expand Down
13 changes: 5 additions & 8 deletions packages/eslint-plugin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/eslint-plugin/**/*.ts"]
}
},
"quality:format": {
"executor": "@tablecheck/nx:quality",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/eslint-plugin/**/*.ts"],
"fix": true
},
"configurations": {
"format": {
"fix": true
}
}
},
"quality:docs": {
Expand Down
21 changes: 5 additions & 16 deletions packages/nx/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,11 @@
"packages/nx/generators.json",
"packages/nx/migrations.json"
]
}
},
"quality:format": {
"executor": "@tablecheck/nx:quality",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"packages/nx/src/*.ts",
"packages/nx/src/*/*.ts",
"packages/nx/src/*/*/*.ts",
"packages/nx/executors.json",
"packages/nx/package.json",
"packages/nx/generators.json",
"packages/nx/migrations.json"
],
"fix": true
},
"configurations": {
"format": {
"fix": true
}
}
}
},
Expand Down
12 changes: 5 additions & 7 deletions packages/nx/src/generators/quality/projectConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export function updateProjectConfig(tree: Tree, projectName: string) {
),
),
},
};
const lintFormatTarget = merge({}, lintTarget, {
options: {
fix: true,
configurations: {
format: {
fix: true,
},
},
});
};
try {
const projectConfig = readProjectConfiguration(tree, projectName);
updateProjectConfiguration(
Expand All @@ -41,7 +41,6 @@ export function updateProjectConfig(tree: Tree, projectName: string) {
merge(projectConfig, {
targets: {
quality: lintTarget,
'quality:format': lintFormatTarget,
},
}),
);
Expand All @@ -55,7 +54,6 @@ export function updateProjectConfig(tree: Tree, projectName: string) {
sourceRoot: 'src',
targets: {
quality: lintTarget,
'quality:format': lintFormatTarget,
},
});
}
Expand Down
13 changes: 5 additions & 8 deletions packages/semantic-release-config/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/semantic-release-config/index.js"]
}
},
"quality:format": {
"executor": "@tablecheck/nx:quality",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/semantic-release-config/index.js"],
"fix": true
},
"configurations": {
"format": {
"fix": true
}
}
}
},
Expand Down

0 comments on commit 791d58f

Please sign in to comment.