Skip to content

Commit 05ddc8f

Browse files
committed
Added prettier to common npm scripts
1 parent cf8a03c commit 05ddc8f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,13 +1511,15 @@ type DispatchProps = ReturnType<typeof mapDispatchToProps>;
15111511
## Common Npm Scripts
15121512
> Common TS-related npm scripts shared across projects
15131513
```
1514-
"ci-check": "npm run lint && npm run tsc && npm run test",
1514+
"prettier": "prettier --list-different 'src/**/*.ts' || (echo '\nPlease fix code formatting by running:\nnpm run prettier:fix\n'; exit 1)",
1515+
"prettier:fix": "prettier --write 'src/**/*.ts'",
15151516
"lint": "tslint -p ./",
15161517
"tsc": "tsc -p ./ --noEmit",
15171518
"tsc:watch": "tsc -p ./ --noEmit -w",
15181519
"test": "jest --config jest.config.json",
15191520
"test:watch": "jest --config jest.config.json --watch",
15201521
"test:update": "jest --config jest.config.json -u"
1522+
"ci-check": "npm run prettier && npm run lint && npm run tsc && npm run test",
15211523
```
15221524
15231525
[⇧ back to top](#table-of-contents)

README_SOURCE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,15 @@ type DispatchProps = ReturnType<typeof mapDispatchToProps>;
580580
## Common Npm Scripts
581581
> Common TS-related npm scripts shared across projects
582582
```
583-
"ci-check": "npm run lint && npm run tsc && npm run test",
583+
"prettier": "prettier --list-different 'src/**/*.ts' || (echo '\nPlease fix code formatting by running:\nnpm run prettier:fix\n'; exit 1)",
584+
"prettier:fix": "prettier --write 'src/**/*.ts'",
584585
"lint": "tslint -p ./",
585586
"tsc": "tsc -p ./ --noEmit",
586587
"tsc:watch": "tsc -p ./ --noEmit -w",
587588
"test": "jest --config jest.config.json",
588589
"test:watch": "jest --config jest.config.json --watch",
589590
"test:update": "jest --config jest.config.json -u"
591+
"ci-check": "npm run prettier && npm run lint && npm run tsc && npm run test",
590592
```
591593
592594
[⇧ back to top](#table-of-contents)

0 commit comments

Comments
 (0)