Code Monkey home page Code Monkey logo

Comments (7)

johannbotha avatar johannbotha commented on July 20, 2024 5

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.

from prettier_action.

arthurfiorette avatar arthurfiorette commented on July 20, 2024 1

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.

from prettier_action.

schester44 avatar schester44 commented on July 20, 2024 1

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.

from prettier_action.

JuanDa237 avatar JuanDa237 commented on July 20, 2024 1

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.

from prettier_action.

creyD avatar creyD commented on July 20, 2024

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.

from prettier_action.

fschoenfeldt avatar fschoenfeldt commented on July 20, 2024

@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.

from prettier_action.

creyD avatar creyD commented on July 20, 2024

@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.

from prettier_action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.