Harker Robotics apps use prettier to enforce a standardized code style across codebases. The @harker-robo/prettier-config NPM package defines the formatting rules.
Install prettier and the configuration package.
npm i --save-dev prettier @harker-robo/prettier-config
- Add the
prettierkey to package.json
- Add the formatting script to package.json.
// package.json
{
// ...
"scripts": {
// ...
"format": "npx prettier . -w"
}
}- Run the formatter.
npm run format
- Ignoring files
- GitHub integration
- Editor integration
- Overriding configuration (not recommended)