Skip to content
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] Use repo prettier configuration. #41

Open
Ayfri opened this issue Feb 21, 2021 · 7 comments
Open

[FEATURE] Use repo prettier configuration. #41

Ayfri opened this issue Feb 21, 2021 · 7 comments
Labels
enhancement New feature or request hacktoberfest

Comments

@Ayfri
Copy link

Ayfri commented Feb 21, 2021

What would you like to change about the program?
I would like to be able to use the repo prettier configuration, instead of putting it into the action configuration, if it is already possible, how can I do it?

Why do you think this is a cool idea?
Automate more the usage of this action.

@Ayfri Ayfri added the enhancement New feature or request label Feb 21, 2021
@creyD
Copy link
Owner

creyD commented Mar 1, 2021

That would be a good idea! We don't have this in place yet, I always do it via the prettier_options using your path --config app/.prettierrc parameter. But we could integrate this.

@fschoenfeldt
Copy link
Contributor

@creyD I don't want to hijack this request but I'm having a similar question regarding the use of the .prettierignore file. How do I pass it to the action? The --ignore-path "./.prettierignore" parameter doesn't seem to work because the action throws the following errors:

Error:  No parser could be inferred for file: x/y/assets/[email protected]
Error:  No parser could be inferred for file: x/y/assets/[email protected]
Error:  No parser could be inferred for file: x/y/assets/[email protected]
Error:  No parser could be inferred for file: x/y/assets/[email protected]

My prettierignore looks like this:

(...)
x/y/*.png
(...)

Workflow yaml:

      - name: Check Code Formatting
        uses: creyD/[email protected]
        with:
          # only_changed: true
          dry: true
          prettier_options: --write x/y/**/* --ignore-path "./.prettierignore"

As a workaround, I'll just add the filetypes to the --write parameter.

@arthurfiorette
Copy link

Oh, you are ignoring the .prettierignore file, that's why you are getting some problems about unknown file formats. remove the ignore-path flag and you're good to go.

@johannbotha
Copy link

I'm having a similar issue where it seems like this action isn't respecting my .prettierignore and .prettierrc files. What should the prettier_options be if I want Prettier to use those configurations? Assuming they are at the base of my repo.

@creyD
Copy link
Owner

creyD commented Jan 15, 2022

@johannbotha I suppose --ignore-path .prettierignore --config .prettierrc would be sufficient. But it would be very cool if we could include this in the future.

@schester44
Copy link

Taking this a step further, would it be possible to use the repo's installed version of prettier? Its easy for the prettier_version value to get out of sync with what is actually installed in the repo which can cause formatting differences.

@JuanDa237
Copy link
Contributor

I'v actually test it and it does.
And i check the entrypoint.sh and it is using repo config file. It just have to follow prettier docs indications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest
Projects
None yet
Development

No branches or pull requests

7 participants