Skip to content

Commit e658cc4

Browse files
committed
chore: reconfigure husky; add linting for staged files; regenerate ToC on changes in README
1 parent 0f0a422 commit e658cc4

File tree

3 files changed

+508
-25
lines changed

3 files changed

+508
-25
lines changed

.huskyrc.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

package.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "In-memory MongoDB Server. Designed with testing in mind, the server will allow you to connect your favourite ODM or client library to the MongoDB Server and run integration tests isolated from each other.",
66
"repository": "https://github.com/nodkz/mongodb-memory-server",
77
"devDependencies": {
8+
"@commitlint/cli": "^9.1.2",
89
"@commitlint/config-conventional": "^9.1.2",
910
"@google/semantic-release-replace-plugin": "^1.0.0",
1011
"@semantic-release/changelog": "^5.0.1",
@@ -20,12 +21,14 @@
2021
"@typescript-eslint/parser": "4.1.0",
2122
"commitlint": "^9.1.2",
2223
"cross-env": "^7.0.2",
24+
"doctoc": "^1.4.0",
2325
"eslint": "7.8.1",
2426
"eslint-config-prettier": "6.11.0",
2527
"eslint-plugin-prettier": "3.1.4",
2628
"husky": "^4.3.0",
2729
"jest": "26.4.2",
2830
"lerna": "^3.22.1",
31+
"lint-staged": "^10.3.0",
2932
"mongodb": "3.6.1",
3033
"prettier": "2.1.1",
3134
"semantic-release": "^17.1.1",
@@ -37,14 +40,30 @@
3740
"packages/*"
3841
]
3942
},
43+
"lint-staged": {
44+
"packages/**/*.{ts,tsx,js,jsx}": [
45+
"eslint --fix",
46+
"git add"
47+
],
48+
"./README.md": [
49+
"doctoc ./README.md",
50+
"git add"
51+
]
52+
},
53+
"husky": {
54+
"hooks": {
55+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
56+
"pre-commit": "lint-staged"
57+
}
58+
},
4059
"scripts": {
4160
"test": "lerna run test --stream",
4261
"lint": "lerna run lint --stream --npm-client=yarn --no-prefix",
4362
"watch": "jest --env node --watch",
4463
"jest": "jest --env node",
4564
"build": "tsc --build tsconfig.build.json",
4665
"semantic-release": "semantic-release",
47-
"readme:toc": "npx doctoc ./README.md",
66+
"readme:toc": "doctoc ./README.md",
4867
"postinstall": "yarn build"
4968
}
5069
}

0 commit comments

Comments
 (0)