diff --git a/.prettierrc.js b/.prettierrc.js index ae5fe52c5f..9348b17f00 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -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, } }, diff --git a/misc/devel/tidy.pl b/misc/devel/tidy.pl index 74c6bf1285..43a34d3944 100755 --- a/misc/devel/tidy.pl +++ b/misc/devel/tidy.pl @@ -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 { diff --git a/xt/js_tidy.t b/xt/js_tidy.t index 3b4b348bb3..3cfedd1dca 100755 --- a/xt/js_tidy.t +++ b/xt/js_tidy.t @@ -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" ); } diff --git a/xt/vue_tidy.t b/xt/vue_tidy.t index e4b1f9a613..3b16c4b003 100755 --- a/xt/vue_tidy.t +++ b/xt/vue_tidy.t @@ -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" ); }