Skip to content

Commit

Permalink
build: run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
satanTime committed Dec 5, 2020
1 parent a42629e commit 0f838b5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
23 changes: 0 additions & 23 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,14 @@ const path = require('path');

module.exports = {
'*': filenames => {
const commands = [];
const cwd = process.cwd();
const files = filenames
.filter(file => !file.match(/\.(ts)$/i))
.map(file => path.relative(cwd, file))
.map(file => `'${file}'`);
if (files.length === 0) {
return [];
}

commands.push(`prettier --write ${files.join(' ')}`);

return commands;
},
'*.ts': filenames => {
const commands = [];
const cwd = process.cwd();
const files = filenames.map(file => path.relative(cwd, file)).map(file => `'${file}'`);
if (files.length === 0) {
return [];
}

const filesForLint = filenames
.map(file => path.relative(cwd, file))
.filter(file => !file.match(/^e2e\//i))
.map(file => `'${file}'`);

commands.push(`prettier --write ${files.join(' ')}`);
if (filesForLint.length) {
commands.push(`npm run lint`);
}

return commands;
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-push": "npm run build && npm run test",
"pre-commit": "lint-staged && npm run lint && npm run ts:check",
"post-commit": "git update-index --again"
}
Expand Down

0 comments on commit 0f838b5

Please sign in to comment.