Skip to content

prettierignore not working correctly in mono repo project  #95

Open
@michael13491

Description

@michael13491

Hi,

I have an issue that is similar to #14

My project folder structure is:

root/
  .git
  webapp/
    package.json
    .prettierignore  
    index.js
    foo/
      test.js

.prettierignore contains:

# ignore everything except foo dir
/*
!/foo

My problem is that pretty-quick does not seem to read .prettierignore rule correctly.

When I run npx pretty-quick --check, it fails to find foo/test.js as changed file. However, when i run npx prettier --check "**/*.js", it will pick up foo/test.js

$ npx pretty-quick --check
�🔍  Finding changed files since git revision 77e111a.
�🎯  Found 0 changed files.
✅  Everything is awesome!

$ npx prettier --check "**/*.js"
Checking formatting...
foo\test.js
Code style issues found in the above file(s). Forgot to run Prettier?

If I remove the rules in .prettierignore, pretty-quick is able to pick up the changed files:

$ npx pretty-quick --check
�🎯  Finding changed files since git revision 77e111a.
�🎯  Found 2 changed files.
⛔️  Check failed: webapp/foo/test.js
⛔️  Check failed: webapp/index.js

So it seems to me that pretty-quick is not reading the ignore rules correctly or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions