Skip to content

Commit dbde266

Browse files
authored
Merge pull request #259 from laravel/feat/prettier-plugin
Feat/prettier plugin
2 parents dce1b6b + ac1dbb7 commit dbde266

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/Fixers/LaravelBladeFixer.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ protected function applyFix(SplFileInfo $file, Tokens $tokens): void
6565
$result = app(Prettier::class)->run([$path]);
6666

6767
if ($result->failed()) {
68-
throw new PrettierException($result->errorOutput());
68+
$error = $result->errorOutput();
69+
70+
if (str($error)->startsWith('[error]') && str($error)->contains('SyntaxError:')) {
71+
$error = str($error)->after('SyntaxError: ')->before("\n")->value();
72+
}
73+
74+
throw new PrettierException($error);
6975
}
7076

7177
$tokens->setCode($result->output());

builds/pint

205 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)