Skip to content

Commit 5d23d08

Browse files
committed
Add lint-staged
1 parent 2851981 commit 5d23d08

File tree

2 files changed

+345
-15
lines changed

2 files changed

+345
-15
lines changed

package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
],
1313
"scripts": {
1414
"lint": "eslint 'src/**/*.ts'",
15-
"lint-fix": "eslint 'src/**/*.ts' --fix",
15+
"lint:fix": "eslint 'src/**/*.ts' --fix",
1616
"clean": "rm -rf dist dts",
17-
"test": "npm run lint",
1817
"build": "tsc",
19-
"watch": "tsc --watch",
20-
"prepack": "npm run clean && npm run build",
18+
"build:watch": "tsc --watch",
19+
"prepack": "yarn clean && yarn build",
2120
"start": "node dist/index.js",
2221
"dev": "nodemon"
2322
},
@@ -29,6 +28,7 @@
2928
"eslint-config-xo": "^0.29.1",
3029
"eslint-config-xo-typescript": "^0.27.0",
3130
"husky": "^4.2.3",
31+
"lint-staged": "^10.5.3",
3232
"nodemon": "^2.0.2",
3333
"ts-node": "^8.8.1",
3434
"typescript": "^3.8.3"
@@ -51,9 +51,13 @@
5151
},
5252
"husky": {
5353
"hooks": {
54-
"pre-commit": "npm test && npm run build"
54+
"pre-commit": "lint-staged"
5555
}
5656
},
57-
"dependencies": {
58-
}
57+
"lint-staged": {
58+
"*.{js,ts,tsx}": [
59+
"xo --fix"
60+
]
61+
},
62+
"dependencies": {}
5963
}

0 commit comments

Comments
 (0)