Coder Social home page Coder Social logo

Comments (11)

SchroederSteffen avatar SchroederSteffen commented on September 27, 2024 4

Facing the same issue. Wouldn't the straight-forward solution be that pretty-quick should only consider files inside the folder from which it's being called? (instead of the whole surrounding git repository)

from pretty-quick.

SukkaW avatar SukkaW commented on September 27, 2024 3

@SukkaW Thanks for your efforts here! I think we should align with prettier.

Under the hood it is the picomatch (which I introduced back in #180) that powers the micromatch. We could simply replace the ignore with the picomatch and the behavior should have be aligned then.

from pretty-quick.

andrei-ilyukovich avatar andrei-ilyukovich commented on September 27, 2024 2

@michael13491 I faced the same issue. It looks like prettier and pretty-quick treats .prettierignore file differently. Prettier try to apply ignore patterns against files relative to the current working directory (foo/test.js, index.js etc), but pretty-quick try to check file names relative to root of your repo (webapp/foo/test.js, webapp/index.js etc). I think that's why your patterns don't work for pretty-quick. I didn't check but something like that should work:

# ignore everything except foo dir
/*
!**/foo

Another option is to move .prettierignore to the root of your project (since pretty-quick apply root .prettierignore then one from working directory: docs ) but then content also should be updated slightly:

# ignore everything except foo dir
/*
!/webapp/foo

from pretty-quick.

SukkaW avatar SukkaW commented on September 27, 2024 2

I've observed something that could potentially be triggering the issue.

pretty-quick uses the ignore library to parse .prettierignore. Notably, the ignore library is specifically designed to comply with the gitignore specification.

prettier on the other hand, utilizes the micromatch library (which behaves differently than the gitignore specification) to parse the .prettierignore file.

from pretty-quick.

maheshsundaram avatar maheshsundaram commented on September 27, 2024

@andrei-ilyukovich you helped me resolve my problem, thank you! I was struggling to figure this out.

from pretty-quick.

flybayer avatar flybayer commented on September 27, 2024

This is also a significant problem for me, so switching to running prettier inside lint-staged for now

from pretty-quick.

soberich avatar soberich commented on September 27, 2024

Same here

from pretty-quick.

GalDayan avatar GalDayan commented on September 27, 2024

Same here

from pretty-quick.

andrewmclagan avatar andrewmclagan commented on September 27, 2024

Yeah cant use this with monorepo in this state

from pretty-quick.

JounQin avatar JounQin commented on September 27, 2024

A minimal but runnable online reproduction is required.

from pretty-quick.

JounQin avatar JounQin commented on September 27, 2024

@SukkaW Thanks for your efforts here! I think we should align with prettier.

from pretty-quick.

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.