Add Code Formatter Check!! Thoughts? #1162
Labels
enhancement 🚀
New feature or request or improvements on existing code.
github_actions
Pull requests that update GitHub Actions code
triage
This idea came through suggestions and discussion under this thread. https://github.com/Azure/vscode-aks-tools/pull/1161/files#r1912891247
I think given we have many contributors this could be a nice idea, hence sharing jsut for wider community thoughts. ❤
To use a TypeScript code formatter in a GitHub Actions workflow, a popular choice is Prettier, a widely adopted code formatter for TypeScript, JavaScript, and other languages. Here's how we can set it up:
Does anyone has any specific preference?
1. Add Prettier to Your Project
First, ensure Prettier is installed in our project:
Optionally, we can create a
.prettierrc
file to configure formatting preferences:2. Set Up Prettier Check in GitHub Actions
Create a GitHub Actions workflow to check formatting on pull requests or pushes. Add the following YAML file to
.github/workflows/format-check.yml
:3. Run the Workflow
Or we could add pre commit check like
Husky
Please feel free to add thoughts and Idea. Thanks.
The text was updated successfully, but these errors were encountered: