Skip to content

Commit f8fe031

Browse files
Check formatting and lint on pre-commit/pre-push steps
If failed, it should not push had users have to fix formatting and eslint errors by himself and re-try to commit/push
1 parent a2e7e68 commit f8fe031

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lint-staged.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const lintStagedConfig = {
22
// run formatting and linting on all supported file types
3-
"*.{js,json,md,ts,yaml,yml}": "npm run format:write",
4-
"*.{js,ts}": ["npm run lint:fix"],
3+
"*.{js,json,md,ts,yaml,yml}": "npm run format:check",
4+
"*.{js,ts}": ["npm run lint"],
55
};
66

77
export default lintStagedConfig;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"format": "prettier",
1010
"format:check": "npm run format -- --check ./",
1111
"format:write": "npm run format -- --write ./",
12-
"lint": "eslint ./",
12+
"lint": "eslint src/**/*.ts",
1313
"lint:fix": "npm run lint -- --fix",
1414
"prepare": "husky install",
1515
"test": "jest",
1616
"test:clearcache": "jest --clearCache",
17-
"test:coverage": "npm run test -- --coverage",
17+
"test:coverage": "npm run test -- --coverage --passWithNoTests",
1818
"test:watch": "npm run test -- --watch",
1919
"typecheck": "tsc",
2020
"validate": "npm run format:check && npm run lint && npm run test:coverage && npm run typecheck && npm run build"

0 commit comments

Comments
 (0)