Skip to content

Commit 41e1345

Browse files
committed
Test reporting jsdoc syntax errors
1 parent 2dd6627 commit 41e1345

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
tests/cases/conformance/jsdoc/foo.js(2,15): error TS1005: '}' expected.
2+
tests/cases/conformance/jsdoc/foo.js(3,19): error TS1005: '}' expected.
3+
tests/cases/conformance/jsdoc/foo.js(4,18): error TS1003: Identifier expected.
4+
tests/cases/conformance/jsdoc/foo.js(4,19): error TS1005: '}' expected.
5+
6+
7+
==== tests/cases/conformance/jsdoc/foo.js (4 errors) ====
8+
/**
9+
* @param {(x)=>void} x
10+
~~
11+
!!! error TS1005: '}' expected.
12+
* @param {typeof String} y
13+
~~~~~~
14+
!!! error TS1005: '}' expected.
15+
* @param {string & number} z
16+
17+
!!! error TS1003: Identifier expected.
18+
~
19+
!!! error TS1005: '}' expected.
20+
**/
21+
function foo(x, y, z) { }
22+
23+
==== tests/cases/conformance/jsdoc/skipped.js (0 errors) ====
24+
// @ts-nocheck
25+
/**
26+
* @param {(x)=>void} x
27+
* @param {typeof String} y
28+
* @param {string & number} z
29+
**/
30+
function bar(x, y, z) { }
31+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// @checkJs: true
2+
// @allowJs: true
3+
// @noEmit: true
4+
5+
// @Filename: foo.js
6+
/**
7+
* @param {(x)=>void} x
8+
* @param {typeof String} y
9+
* @param {string & number} z
10+
**/
11+
function foo(x, y, z) { }
12+
13+
// @Filename: skipped.js
14+
// @ts-nocheck
15+
/**
16+
* @param {(x)=>void} x
17+
* @param {typeof String} y
18+
* @param {string & number} z
19+
**/
20+
function bar(x, y, z) { }

0 commit comments

Comments
 (0)