Skip to content

Commit

Permalink
Add pre-commit configuration to run formatter automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
caro401 committed Dec 14, 2023
1 parent e80a732 commit 57aa266
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.1.0'
hooks:
- id: prettier
additional_dependencies:
- [email protected]
- [email protected]
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ This repository contains components to display data from `kiara`, and to help in

## Developing

Clone this repository using git. Install operating system dependenices [NodeJS](https://nodejs.org/) and npm, then.
Clone this repository using git. Install operating system dependenices [NodeJS](https://nodejs.org/) and npm, then:

```bash
npm install # install project dependencies, first time only
npm run dev
```

Alternatively, if you have the [`just`](https://github.com/casey/just) task runner installed, run `just setup`.

Everything inside `src/lib` is part of the component library, everything inside `src/routes` is the showcase or preview app.

Optionally (but please do if you can) there's a [pre-commit](https://pre-commit.com/) hook to check formatting before each commit. You'll need [pre-commit installed globally](https://pre-commit.com/#installation) on your machine, then run `pre-commit install` to enable the hook.

## Testing

The project is set up to enable "unit" testing via [vitest](https://vitest.dev/), and browser/UI testing via [playwright](https://playwright.dev/). Run the tests with:
Expand Down
1 change: 1 addition & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ setup:
npm --version
npm install
npx playwright install
pre-commit install

# Update all project dependencies
update-deps:
Expand Down

0 comments on commit 57aa266

Please sign in to comment.