-
Notifications
You must be signed in to change notification settings - Fork 25
/
lint-staged.config.js
30 lines (30 loc) · 1.36 KB
/
lint-staged.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module.exports = {
'*.md': ['prettier --write --parser markdown'],
'*.yaml': ['prettier --write --parser yaml'],
'*.json': ['prettier --write --parser json'],
'*.js': [
'yarn prettier --write',
// NOTE: apparently if you pass some argument that is not a flag AFTER the `reporters`
// flag, jest does not seem correctly parse the arguments.
//
// No tests found related to files changed since last commit.
// Run Jest without `-o` or with `--all` to run all tests.
// Error: An error occurred while adding the reporter at path "/path/to/file".Reporter is not a constructor
//
// For that reason, we move the `--onlyChanged` flag next to it.
'yarn lint:js --reporters=jest-silent-reporter --onlyChanged',
],
'*.{ts,tsx}': [
'yarn prettier --write',
// NOTE: apparently if you pass some argument that is not a flag AFTER the `reporters`
// flag, jest does not seem correctly parse the arguments.
//
// No tests found related to files changed since last commit.
// Run Jest without `-o` or with `--all` to run all tests.
// Error: An error occurred while adding the reporter at path "/path/to/file".Reporter is not a constructor
//
// For that reason, we move the `--onlyChanged` flag next to it.
'yarn lint:js --reporters=jest-silent-reporter --onlyChanged',
'tsc-files --noEmit',
],
};