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

chore: Update SETUP.md to include part about format on save #1306

Merged
merged 7 commits into from
Dec 19, 2024
Merged
Changes from all 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
23 changes: 23 additions & 0 deletions docs/development/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ VEDA-UI includes a GitHub action for checking TypeScript and lint errors. If you

Additionally, there's a pre-commit hook that performs the same error checks. This helps developers identify and address issues at an earlier stage. If you need to bypass the check (to make a local temporary commit etc.), include the `--no-verify`` flag in your commit command.

#### Format on Save
While the existing checks ensure that no linting errors are introduced into the main branch, enabling "Format on Save" in your code editor provides an additional layer of convenience. It helps catch formatting issues early in the development process, minimizing the risk of committing errors and ensuring consistent code style across the team.

##### How to Set Up Format on Save in VS Code
Install Required Extensions:

1. Install the ESLint extension ("dbaeumer.vscode-eslint").
2. Enable Format on Save in the settings (<kbd>⌘ Command</kbd> + <kbd>,</kbd> on macOS)
3. Configure Formatter Settings:
Ensure ESLint is set as the default formatter:
AliceR marked this conversation as resolved.
Show resolved Hide resolved

**Using Settings UI**: Open the Command Palette (<kbd>⌘ Command</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> on macOS), select Preferences: Open Settings (UI), search "default formatter," and select ESLint _dbaeumer.vscode-eslint_.
AliceR marked this conversation as resolved.
Show resolved Hide resolved

**Using JSON**: Open Preferences: Open User Settings (JSON) and add:
```json
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
```
Copy link
Collaborator

@sandrahoang686 sandrahoang686 Dec 18, 2024

Choose a reason for hiding this comment

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

was able to sortof follow.. following step 2, couldn't figure out where to add snippet so just opened command palette with cmd+shift+p and found Open User Settings (json) and then added snippet.

Also must be a small typo but i dont think json is meant to be after the "```"

5. Test the Configuration:
Make a change to any file in your project, save it, and verify that it is automatically formatted.

Note: The project contains a file `.vscode/settings.json.sample` with our recommended vscode settings.
To apply these settings to your workspace in VS Code, rename the file to `.vscode/settings.json` by removing the `.sample` extension.

AliceR marked this conversation as resolved.
Show resolved Hide resolved
### Conventional Commit

The title of any PR to `main` should follow [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/). This is to make sure the automatic versioning and release works seamlessly. Please give it a read to [its summary](https://www.conventionalcommits.org/en/v1.0.0/#summary) before making a PR.
Expand Down
Loading