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

prettier formatting not working with lint staged #51

Closed
thescientist13 opened this issue May 25, 2024 · 1 comment · Fixed by #112
Closed

prettier formatting not working with lint staged #51

thescientist13 opened this issue May 25, 2024 · 1 comment · Fixed by #112
Assignees
Labels
chore project maintenance related tasks

Comments

@thescientist13
Copy link
Member

thescientist13 commented May 25, 2024

Summary

Added Prettier formating in #24 which should be running Prettier on commit. However, as just recently observed in #50 , the build was failing on the npm run format:check task on the root level CONTRIBUTING.md

Run npm run format:check

> www.greenwoodjs.dev@0.0.1 format:check
> prettier . --check

Checking formatting...
[warn] CONTRIBUTING.md
[warn] Code style issues found in the above file. Run Prettier to fix.
Error: Process completed with exit code 1.

but that should already be running as this is what we have in our package.json right?

"lint-staged": {
  "*.js": "npm run lint:js",
  "*.css": "npm run lint:css",
  "**/*": "npm run lint:ls && npm run format"
}

Details

Can confirm that after running npm run format locally, the file showed up as having needed formatting. 🤷‍♂️

➜  www.greenwoodjs.dev git:(docs/issue-7-styling-contributing-docs) ✗ npm run format

> www.greenwoodjs.dev@0.0.1 format
> prettier . --write

.github/ISSUE_TEMPLATE.md 11ms (unchanged)
.github/PULL_REQUEST_TEMPLATE.md 2ms (unchanged)
.github/workflows/ci.yml 13ms (unchanged)
.ls-lint.yml 2ms (unchanged)
.prettierrc 17ms (unchanged)
.storybook/main.js 5ms (unchanged)
.storybook/preview.js 3ms (unchanged)
CONTRIBUTING.md 50ms. # <-- it got formatted!!
eslint.config.js 16ms (unchanged)
FEEDBACK.md 12ms (unchanged)
greenwood.config.js 1ms (unchanged)
package-lock.json 92ms (unchanged)
package.json 23ms (unchanged)
plugin-css-modules-bak.js 14ms (unchanged)
plugin-css-modules-log-bak.js 32ms (unchanged)
plugin-css-modules.js 11ms (unchanged)
README.md 4ms (unchanged)
@thescientist13 thescientist13 added good first issue Good for newcomers chore project maintenance related tasks labels May 25, 2024
@thescientist13 thescientist13 added question Further information is requested and removed question Further information is requested labels May 25, 2024
@thescientist13
Copy link
Member Author

maybe we should just bail on it as a pre-commit hook, and just run format in CI, then let developers choose when to deal with the formatting themselves?

@thescientist13 thescientist13 changed the title prettier formating not working with lint staged prettier formatting not working with lint staged Sep 5, 2024
@thescientist13 thescientist13 removed this from the Website Redesign and Relaunch milestone Sep 5, 2024
@thescientist13 thescientist13 removed the good first issue Good for newcomers label Oct 7, 2024
@DevLab2425 DevLab2425 self-assigned this Oct 14, 2024
@thescientist13 thescientist13 moved this from 📋 Backlog to 👀 In review in [Greenwood] Website Redesign and Relaunch Oct 15, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in [Greenwood] Website Redesign and Relaunch Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore project maintenance related tasks
Projects
Development

Successfully merging a pull request may close this issue.

2 participants