-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathpre-commit.js
More file actions
28 lines (25 loc) · 1.09 KB
/
pre-commit.js
File metadata and controls
28 lines (25 loc) · 1.09 KB
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
const lintStaged = require("lint-staged");
async function preCommit() {
const success = await lintStaged({
config: {
"*.{ts,tsx}": [
"node ./common/scripts/copyright-linter.js --",
"node --max_old_space_size=4096 ./common/scripts/node_modules/eslint/bin/eslint.js --config ./common/scripts/eslint.autofix.config.js --ignore-pattern **/node_modules/** --fix",
"node ./common/scripts/node_modules/prettier --write --config ./.prettierrc --ignore-path ./.prettierignore",
"node --max_old_space_size=4096 ./common/scripts/node_modules/eslint/bin/eslint.js --config ./common/scripts/eslint.autofix.config.js --ignore-pattern **/node_modules/** --color",
],
"*.{md,json}": [
"node ./common/scripts/node_modules/prettier --write --config ./.prettierrc --ignore-path ./.prettierignore",
],
"*.{scss,css}": [
"node ./common/scripts/copyright-linter.js --",
"node ./common/scripts/node_modules/stylelint --fix --config ./.stylelintrc",
],
},
verbose: true,
});
if (!success) {
process.exit(1);
}
}
preCommit();