Skip to content

Commit 67322e9

Browse files
committed
chore: Swaps madge for dpdm
The change to dpdm offers a more reliable check for circular deps. It's added to the lint staged file and runs on every tsup identified entry point. Resolves #11
1 parent d105d34 commit 67322e9

4 files changed

Lines changed: 68 additions & 512 deletions

File tree

.lintstagedrc.cjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
const json = require("./package.json");
2+
const circularChecks = Object.entries(json.tsup.entry).map(([k, path]) => {
3+
return path;
4+
});
5+
16
module.exports = {
27
"*.(md|json)": "prettier --write",
38
"package.json": [() => "syncpack format", "prettier --write"],
49
"**/*.ts?(x)": [
510
() => "pnpm test",
611
"eslint --fix",
7-
"madge --circular",
12+
() =>
13+
`dpdm --no-warning --no-tree --exit-code circular:1 ${circularChecks.join(
14+
" "
15+
)}`,
816
"prettier --write",
917
],
1018
};

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build": "run-s tsup 'verify:*'",
1212
"clean": "shx rm -rf dist && shx mkdir dist",
1313
"dev": "run-s watch",
14+
"dpdm": "dpdm",
1415
"lint": "eslint .",
1516
"lint-staged": "lint-staged",
1617
"prepare": "husky install",
@@ -100,14 +101,14 @@
100101
"@typescript-eslint/parser": "^5.23.0",
101102
"ava": "^4.3.0",
102103
"dotenv": "^16.0.1",
104+
"dpdm": "^3.10.0",
103105
"eslint": "^8.10.0",
104106
"eslint-config-prettier": "^8.5.0",
105107
"eslint-import-resolver-typescript": "^2.7.1",
106108
"eslint-plugin-import": "^2.26.0",
107109
"eslint-plugin-node": "^11.1.0",
108110
"husky": "^8.0.2",
109111
"lint-staged": "^12.1.3",
110-
"madge": "^5.0.1",
111112
"mongodb": "^4.7.0",
112113
"npm-run-all": "^4.1.5",
113114
"pg": "^8.7.3",

0 commit comments

Comments
 (0)