mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Toolkit: fix prettier error reporting (#21599)
This commit is contained in:
parent
d2b08c8368
commit
152059fec9
@ -87,7 +87,10 @@ export const prettierCheckPlugin = useSpinner<Fixable>('Prettier check', async (
|
||||
}
|
||||
})
|
||||
.then(newContents => {
|
||||
if (fix && newContents && newContents.length > 10) {
|
||||
if (newContents === undefined) {
|
||||
return true; // Nothing to fix
|
||||
} else if (fix) {
|
||||
if (newContents.length > 10) {
|
||||
return writeFile(path, newContents)
|
||||
.then(() => {
|
||||
console.log(`Fixed: ${path}`);
|
||||
@ -97,12 +100,10 @@ export const prettierCheckPlugin = useSpinner<Fixable>('Prettier check', async (
|
||||
console.log(`Error fixing ${path}`, error);
|
||||
return false;
|
||||
});
|
||||
} else if (fix) {
|
||||
console.log(`No automatic fix for: ${path}`);
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
console.log(`No automatic fix for: ${path}`);
|
||||
}
|
||||
return false;
|
||||
})
|
||||
.then(success => ({ path, success }))
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user