Skip to content

Commit 96dcdce

Browse files
committed
chore: update jsdoctypeparser
BREAKING CHANGE: 1. Adds spaces between union items per jsdoctypeparser update. 2. Removes JSDuck support (unions with "/" instead of "|") Also adds support in typescript mode for `readonly` and intersections (`X & Y`)
1 parent 5409f25 commit 96dcdce

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3469,23 +3469,23 @@ function quux () {
34693469
// Message: Invalid JSDoc @returns type "Number"; prefer: "number".
34703470

34713471
/**
3472-
* @param {(Number|string|Boolean)=} foo
3472+
* @param {(Number | string | Boolean)=} foo
34733473
*/
34743474
function quux (foo, bar, baz) {
34753475

34763476
}
34773477
// Message: Invalid JSDoc @param "foo" type "Number"; prefer: "number".
34783478

34793479
/**
3480-
* @param {Array.<Number|String>} foo
3480+
* @param {Array.<Number | String>} foo
34813481
*/
34823482
function quux (foo, bar, baz) {
34833483

34843484
}
34853485
// Message: Invalid JSDoc @param "foo" type "Number"; prefer: "number".
34863486

34873487
/**
3488-
* @param {(Number|String)[]} foo
3488+
* @param {(Number | String)[]} foo
34893489
*/
34903490
function quux (foo, bar, baz) {
34913491

@@ -3984,7 +3984,7 @@ function quux () {}
39843984
// Message: Invalid JSDoc @typedef "foo" type "object"; prefer: "Object<>".
39853985

39863986
/**
3987-
* @param {Array<number|undefined>} foo
3987+
* @param {Array<number | undefined>} foo
39883988
*/
39893989
function quux (foo) {
39903990

@@ -4015,7 +4015,7 @@ function quux (foo, bar, baz) {
40154015
}
40164016

40174017
/**
4018-
* @param {(number|string|boolean)=} foo
4018+
* @param {(number | string | boolean)=} foo
40194019
*/
40204020
function quux (foo, bar, baz) {
40214021

@@ -13558,10 +13558,10 @@ function quux() {
1355813558
// Message: Tag @type must have a type
1355913559
1356013560
/**
13561-
* @modifies {bar|foo<}
13561+
* @modifies {bar | foo<}
1356213562
*/
1356313563
function quux (foo, bar, baz) {}
13564-
// Message: Syntax error in type: bar|foo<
13564+
// Message: Syntax error in type: bar | foo<
1356513565
1356613566
/**
1356713567
* @private {BadTypeChecked<}
@@ -13771,17 +13771,17 @@ function quux() {
1377113771
// Settings: {"jsdoc":{"mode":"closure"}}
1377213772
1377313773
/**
13774-
* @typedef {number|string} UserDefinedType
13774+
* @typedef {number | string} UserDefinedType
1377513775
*/
1377613776
1377713777
/**
13778-
* @typedef {number|string}
13778+
* @typedef {number | string}
1377913779
*/
1378013780
let UserDefinedGCCType;
1378113781
// Settings: {"jsdoc":{"mode":"closure"}}
1378213782
1378313783
/**
13784-
* @modifies {foo|bar}
13784+
* @modifies {foo | bar}
1378513785
*/
1378613786
function quux (foo, bar, baz) {}
1378713787

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dependencies": {
88
"comment-parser": "^0.7.5",
99
"debug": "^4.1.1",
10-
"jsdoctypeparser": "^7.0.0",
10+
"jsdoctypeparser": "^8.0.0",
1111
"lodash": "^4.17.15",
1212
"regextras": "^0.7.1",
1313
"semver": "^7.3.2",

test/rules/assertions/checkTypes.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default {
104104
{
105105
code: `
106106
/**
107-
* @param {(Number|string|Boolean)=} foo
107+
* @param {(Number | string | Boolean)=} foo
108108
*/
109109
function quux (foo, bar, baz) {
110110
@@ -122,7 +122,7 @@ export default {
122122
],
123123
output: `
124124
/**
125-
* @param {(number|string|boolean)=} foo
125+
* @param {(number | string | boolean)=} foo
126126
*/
127127
function quux (foo, bar, baz) {
128128
@@ -132,7 +132,7 @@ export default {
132132
{
133133
code: `
134134
/**
135-
* @param {Array.<Number|String>} foo
135+
* @param {Array.<Number | String>} foo
136136
*/
137137
function quux (foo, bar, baz) {
138138
@@ -150,7 +150,7 @@ export default {
150150
],
151151
output: `
152152
/**
153-
* @param {Array.<number|string>} foo
153+
* @param {Array.<number | string>} foo
154154
*/
155155
function quux (foo, bar, baz) {
156156
@@ -160,7 +160,7 @@ export default {
160160
{
161161
code: `
162162
/**
163-
* @param {(Number|String)[]} foo
163+
* @param {(Number | String)[]} foo
164164
*/
165165
function quux (foo, bar, baz) {
166166
@@ -178,7 +178,7 @@ export default {
178178
],
179179
output: `
180180
/**
181-
* @param {(number|string)[]} foo
181+
* @param {(number | string)[]} foo
182182
*/
183183
function quux (foo, bar, baz) {
184184
@@ -1896,7 +1896,7 @@ export default {
18961896
{
18971897
code: `
18981898
/**
1899-
* @param {Array<number|undefined>} foo
1899+
* @param {Array<number | undefined>} foo
19001900
*/
19011901
function quux (foo) {
19021902
@@ -1909,7 +1909,7 @@ export default {
19091909
],
19101910
output: `
19111911
/**
1912-
* @param {(number|undefined)[]} foo
1912+
* @param {(number | undefined)[]} foo
19131913
*/
19141914
function quux (foo) {
19151915
@@ -1953,7 +1953,7 @@ export default {
19531953
{
19541954
code: `
19551955
/**
1956-
* @param {(number|string|boolean)=} foo
1956+
* @param {(number | string | boolean)=} foo
19571957
*/
19581958
function quux (foo, bar, baz) {
19591959

test/rules/assertions/validTypes.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,13 @@ export default {
253253
{
254254
code: `
255255
/**
256-
* @modifies {bar|foo<}
256+
* @modifies {bar | foo<}
257257
*/
258258
function quux (foo, bar, baz) {}
259259
`,
260260
errors: [
261261
{
262-
message: 'Syntax error in type: bar|foo<',
262+
message: 'Syntax error in type: bar | foo<',
263263
},
264264
],
265265
},
@@ -655,14 +655,14 @@ export default {
655655
{
656656
code: `
657657
/**
658-
* @typedef {number|string} UserDefinedType
658+
* @typedef {number | string} UserDefinedType
659659
*/
660660
`,
661661
},
662662
{
663663
code: `
664664
/**
665-
* @typedef {number|string}
665+
* @typedef {number | string}
666666
*/
667667
let UserDefinedGCCType;
668668
`,
@@ -675,7 +675,7 @@ export default {
675675
{
676676
code: `
677677
/**
678-
* @modifies {foo|bar}
678+
* @modifies {foo | bar}
679679
*/
680680
function quux (foo, bar, baz) {}
681681
`,

0 commit comments

Comments
 (0)