Skip to content

Commit f9bf936

Browse files
committed
build: added husky and lint-staged
1 parent 48d3f61 commit f9bf936

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run precommit

package.json

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
{
22
"name": "salesforce-pubsub-api-client",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"type": "module",
55
"description": "A node client for the Salesforce Pub/Sub API",
6-
"main": "src/client.js",
7-
"scripts": {
8-
"prettier": "prettier --write '**/*.{css,html,js,json,md,yaml,yml}'",
9-
"lint": "eslint ."
10-
},
116
"author": "pozil",
127
"license": "CC0-1.0",
138
"homepage": "https://github.com/pozil/pub-sub-api-node-client",
14-
"repository": {
15-
"type": "git",
16-
"url": "git+https://github.com/pozil/pub-sub-api-node-client"
9+
"main": "src/client.js",
10+
"scripts": {
11+
"prettier": "prettier --write '**/*.{css,html,js,json,md,yaml,yml}'",
12+
"lint": "eslint .",
13+
"precommit": "lint-staged"
1714
},
1815
"dependencies": {
1916
"@grpc/grpc-js": "^1.8.0",
@@ -25,9 +22,23 @@
2522
"node-fetch": "^3.3.0"
2623
},
2724
"devDependencies": {
28-
"eslint": "^8.30.0",
25+
"eslint": "^8.31.0",
26+
"husky": "^8.0.3",
27+
"lint-staged": "^13.1.0",
2928
"prettier": "^2.8.1"
3029
},
30+
"lint-staged": {
31+
"**/*.{css,html,js,json,md,yaml,yml}": [
32+
"prettier --write"
33+
],
34+
"**/src/**/*.js": [
35+
"eslint"
36+
]
37+
},
38+
"repository": {
39+
"type": "git",
40+
"url": "git+https://github.com/pozil/pub-sub-api-node-client"
41+
},
3142
"volta": {
3243
"node": "18.12.1",
3344
"npm": "8.19.2"

0 commit comments

Comments
 (0)