-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Option to install Prettier plugins #22
Comments
Sounds cool, if you want you can create a PR for this! |
Parameterizing this might be beyond my ken, but I'll try to put something together and submit for your review. |
Can you provide me with step by step instructions what needs to be done to achieve this? |
Prettier plug-ins are installed like Prettier itself, so where you do that on Line 32 of entrypoint.sh, you'd need to add the plug-ins to the list of things to install, like
But I'm not sure whether you'd want to install all the official plugins, or how to best allow users to specify which plugins they want to install. 🤔 |
I think it would be best to let users specify which plugins they want to install.. |
@creyD @infotexture for sure, checked out the PR. It'd need to be something that ideally did a regex on another env variable such as... jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- name: Prettify code
uses: creyD/prettier_action@v3.1
with:
# You'd wanna ensure this worked out as a nice simple regex
# e.g (@prettier\/)+(plugin-[a-z\-]+)
plugins:
- plugin-xml |
oh damn, I forgot to change the issue to add regex (@prettier\/)+(plugin-[a-z\-]+) as suggested to ensure that the plugin could not "expand" out of this other than dashes and a-z chars. |
No need for the infotexture fork now that the upstream action repo has added support for Prettier plugins: - creyD/prettier_action#22 - creyD/prettier_action#34 - creyD/prettier_action#36 Signed-off-by: Roger Sheen <roger@infotexture.net>
I'd like to use this action on repos that include XML files, and format them with
@prettier/plugin-xml
.When I run the action as is, I get errors in the log:
This works fine when I run Prettier locally, as these options are provided by
plugin-xml
.Suggestion
💡 Add an option to that would allow users to specify the names of Prettier plugins to install.
I realize it would be possible to fork this action and hard-code additional plugins into the
# PROGRAM
section where Prettier itself is installed, but it seems like something that others might want to do too, so it might be best to support this here with an option instead.The text was updated successfully, but these errors were encountered: