Skip to content

Commit b19f6f9

Browse files
lishaduckbrettz9
andauthored
fix: move to tsdown for proper types (#1447)
BREAKING CHANGE: Changes `exports` and build routine for proper types. * refactor: move to tsdown (take 2) * chore: remove unused devDeps. and fix generateRule script * fix bad rebase --------- Co-authored-by: Brett Zamir <[email protected]>
1 parent 43e7e6d commit b19f6f9

File tree

11 files changed

+1367
-1289
lines changed

11 files changed

+1367
-1289
lines changed

.npmignore

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

package.json

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
},
1919
"description": "JSDoc linting rules for ESLint.",
2020
"devDependencies": {
21-
"@babel/cli": "^7.27.2",
21+
"@arethetypeswrong/core": "^0.18.2",
2222
"@babel/core": "^7.27.4",
2323
"@babel/eslint-parser": "^7.27.5",
24-
"@babel/node": "^7.27.1",
2524
"@babel/plugin-syntax-class-properties": "^7.12.13",
2625
"@babel/plugin-transform-flow-strip-types": "^7.27.1",
2726
"@babel/preset-env": "^7.27.2",
@@ -63,11 +62,12 @@
6362
"lodash.defaultsdeep": "^4.6.1",
6463
"mocha": "^11.7.0",
6564
"open-editor": "^5.1.0",
66-
"replace": "^1.2.2",
67-
"rimraf": "^6.0.1",
65+
"publint": "^0.3.12",
6866
"semantic-release": "^24.2.5",
67+
"tsdown": "^0.13.4",
6968
"typescript": "5.8.3",
70-
"typescript-eslint": "^8.34.1"
69+
"typescript-eslint": "^8.34.1",
70+
"unplugin-unused": "^0.5.1"
7171
},
7272
"engines": {
7373
"node": ">=20.11.0"
@@ -82,25 +82,42 @@
8282
"*.js": "eslint --fix"
8383
},
8484
"type": "module",
85-
"main": "./dist/index.cjs",
86-
"types": "./dist/index.d.ts",
8785
"exports": {
8886
".": {
89-
"types": "./dist/index.d.ts",
90-
"import": "./src/index.js",
91-
"require": "./dist/index.cjs"
87+
"import": {
88+
"types": "./dist/index.d.ts",
89+
"default": "./dist/index.js"
90+
},
91+
"default": {
92+
"types": "./dist/index.d.cts",
93+
"default": "./dist/index.cjs"
94+
}
9295
},
9396
"./getJsdocProcessorPlugin.js": {
94-
"types": "./dist/getJsdocProcessorPlugin.d.ts",
95-
"import": "./dist/getJsdocProcessorPlugin.cjs",
96-
"require": "./src/getJsdocProcessorPlugin.js"
97+
"import": {
98+
"types": "./dist/getJsdocProcessorPlugin.d.ts",
99+
"default": "./dist/getJsdocProcessorPlugin.js"
100+
},
101+
"default": {
102+
"types": "./dist/getJsdocProcessorPlugin.d.cts",
103+
"default": "./dist/getJsdocProcessorPlugin.cjs"
104+
}
97105
},
98106
"./iterateJsdoc.js": {
99-
"types": "./dist/iterateJsdoc.d.ts",
100-
"import": "./dist/iterateJsdoc.cjs",
101-
"require": "./src/iterateJsdoc.js"
102-
}
107+
"import": {
108+
"types": "./dist/iterateJsdoc.d.ts",
109+
"default": "./dist/iterateJsdoc.js"
110+
},
111+
"default": {
112+
"types": "./dist/iterateJsdoc.d.cts",
113+
"default": "./dist/iterateJsdoc.cjs"
114+
}
115+
},
116+
"./package.json": "./package.json"
103117
},
118+
"files": [
119+
"dist/"
120+
],
104121
"name": "eslint-plugin-jsdoc",
105122
"mocha": {
106123
"reporter": "dot",
@@ -139,12 +156,11 @@
139156
},
140157
"scripts": {
141158
"tsc": "tsc",
142-
"tsc-build": "tsc -p tsconfig-prod.json",
143-
"build": "rimraf ./dist && NODE_ENV=production babel ./src --out-file-extension .cjs --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored && replace 'require\\(\"\\.(.*?)\\.[^.]*?\"\\)' 'require(\".$1.cjs\")' 'dist' -r --include=\"*.cjs\" && pnpm tsc-build",
144-
"check-docs": "babel-node ./src/bin/generateDocs.js --check",
145-
"create-docs": "pnpm run create-options && babel-node ./src/bin/generateDocs.js",
146-
"create-rule": "babel-node ./src/bin/generateRule.js",
147-
"create-options": "node ./src/bin/generateOptions.mjs",
159+
"build": "tsdown",
160+
"check-docs": "node ./src/bin/generateDocs.js --check",
161+
"create-docs": "pnpm run create-options && node ./src/bin/generateDocs.js",
162+
"create-rule": "node ./src/bin/generateRule.js",
163+
"create-options": "node ./src/bin/generateOptions.js",
148164
"install-offline": "pnpm install --prefer-offline --no-audit",
149165
"lint": "eslint",
150166
"lint-fix": "eslint --fix",

0 commit comments

Comments
 (0)