Skip to content

Commit 47d178d

Browse files
committed
- Complete testing coverage; Update README
1 parent 92224ea commit 47d178d

File tree

3 files changed

+80
-8
lines changed

3 files changed

+80
-8
lines changed

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5648,6 +5648,14 @@ function b () {}
56485648
* @aCustomTag {anotherType|otherType} foo
56495649
*/
56505650
// Settings: {"jsdoc":{"structuredTags":{"aCustomTag":{"type":["otherType","anotherType"]}}}}
5651+
5652+
/**
5653+
* Bad types handled by `valid-types` instead.
5654+
* @param {str(} foo
5655+
*/
5656+
function quux (foo) {
5657+
5658+
}
56515659
````
56525660

56535661

@@ -9248,6 +9256,14 @@ class Test {
92489256
return this;
92499257
}
92509258
}
9259+
9260+
/**
9261+
* Bad types ignored here and handled instead by `valid-types`.
9262+
* @param {string(} foo - Bar.
9263+
*/
9264+
function quux(foo) {
9265+
9266+
}
92519267
````
92529268

92539269

@@ -19499,14 +19515,6 @@ function quux() {
1949919515
// Settings: {"jsdoc":{"structuredTags":{"see":{"name":"namepath-referencing","required":["name"]}}}}
1950019516
// Message: Syntax error in namepath: foo%
1950119517

19502-
/**
19503-
* @alias module:abc#event:foo-bar
19504-
*/
19505-
function quux() {
19506-
19507-
}
19508-
// Message: Syntax error in namepath: module:abc#event:foo-bar
19509-
1951019518
/**
1951119519
* @mixes module:namespace.SomeClass~
1951219520
*/

test/rules/assertions/checkTypes.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,31 @@ export default {
2323
},
2424
},
2525
},
26+
{
27+
code: `
28+
/**
29+
* @param {abc} foo
30+
*/
31+
function quux (foo) {
32+
33+
}
34+
`,
35+
errors: [
36+
{
37+
line: 1,
38+
message: 'Invalid `settings.jsdoc.preferredTypes`. Values must be falsy, a string, or an object.',
39+
},
40+
],
41+
ignoreReadme: true,
42+
settings: {
43+
jsdoc: {
44+
mode: 'permissive',
45+
preferredTypes: {
46+
abc: 100,
47+
},
48+
},
49+
},
50+
},
2651
{
2752
code: `
2853
/**
@@ -2631,5 +2656,16 @@ export default {
26312656
},
26322657
},
26332658
},
2659+
{
2660+
code: `
2661+
/**
2662+
* Bad types handled by \`valid-types\` instead.
2663+
* @param {str(} foo
2664+
*/
2665+
function quux (foo) {
2666+
2667+
}
2668+
`,
2669+
},
26342670
],
26352671
};

test/rules/assertions/noUndefinedTypes.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,5 +997,33 @@ export default {
997997
`,
998998
parser: require.resolve('@typescript-eslint/parser'),
999999
},
1000+
{
1001+
code: `
1002+
/**
1003+
* Bad types ignored here and handled instead by \`valid-types\`.
1004+
* @param {string(} foo - Bar.
1005+
*/
1006+
function quux(foo) {
1007+
1008+
}
1009+
`,
1010+
},
1011+
{
1012+
code: `
1013+
/**
1014+
* Bad types ignored here and handled instead by \`valid-types\`.
1015+
* @param {string(} foo - Bar.
1016+
*/
1017+
function quux(foo) {
1018+
1019+
}
1020+
`,
1021+
ignoreReadme: true,
1022+
settings: {
1023+
jsdoc: {
1024+
mode: 'permissive',
1025+
},
1026+
},
1027+
},
10001028
],
10011029
};

0 commit comments

Comments
 (0)