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

feat: add prettier to project #122

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions . prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.github/
*.config.js
.prettierrc.js
*.json
*.md
24 changes: 24 additions & 0 deletions README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image is not viewable in README.md, returns Invalid upstream response (403) when clicking on image link.

Also when I tried to follow the README instructions, I get the following error for the editor.defaultFormater property when trying to put "esbenp.prettier-vscode" as its value: Value is not accepted

  • Tried putting it in dart object
  • Tried putting it in settings.json object

Screenshot 2024-04-10 065831
Screenshot 2024-04-10 065852

Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,27 @@ Run Storybook in the project root
```
npm run storybook
```

## Prettier

Install dependencies if you have not done so already.

```
pnpm i
```

Search for and open `settings.json` by pressing `cmd+shift+p` on MacOS or `ctrl+shift+p` on Windows.

> [!IMPORTANT]
> There may be multiple options, ensure you select the option that says "Open User Settings (JSON)

![Screenshot of VS Code search results for "settings.json" with the User Settings JSON option highlighted.](https://media.cleanshot.cloud/media/29651/cu0AZRDB79fDcMFTlwKi2oflb6xJsE6bz6DDJkV0.png?Expires=1712733698&Signature=K2w6UFCuT4~IgJehpdMyyR~CXwIAG4HzXeNRT1eRVbmpaciBN3vCLG474LyW3o9lheLPVIUW7RhBcMxpXPJr7-uzr6j-~e4E6EGQ4TLyWGwJ2JBoNCf6kdNGF3Oul-YwtE73BO2jFnq3XX3kV9a88vK0FMel4WPVXrP9TjLLPE8VRuloNgxHP1vbFZe6-pi7Wn7t0x7je2hnjIef4FikKoKzJm5aC1JySAH-gnTqD9JrN-R01p3rBN6w92Tb~fQyopC0dqdxSagh88mPIZP9i~SDZD-aNnwSd~Yt85VuB0XbrCJWY6m20MXupLg-fAoeO9sDQ8Eb4ZZHzcv8V4WSVQ__&Key-Pair-Id=K269JMAT9ZF4GZ)

Add the following lines to your `settings.json`

```
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
```

Open a file and save it, you should see formatting changes made as soon as you save it!
Loading