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 doesn't work out-of-the-box #51

Closed
kaycebasques opened this issue Mar 25, 2023 · 2 comments
Closed

lint-staged doesn't work out-of-the-box #51

kaycebasques opened this issue Mar 25, 2023 · 2 comments

Comments

@kaycebasques
Copy link

kaycebasques commented Mar 25, 2023

Hi, great theme. When I went to set it up right now I got this error when trying to commit:

✔ Preparing lint-staged...
❯ Running tasks for staged files...
  ❯ package.json — 74 files
    ❯ * — 74 files
      ✖ prettier --plugin-search-dir=. --write [FAILED]
↓ Skipped because of errors from tasks. [SKIPPED]
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...

✖ prettier --plugin-search-dir=. --write:
[error] No parser could be inferred for file: public/assets/dev.svg
[error] No parser could be inferred for file: public/assets/logo.png
[error] No parser could be inferred for file: public/assets/logo.svg
[error] No parser could be inferred for file: public/astropaper-og.jpg
[error] No parser could be inferred for file: public/favicon.svg
[error] No parser could be inferred for file: public/robots.txt

I used npm create astro@latest -- --template satnaing/astro-paper because I'm on NPM 9.1.2. I installed into my current working directory (which was empty). I ran npm install after the install. Then I ran git add . and git commit -m 'Init AstroPaper blog' and that's when I got this error.

@floatingpurr
Copy link
Contributor

If you do not need to run prettier on public, you can simply remove it from the exceptions listed in .prettierignore. Otherwise, you can add in .prettierignore explicit ignore rules for extensions like svg or jpg. See this for more: #52 (comment)

@kaycebasques
Copy link
Author

Thanks again for the great theme. I think my solution was to just rip out all the prettier stuff, which I did before even filing this bug. I just figured we should get this documented.

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

No branches or pull requests

2 participants