From 2183ca480b12b7bb18642bcba72f14a96bd2aaab Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sun, 14 Jun 2020 13:34:53 -0500 Subject: [PATCH 1/3] Recognize jsx and tsx --- _reformat-common.sh | 4 ++++ do-reformat.sh | 4 +++- would-reformat.sh | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/_reformat-common.sh b/_reformat-common.sh index a857a84..a104934 100644 --- a/_reformat-common.sh +++ b/_reformat-common.sh @@ -17,6 +17,10 @@ function sniff_file_type () { file_type="php" elif [[ $ff == *.html ]] ; then file_type="html" + elif [[ $ff == *.jsx ]] ; then + file_type="jsx" + elif [[ $ff == *.tsx ]] ; then + file_type="tsx" fi echo $file_type diff --git a/do-reformat.sh b/do-reformat.sh index 2eb4b83..c43ea2a 100755 --- a/do-reformat.sh +++ b/do-reformat.sh @@ -16,7 +16,9 @@ if [[ $file_type == "javascript" || \ $file_type == "css" || \ $file_type == "typescript" || \ $file_type == "php" || \ - $file_type == "html" ]] ; then + $file_type == "html" || \ + $file_type == "jsx" || \ + $file_type == "tsx" ]] ; then out=$(npx prettier --write $file) retval="$?" success_retval=0 diff --git a/would-reformat.sh b/would-reformat.sh index ad47cb2..f9bb601 100755 --- a/would-reformat.sh +++ b/would-reformat.sh @@ -16,7 +16,9 @@ if [[ $file_type == "javascript" || \ $file_type == "typescript" || \ $file_type == "css" || \ $file_type == "php" || \ - $file_type == "html" ]] ; then + $file_type == "html" || \ + $file_type == "jsx" || \ + $file_type == "tsx" ]] ; then out=$(npx prettier --check $file 2>&1 > /dev/null) retval="$?" success_retval=0 From 2e2508c4c6076beef769fb0a6abed01c67b78209 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sun, 5 Jul 2020 16:24:18 -0500 Subject: [PATCH 2/3] Add support for .css and .scss --- _reformat-common.sh | 4 ++++ do-reformat.sh | 4 +++- would-reformat.sh | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) 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 From 9843621f88afed5c6f936aff0ae8152660c00014 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Wed, 12 Aug 2020 18:48:24 +0000 Subject: [PATCH 3/3] Add LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b179f2a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Michael Wolf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.