File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,19 +16,13 @@ Shared developer tools for [π-Base packages](https://github.com/pi-base?q=&type
1616
1717``` bash
1818$ npm install --save-dev @pi-base/dev
19+ $ npm set-script prepare " pi-base-dev prepare"
20+ $ npm run prepare
1921```
2022
21- ` pi-base-dev ` does not entirely encapsulate ` husky ` . You will probably also want to
22-
23- ``` bash
24- $ npm set-script prepare " husky install" && npm run prepare
25- ```
26-
27- See [ ` husky ` 's documentation] ( https://typicode.github.io/husky/#/ ) for more details.
28-
2923## Configuration
3024
31- ` @pi-base/dev ` exports a number of common config files
25+ ` @pi-base/dev ` exports a number of common base configurations
3226
3327``` javascript
3428// .eslintrc.js
Original file line number Diff line number Diff line change 2626 } )
2727
2828cli
29- . command ( 'lint- staged' )
29+ . command ( 'lint: staged' )
3030 . description ( 'Run linter on staged files' )
3131 . action ( ( ) => {
3232 npx ( 'lint-staged' )
3333 } )
3434
35+ cli
36+ . command ( 'lint:prepare' )
37+ . description ( 'Install lint hooks' )
38+ . action ( ( ) => {
39+ npx ( 'husky' , 'install' )
40+ } )
41+
3542cli
3643 . command ( 'lint:check' )
3744 . description ( 'Run linter' )
3845 . action ( ( ) => {
3946 npx ( 'eslint' , 'src/**/*.ts' , '*.js' )
4047 } )
4148
49+ cli
50+ . command ( 'test' )
51+ . description ( 'Run tests' )
52+ . action ( ( ) => {
53+ npx ( 'jest' )
54+ } )
55+
56+ cli
57+ . command ( 'test:cov' )
58+ . description ( 'Run tests with coverage' )
59+ . action ( ( ) => {
60+ npx ( 'jest' , '--coverage' )
61+ } )
62+
63+ cli
64+ . command ( 'test:cov' )
65+ . description ( 'Run tests in watch mode' )
66+ . action ( ( ) => {
67+ npx ( 'jest' , '--watchAll' )
68+ } )
69+
4270cli . parse ( process . argv )
4371
4472function npx ( cmd : string , ...args : string [ ] ) {
You can’t perform that action at this time.
0 commit comments