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

(lint-staged) Fix prettier error 'No parser could be inferred for file' using pnpm #34

Merged
merged 1 commit into from Feb 12, 2023

Conversation

carlesbarreda
Copy link
Contributor

Using pnpm as package manager, when commit an Astro template, prettier throw the error 'No parser could be inferred for file: ...'.

To reproduce you can create a new branch, install the packages with pnpm install, modify an Astro template (ex. src/pages/index.astro) and try to commit.

Adding the parameter --plugin-search-dir=. to prettier command in lint-staged section of package.json solved the problem for me. I found the solution in this comment for more details.

@satnaing
Copy link
Owner

It seems to be working fine on npm and yarn. Thanks for pointing this out.

@satnaing satnaing merged commit e49ca61 into satnaing:main Feb 12, 2023
@carlesbarreda carlesbarreda deleted the pnpm-prettier branch February 12, 2023 21:10
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.

None yet

2 participants