Skip to content

Commit e0d287d

Browse files
committed
Bump to v1.0.6, bump vitest, mv {js,ts}config.json
After doing more research, it appears tsconfig.json is more broadly supported by editors and IDEs than jsconfig.json. For example, IntelliJ IDEA/WebStorm won't recognize it unless added to Settings > Editor > File Types > TypeScript. After switching, the @types/chai dependency actually caused a conflict; somehow the necessary types were found via vitest that weren't before. I also had to add "WebWorker" to "compilerOptions.lib" in tsconfig.json. Fixed the problems with vitest.config.js and ci/vitest.config.js such that the `// @ts-nocheck` directive is no longer necessary. Moved a bunch of compiler options from the `pnpm typecheck` script into tsconfig.json. Added the `rimraf` npm to make sure `pnpm prepack` generates a new `types/` directory without stale content. Bumped vitest to 1.2.0. Finally, it seems IntelliJ IDEA's JSDoc type checking is stronger than TypeScript and VSCode. Fixed a few JSDoc type parameters to eliminate warnings in IntelliJ as well.
1 parent 197d421 commit e0d287d

7 files changed

+334
-189
lines changed

ci/vitest.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// @ts-nocheck
21
import { defineConfig, mergeConfig } from 'vitest/config'
3-
import baseConfig from '../vitest.config'
2+
import baseConfig from '../vitest.config.js'
43

54
export default mergeConfig(baseConfig, defineConfig({
65
test: {

lib/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const INSTALL_HINT = 'Run \'pnpm add [-g|-D] jsdoc\' ' +
2424
* @param {EnvVars} env - environment variables, presumably process.env
2525
* @param {string} platform - the process.platform string
2626
* @returns {Promise<RunJsdocResults>} result of `jsdoc` execution
27-
* @throws if `jsdoc` isn't found or can't execute
27+
* @throws {(Error | string)} if `jsdoc` isn't found or can't execute
2828
*/
2929
export async function runJsdoc(argv, env, platform) {
3030
/** @type {string} */
@@ -72,7 +72,7 @@ export const pathKey = platform => platform !== 'win32' ? 'PATH' : 'Path'
7272
* @param {EnvVars} env - environment variables, presumably process.env
7373
* @param {string} platform - the process.platform string
7474
* @returns {Promise<string>} path to the command
75-
* @throws if `jsdoc` isn't found
75+
* @throws {string} if `jsdoc` isn't found
7676
*/
7777
export async function getPath(cmdName, env, platform) {
7878
const pk = pathKey(platform)
@@ -177,7 +177,7 @@ export async function analyzeArgv(argv) {
177177
* ```
178178
*
179179
* This function is necessary because the `jsdoc` command depends upon the
180-
* extremely popular strip-json-comments npm. Otherwise analyzeArgs() would
180+
* extremely popular strip-json-comments npm. Otherwise, analyzeArgs() would
181181
* choke on config.json files containing comments.
182182
*
183183
* This implementation was inspired by strip-json-comments, but is a completely
@@ -225,7 +225,7 @@ export function stripJsonComments(str) {
225225
* @param {string} dirname - current directory to search
226226
* @param {string} filename - name of file to find
227227
* @returns {Promise<string>} path to filename within dirname
228-
* @throws if filename not found
228+
* @throws {string} if filename not found
229229
*/
230230
export async function findFile(dirname, filename) {
231231
const childDirs = [dirname]

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsdoc-cli-wrapper",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "JSDoc command line interface wrapper",
55
"main": "index.js",
66
"bin": "./index.js",
@@ -9,9 +9,9 @@
99
"lint": "eslint --color --max-warnings 0 .",
1010
"test": "vitest",
1111
"test:ci": "pnpm lint && pnpm typecheck && vitest run -c ci/vitest.config.js && pnpm jsdoc",
12-
"typecheck": "npx -p typescript tsc -p jsconfig.json --noEmit --pretty",
1312
"jsdoc": "node index.js -c jsdoc.json .",
14-
"prepack": "npx -p typescript tsc ./index.js --allowJs --declaration --declarationMap --emitDeclarationOnly --outDir types"
13+
"typecheck": "npx tsc",
14+
"prepack": "npx rimraf types && npx tsc ./index.js --allowJs --declaration --declarationMap --emitDeclarationOnly --outDir types"
1515
},
1616
"files": [
1717
"lib/**",
@@ -25,23 +25,23 @@
2525
"license": "MPL-2.0",
2626
"type": "module",
2727
"engines": {
28-
"node": ">= 18.0.0"
28+
"node": ">=18.0.0"
2929
},
3030
"homepage": "https://github.com/mbland/jsdoc-cli-wrapper",
3131
"repository": "https://github.com/mbland/jsdoc-cli-wrapper",
3232
"bugs": "https://github.com/mbland/jsdoc-cli-wrapper/issues",
3333
"devDependencies": {
3434
"@stylistic/eslint-plugin-js": "^1.5.3",
35-
"@types/chai": "^4.3.11",
36-
"@types/node": "^20.10.7",
37-
"@vitest/coverage-istanbul": "^1.1.3",
38-
"@vitest/coverage-v8": "^1.1.3",
39-
"@vitest/ui": "^1.1.3",
35+
"@types/node": "^20.11.3",
36+
"@vitest/coverage-istanbul": "^1.2.0",
37+
"@vitest/coverage-v8": "^1.2.0",
38+
"@vitest/ui": "^1.2.0",
4039
"eslint": "^8.56.0",
4140
"eslint-plugin-jsdoc": "^46.10.1",
4241
"eslint-plugin-vitest": "^0.3.20",
4342
"jsdoc": "^4.0.2",
43+
"rimraf": "^5.0.5",
4444
"typescript": "^5.3.3",
45-
"vitest": "^1.1.3"
45+
"vitest": "^1.2.0"
4646
}
4747
}

0 commit comments

Comments
 (0)