38 lines
907 B
Markdown
38 lines
907 B
Markdown
# Install
|
|
```shell
|
|
npm install --save-dev prettier @severinkaderli/prettier-config
|
|
```
|
|
|
|
# Configure
|
|
Add the configuration in the `package.json` file:
|
|
```json
|
|
{
|
|
"prettier": "@severinkaderli/prettier-config"
|
|
}
|
|
```
|
|
|
|
# CI
|
|
The formatting can be checked using the following job in GitHub-compatible workflows.
|
|
|
|
```yaml
|
|
check-format:
|
|
name: Check formatting
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Add custom npm package registry
|
|
run: npm config set @severinkaderli:registry https://git.kaderli.dev/api/packages/severinkaderli/npm/
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Check formatting
|
|
run: npm run format:check
|
|
```
|