Add support for tsx and jsx
This commit is contained in:
@@ -17,6 +17,10 @@ function sniff_file_type () {
|
|||||||
file_type="php"
|
file_type="php"
|
||||||
elif [[ $ff == *.html ]] ; then
|
elif [[ $ff == *.html ]] ; then
|
||||||
file_type="html"
|
file_type="html"
|
||||||
|
elif [[ $ff == *.jsx ]] ; then
|
||||||
|
file_type="jsx"
|
||||||
|
elif [[ $ff == *.tsx ]] ; then
|
||||||
|
file_type="tsx"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $file_type
|
echo $file_type
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ if [[ $file_type == "javascript" || \
|
|||||||
$file_type == "css" || \
|
$file_type == "css" || \
|
||||||
$file_type == "typescript" || \
|
$file_type == "typescript" || \
|
||||||
$file_type == "php" || \
|
$file_type == "php" || \
|
||||||
$file_type == "html" ]] ; then
|
$file_type == "html" || \
|
||||||
|
$file_type == "jsx" || \
|
||||||
|
$file_type == "tsx" ]] ; then
|
||||||
out=$(npx prettier --write $file)
|
out=$(npx prettier --write $file)
|
||||||
retval="$?"
|
retval="$?"
|
||||||
success_retval=0
|
success_retval=0
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ if [[ $file_type == "javascript" || \
|
|||||||
$file_type == "typescript" || \
|
$file_type == "typescript" || \
|
||||||
$file_type == "css" || \
|
$file_type == "css" || \
|
||||||
$file_type == "php" || \
|
$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)
|
out=$(npx prettier --check $file 2>&1 > /dev/null)
|
||||||
retval="$?"
|
retval="$?"
|
||||||
success_retval=0
|
success_retval=0
|
||||||
|
|||||||
Reference in New Issue
Block a user