Workflow file: check-prettier-formatting-task.yml
Use Prettier to check formatting. Supported languages include:
- JavaScript
- TypeScript
- CSS
- HTML
- JSON
- Markdown
- YAML
This is the version of the workflow for projects using the Task task runner tool.
- [
Taskfile.yml
](assets/check-prettier-formatting-task/Taskfile.yml] - Formatting task.- Install to: repository root (or add the
general:format-prettier
task into the existingTaskfile.yml
)
- Install to: repository root (or add the
Prettier should be configured via a .prettierignore
file to ignore any externally maintained files contained in the repository:
https://prettier.io/docs/en/ignore.html
Support for additional languages can be added to Prettier via plugins: https://prettier.io/docs/en/plugins.html
Prettier automatically determines the language based on file name. In cases where it is not able to recognize a file, the parser can be specified in a .prettierrc.yml
configuration file:
https://prettier.io/docs/en/configuration.html#setting-the-parserdocsenoptionshtmlparser-option
The default Prettier code style is the official standardized style to be used in all Arduino tooling projects and should not be modified.
Markdown badge:
[](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/check-prettier-formatting-task.yml)
Replace the REPO_OWNER
and REPO_NAME
placeholders in the URLs with the final repository owner and name (example).
Asciidoc badge:
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-prettier-formatting-task.yml/badge.svg["Check Prettier Formatting status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-prettier-formatting-task.yml"]
Define the {repository-owner}
and {repository-name}
attributes and use them throughout the readme (example).
Add CI workflow to check for Prettier formatting compliance
On every push and pull request that affects relevant files, and periodically, check whether the formatting of supported
files is compliant with the Prettier style.
On every push and pull request that affects relevant files, and periodically, check whether the formatting of supported files is compliant with the [Prettier](https://prettier.io/docs/en/index.html) style.