Merge pull request #9393 from backstage/rugvip/lint-root

cli: make lint path output relative to repo root
This commit is contained in:
Patrik Oldsberg
2022-02-07 17:03:12 +01:00
committed by GitHub
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
The file path printed by the default lint formatter is now relative to the repository root, rather than the individual package.
+5
View File
@@ -32,6 +32,11 @@ export default async (cmd: Command, cmdArgs: string[]) => {
}
const formatter = await eslint.loadFormatter(cmd.format);
// This formatter uses the cwd to format file paths, so let's have that happen from the root instead
if (cmd.format === 'eslint-formatter-friendly') {
process.chdir(paths.targetRoot);
}
const resultText = formatter.format(results);
// If there is any feedback at all, we treat it as a lint failure. This should be