Bug 38664: Move prettier options to .prettierrc.js

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2025-01-15 10:43:20 +01:00 committed by Katrin Fischer
parent c531081d86
commit 287cb328bc
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
4 changed files with 13 additions and 5 deletions

View File

@ -4,9 +4,18 @@ module.exports = {
tabWidth: 4,
useTabs: false,
overrides: [
{
files: ["*.js", "*.ts"],
options: {
trailingComma: "es5",
arrowParens: "avoid",
},
},
{
files: "*.vue",
options: {
trailingComma: "es5",
arrowParens: "avoid",
semi: false,
}
},

View File

@ -132,13 +132,12 @@ sub tidy_perl {
sub tidy_js {
my ($file) = @_;
run( command => sprintf q{yarn --silent run prettier --trailing-comma es5 --arrow-parens avoid --write %s}, $file );
run( command => sprintf q{yarn --silent run prettier --write %s}, $file );
}
sub tidy_vue {
my ($file) = @_;
run( command => sprintf
q{yarn --silent run prettier --trailing-comma es5 --semi false --arrow-parens avoid --write %s}, $file );
run( command => sprintf q{yarn --silent run prettier --write %s}, $file );
}
sub tidy_tt {

View File

@ -26,7 +26,7 @@ plan tests => scalar @js_files;
foreach my $filepath (@js_files) {
chomp $filepath;
my $tidy = qx{yarn --silent run prettier --trailing-comma es5 --arrow-parens avoid $filepath};
my $tidy = qx{yarn --silent run prettier $filepath};
my $content = read_file $filepath;
ok( $content eq $tidy, "$filepath should be kept tidy" );
}

View File

@ -25,7 +25,7 @@ plan tests => scalar @vue_files;
foreach my $filepath (@vue_files) {
chomp $filepath;
my $tidy = qx{yarn --silent run prettier --trailing-comma es5 --semi false --arrow-parens avoid $filepath};
my $tidy = qx{yarn --silent run prettier $filepath};
my $content = read_file $filepath;
ok( $content eq $tidy, "$filepath should be kept tidy" );
}