Skip to content

check for node_modules and package.json instead of VCS#89

Open
Simomson wants to merge 2 commits intoprettier:mainfrom
Simomson:main
Open

check for node_modules and package.json instead of VCS#89
Simomson wants to merge 2 commits intoprettier:mainfrom
Simomson:main

Conversation

@Simomson
Copy link

Hi,

I also ran into the issue described in #80.

As suggested here, instead of searching for any VCS, we check for the first node_modules or a package.json

@43081j
Copy link
Collaborator

43081j commented Jan 26, 2026

i imagine the reason it checked for .git etc before is so you can run prettier against a non-js repo.

for example, you could run it globally (npm i -g prettier) against a repo of markdown docs, in which case there'd be no node_modules or package.json.

so i wonder if we should do both?

@Simomson
Copy link
Author

fair point, I didn't think of that.

I re-added the previous statements, so the PR is now just adding checks for node_modules and package.json

@43081j
Copy link
Collaborator

43081j commented Jan 26, 2026

@fabiospampinato can you also take a look at this?

2nd pair of eyes would be good but seems simple enough

@Dsaquel
Copy link

Dsaquel commented Feb 10, 2026

I ran into the same issue too,

Any update ? The fix looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants