cli: make lint path output relative to repo root

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-02-07 15:58:35 +01:00
parent 0d1e74c068
commit 50a19ff8dd
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) => {
}
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