diff --git a/_reformat-common.sh b/_reformat-common.sh index a104934..48eb75f 100644 --- a/_reformat-common.sh +++ b/_reformat-common.sh @@ -21,6 +21,10 @@ function sniff_file_type () { file_type="jsx" elif [[ $ff == *.tsx ]] ; then file_type="tsx" + elif [[ $ff == *.css ]] ; then + file_type="css" + elif [[ $ff == *.scss ]] ; then + file_type="scss" fi echo $file_type diff --git a/do-reformat.sh b/do-reformat.sh index c43ea2a..8eab590 100755 --- a/do-reformat.sh +++ b/do-reformat.sh @@ -18,7 +18,9 @@ if [[ $file_type == "javascript" || \ $file_type == "php" || \ $file_type == "html" || \ $file_type == "jsx" || \ - $file_type == "tsx" ]] ; then + $file_type == "tsx" || \ + $file_type == "css" || \ + $file_type == "scss" ]] ; then out=$(npx prettier --write $file) retval="$?" success_retval=0 diff --git a/would-reformat.sh b/would-reformat.sh index f9bb601..4d06f21 100755 --- a/would-reformat.sh +++ b/would-reformat.sh @@ -18,7 +18,9 @@ if [[ $file_type == "javascript" || \ $file_type == "php" || \ $file_type == "html" || \ $file_type == "jsx" || \ - $file_type == "tsx" ]] ; then + $file_type == "tsx" || \ + $file_type == "css" || \ + $file_type == "scss" ]] ; then out=$(npx prettier --check $file 2>&1 > /dev/null) retval="$?" success_retval=0