mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-12 19:30:30 +02:00
Fix #78
Fix https://github.com/creyD/prettier_action/issues/78 by updating the regex. I tested the regex but was not sure how to test the action. The regex should cover all three valid cases outlined here https://prettier.io/docs/en/plugins.html.
This commit is contained in:
@@ -59,7 +59,7 @@ if [ -n "$INPUT_PRETTIER_PLUGINS" ]; then
|
||||
for plugin in $INPUT_PRETTIER_PLUGINS; do
|
||||
echo "Checking plugin: $plugin"
|
||||
# check regex against @prettier/xyz
|
||||
if ! echo "$plugin" | grep -Eq '(@prettier\/)+(plugin-[a-z\-]+)'; then
|
||||
if ! echo "$plugin" | grep -Eq '(@prettier\/plugin-|(@[a-z\-]+\/)?prettier-plugin-){1}([a-z\-]+)'; then
|
||||
echo "$plugin does not seem to be a valid @prettier/plugin-x plugin. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user