Skip to content

Commit 75528b7

Browse files
committedAug 13, 2024·
feat: update jsdoccomment, debug, devDeps.; fixes #1304
1 parent df55137 commit 75528b7

6 files changed

+1145
-1908
lines changed
 

‎docs/rules/require-hyphen-before-param-description.md

+8
Original file line numberDiff line numberDiff line change
@@ -277,5 +277,13 @@ function quux () {
277277
function main(argv) {
278278
};
279279
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "never"]
280+
281+
/**
282+
* @template {any} T - Arg 1
283+
* @template {string | number} K - Arg 2
284+
* @template {any} [R=(K extends keyof T ? T[K] : never)] - Arg 3 -> Errors here
285+
* @typedef {any} Test
286+
*/
287+
// "jsdoc/require-hyphen-before-param-description": ["error"|"warn", "always",{"tags":{"template":"always"}}]
280288
````
281289

‎package.json

+21-21
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"url": "http://gajus.com"
66
},
77
"dependencies": {
8-
"@es-joy/jsdoccomment": "~0.46.0",
8+
"@es-joy/jsdoccomment": "~0.48.0",
99
"are-docs-informative": "^0.0.2",
1010
"comment-parser": "1.4.1",
11-
"debug": "^4.3.5",
11+
"debug": "^4.3.6",
1212
"escape-string-regexp": "^4.0.0",
1313
"espree": "^10.1.0",
1414
"esquery": "^1.6.0",
@@ -20,31 +20,31 @@
2020
"description": "JSDoc linting rules for ESLint.",
2121
"devDependencies": {
2222
"@babel/cli": "^7.24.8",
23-
"@babel/core": "^7.24.9",
24-
"@babel/eslint-parser": "^7.24.8",
25-
"@babel/node": "^7.24.8",
23+
"@babel/core": "^7.25.2",
24+
"@babel/eslint-parser": "^7.25.1",
25+
"@babel/node": "^7.25.0",
2626
"@babel/plugin-syntax-class-properties": "^7.12.13",
27-
"@babel/plugin-transform-flow-strip-types": "^7.24.7",
28-
"@babel/preset-env": "^7.24.8",
27+
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
28+
"@babel/preset-env": "^7.25.3",
2929
"@es-joy/escodegen": "^3.5.1",
3030
"@es-joy/jsdoc-eslint-parser": "^0.21.1",
31-
"@hkdobrev/run-if-changed": "^0.3.1",
31+
"@hkdobrev/run-if-changed": "^0.6.0",
3232
"@semantic-release/commit-analyzer": "^13.0.0",
33-
"@semantic-release/github": "^10.1.0",
33+
"@semantic-release/github": "^10.1.4",
3434
"@semantic-release/npm": "^12.0.1",
35-
"@types/chai": "^4.3.16",
35+
"@types/chai": "^4.3.17",
3636
"@types/debug": "^4.1.12",
37-
"@types/eslint": "^8.56.10",
37+
"@types/eslint": "^9.6.0",
3838
"@types/espree": "^10.1.0",
3939
"@types/esquery": "^1.5.4",
4040
"@types/estree": "^1.0.5",
4141
"@types/json-schema": "^7.0.15",
4242
"@types/lodash.defaultsdeep": "^4.6.9",
4343
"@types/mocha": "^10.0.7",
44-
"@types/node": "^20.14.11",
44+
"@types/node": "^22.2.0",
4545
"@types/semver": "^7.5.8",
4646
"@types/spdx-expression-parse": "^3.0.5",
47-
"@typescript-eslint/types": "^7.16.1",
47+
"@typescript-eslint/types": "^8.1.0",
4848
"babel-plugin-add-module-exports": "^1.0.4",
4949
"babel-plugin-istanbul": "^7.0.0",
5050
"babel-plugin-transform-import-meta": "^2.2.1",
@@ -53,23 +53,23 @@
5353
"chai": "^5.1.1",
5454
"cross-env": "^7.0.3",
5555
"decamelize": "^6.0.0",
56-
"eslint": "9.7.0",
57-
"eslint-config-canonical": "~43.0.14",
56+
"eslint": "9.9.0",
57+
"eslint-config-canonical": "~43.0.15",
5858
"gitdown": "^4.1.1",
5959
"glob": "^10.4.2",
60-
"globals": "^15.8.0",
61-
"husky": "^9.1.1",
62-
"jsdoc-type-pratt-parser": "^4.0.0",
60+
"globals": "^15.9.0",
61+
"husky": "^9.1.4",
62+
"jsdoc-type-pratt-parser": "^4.1.0",
6363
"json-schema": "^0.4.0",
64-
"lint-staged": "^15.2.7",
64+
"lint-staged": "^15.2.9",
6565
"lodash.defaultsdeep": "^4.6.1",
66-
"mocha": "^10.6.0",
66+
"mocha": "^10.7.3",
6767
"open-editor": "^5.0.0",
6868
"replace": "^1.2.2",
6969
"rimraf": "^5.0.7",
7070
"semantic-release": "^24.0.0",
7171
"typescript": "5.5.x",
72-
"typescript-eslint": "^8.0.0-alpha.34"
72+
"typescript-eslint": "^8.1.0"
7373
},
7474
"engines": {
7575
"node": ">=18"

‎pnpm-lock.yaml

+1,091-1,883
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/getJsdocProcessorPlugin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const getLinesCols = (text) => {
8686
* @property {string} [exampleCodeRegex]
8787
* @property {string} [rejectExampleCodeRegex]
8888
* @property {"script"|"module"} [sourceType]
89-
* @property {import('eslint').Linter.FlatConfigParserModule} [parser]
89+
* @property {import('eslint').Linter.ESTreeParser|import('eslint').Linter.NonESTreeParser} [parser]
9090
*/
9191

9292
/**
@@ -486,7 +486,7 @@ export const getJsdocProcessorPlugin = (options = {}) => {
486486
// May be running a second time so catch and ignore
487487
try {
488488
ast = parser
489-
// @ts-expect-error Ok
489+
// @ts-expect-error Should be present
490490
? parser.parseForESLint(text, {
491491
ecmaVersion: 'latest',
492492
sourceType,

‎src/utils/hasReturnValue.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ const isNewPromiseExpression = (node) => {
2020
*/
2121
const isVoidPromise = (node) => {
2222
return /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (node)?.typeArguments?.params?.[0]?.type === 'TSVoidKeyword'
23-
/* c8 ignore next */
24-
|| /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (node)?.typeParameters?.params?.[0]?.type === 'TSVoidKeyword';
23+
/* c8 ignore next 4 */
24+
|| /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (
25+
node
26+
// @ts-expect-error Ok
27+
)?.typeParameters?.params?.[0]?.type === 'TSVoidKeyword';
2528
};
2629

2730
const undefinedKeywords = new Set([

‎test/rules/assertions/requireHyphenBeforeParamDescription.js

+18
Original file line numberDiff line numberDiff line change
@@ -591,5 +591,23 @@ export default {
591591
'never',
592592
],
593593
},
594+
{
595+
code: `
596+
/**
597+
* @template {any} T - Arg 1
598+
* @template {string | number} K - Arg 2
599+
* @template {any} [R=(K extends keyof T ? T[K] : never)] - Arg 3 -> Errors here
600+
* @typedef {any} Test
601+
*/
602+
`,
603+
options: [
604+
'always',
605+
{
606+
tags: {
607+
template: 'always'
608+
}
609+
}
610+
],
611+
},
594612
],
595613
};

0 commit comments

Comments
 (0)
Please sign in to comment.