Bug 38664: Treat .vue files like other JS files
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
d659526b5a
commit
aa24f1e6d1
2 changed files with 2 additions and 19 deletions
|
@ -5,20 +5,12 @@ module.exports = {
|
||||||
useTabs: false,
|
useTabs: false,
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ["*.js", "*.ts"],
|
files: ["*.js", "*.ts", "*.vue"],
|
||||||
options: {
|
options: {
|
||||||
trailingComma: "es5",
|
trailingComma: "es5",
|
||||||
arrowParens: "avoid",
|
arrowParens: "avoid",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
files: "*.vue",
|
|
||||||
options: {
|
|
||||||
trailingComma: "es5",
|
|
||||||
arrowParens: "avoid",
|
|
||||||
semi: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
files: ["*.tt", "*.inc"],
|
files: ["*.tt", "*.inc"],
|
||||||
options: {
|
options: {
|
||||||
|
|
|
@ -98,8 +98,6 @@ sub tidy {
|
||||||
return tidy_perl($file);
|
return tidy_perl($file);
|
||||||
} elsif ( $filetype eq 'js' ) {
|
} elsif ( $filetype eq 'js' ) {
|
||||||
return tidy_js($file);
|
return tidy_js($file);
|
||||||
} elsif ( $filetype eq 'vue' ) {
|
|
||||||
return tidy_vue($file);
|
|
||||||
} elsif ( $filetype eq 'tt' ) {
|
} elsif ( $filetype eq 'tt' ) {
|
||||||
return tidy_tt($file);
|
return tidy_tt($file);
|
||||||
} else {
|
} else {
|
||||||
|
@ -144,12 +142,6 @@ sub tidy_js {
|
||||||
print qx{$cmd};
|
print qx{$cmd};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub tidy_vue {
|
|
||||||
my ($file) = @_;
|
|
||||||
my $cmd = sprintf q{yarn --silent run prettier %s%s}, ( $no_write ? '' : '--write ' ), $file;
|
|
||||||
print qx{$cmd};
|
|
||||||
}
|
|
||||||
|
|
||||||
sub tidy_tt {
|
sub tidy_tt {
|
||||||
my ($original_file) = @_;
|
my ($original_file) = @_;
|
||||||
my ( $success, $error_message, $full_buf, $stdout_buf, $stderr_buf );
|
my ( $success, $error_message, $full_buf, $stdout_buf, $stderr_buf );
|
||||||
|
@ -193,8 +185,7 @@ sub get_filetype {
|
||||||
return 'perl' if $file =~ m{^svc} || $file =~ m{^opac/svc};
|
return 'perl' if $file =~ m{^svc} || $file =~ m{^opac/svc};
|
||||||
return 'perl' if $file =~ m{\.pl$} || $file =~ m{\.pm} || $file =~ m{\.t$};
|
return 'perl' if $file =~ m{\.pl$} || $file =~ m{\.pm} || $file =~ m{\.t$};
|
||||||
|
|
||||||
return 'js' if $file =~ m{\.js$} || $file =~ m{\.ts$};
|
return 'js' if $file =~ m{\.js$} || $file =~ m{\.ts$} || $file =~ m{\.vue$};
|
||||||
return 'vue' if $file =~ m{\.vue$};
|
|
||||||
|
|
||||||
return 'tt' if $file =~ m{\.inc$} || $file =~ m{\.tt$};
|
return 'tt' if $file =~ m{\.inc$} || $file =~ m{\.tt$};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue