-
Notifications
You must be signed in to change notification settings - Fork 29
/
lint-staged.config.js
63 lines (63 loc) · 3.09 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
module.exports = {
'*.md': ['prettier --write --parser markdown'],
'*.yaml': ['prettier --write --parser yaml'],
'*.graphql': ['prettier --write --parser graphql'],
'*.json': ['prettier --write --parser json'],
'*.mc.graphql': () => 'pnpm generate-types:mc',
'*.ctp.graphql': () => 'pnpm generate-types:ctp',
'*.settings.graphql': () => 'pnpm generate-types:settings',
'*.proxy.graphql': () => 'pnpm generate-types:proxy',
'*.{js,jsx}': [
'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.
'pnpm lint:js --reporters=jest-silent-reporter --onlyChanged',
],
'!(cypress)/**/*.{ts,tsx}': [
'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.
'pnpm lint:js --passWithNoTests --reporters=jest-silent-reporter --onlyChanged',
// Always include the `client.d.ts` file.
'tsc-files --noEmit packages/application-config/client.d.ts',
],
'cypress/**/*.ts': [
'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.
'pnpm lint:js --reporters=jest-silent-reporter --onlyChanged',
() => 'pnpm typecheck:cypress',
],
'*.css': [
'prettier --write --parser css',
// 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.
'pnpm lint:css --reporters=jest-silent-reporter --onlyChanged',
],
'packages/application-config/schema.json': () =>
'pnpm --filter @commercetools-frontend/application-config run build:schema',
};