Skip to content

Commit 8d88965

Browse files
committed
accept baseline
1 parent 47f10b3 commit 8d88965

15 files changed

+1364
-15
lines changed

tests/baselines/reference/APISample_linter.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -75,28 +75,28 @@ function delint(sourceFile) {
7575
delintNode(sourceFile);
7676
function delintNode(node) {
7777
switch (node.kind) {
78-
case 187 /* ForStatement */:
79-
case 188 /* ForInStatement */:
80-
case 186 /* WhileStatement */:
81-
case 185 /* DoStatement */:
82-
if (node.statement.kind !== 180 /* Block */) {
78+
case 188 /* ForStatement */:
79+
case 189 /* ForInStatement */:
80+
case 187 /* WhileStatement */:
81+
case 186 /* DoStatement */:
82+
if (node.statement.kind !== 181 /* Block */) {
8383
report(node, "A looping statement's contents should be wrapped in a block body.");
8484
}
8585
break;
86-
case 184 /* IfStatement */:
86+
case 185 /* IfStatement */:
8787
var ifStatement = node;
88-
if (ifStatement.thenStatement.kind !== 180 /* Block */) {
88+
if (ifStatement.thenStatement.kind !== 181 /* Block */) {
8989
report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body.");
9090
}
9191
if (ifStatement.elseStatement &&
92-
ifStatement.elseStatement.kind !== 180 /* Block */ &&
93-
ifStatement.elseStatement.kind !== 184 /* IfStatement */) {
92+
ifStatement.elseStatement.kind !== 181 /* Block */ &&
93+
ifStatement.elseStatement.kind !== 185 /* IfStatement */) {
9494
report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body.");
9595
}
9696
break;
97-
case 170 /* BinaryExpression */:
97+
case 171 /* BinaryExpression */:
9898
var op = node.operatorToken.kind;
99-
if (op === 28 /* EqualsEqualsToken */ || op == 29 /* ExclamationEqualsToken */) {
99+
if (op === 29 /* EqualsEqualsToken */ || op == 30 /* ExclamationEqualsToken */) {
100100
report(node, "Use '===' and '!=='.");
101101
}
102102
break;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(2,15): error TS17005: JSX elements are not currently supported.
2+
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(4,6): error TS17005: JSX elements are not currently supported.
3+
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(6,1): error TS17005: JSX elements are not currently supported.
4+
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(8,1): error TS17005: JSX elements are not currently supported.
5+
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(10,1): error TS17005: JSX elements are not currently supported.
6+
tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx(12,1): error TS17005: JSX elements are not currently supported.
7+
8+
9+
==== tests/cases/conformance/jsx/jsxAndTypeAssertion.tsx (6 errors) ====
10+
11+
<any> { test: <any></any> };
12+
~~~~~~~~~~~
13+
!!! error TS17005: JSX elements are not currently supported.
14+
15+
<any><any></any>;
16+
~~~~~~~~~~~
17+
!!! error TS17005: JSX elements are not currently supported.
18+
19+
<foo>hello {<foo>{}} </foo>;
20+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
21+
!!! error TS17005: JSX elements are not currently supported.
22+
23+
<foo test={<foo>{}}>hello</foo>;
24+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25+
!!! error TS17005: JSX elements are not currently supported.
26+
27+
<foo test={<foo>{}}>hello{<foo>{}}</foo>;
28+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29+
!!! error TS17005: JSX elements are not currently supported.
30+
31+
<foo>{<foo><foo>{/foo/.test(x) ? <foo><foo></foo> : <foo><foo></foo>}</foo>}</foo>
32+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33+
!!! error TS17005: JSX elements are not currently supported.
34+
35+
36+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//// [jsxAndTypeAssertion.tsx]
2+
3+
<any> { test: <any></any> };
4+
5+
<any><any></any>;
6+
7+
<foo>hello {<foo>{}} </foo>;
8+
9+
<foo test={<foo>{}}>hello</foo>;
10+
11+
<foo test={<foo>{}}>hello{<foo>{}}</foo>;
12+
13+
<foo>{<foo><foo>{/foo/.test(x) ? <foo><foo></foo> : <foo><foo></foo>}</foo>}</foo>
14+
15+
16+
17+
18+
//// [jsxAndTypeAssertion.js]
19+
{ test: };
20+
;
21+
;
22+
;
23+
;
24+
;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
tests/cases/conformance/jsx/jsxClosingTagMapsRelaxingRules.tsx(1,4): error TS17002: Expected corresponding JSX closing tag for 'a'.
2+
tests/cases/conformance/jsx/jsxClosingTagMapsRelaxingRules.tsx(2,11): error TS17002: Expected corresponding JSX closing tag for 'a'.
3+
tests/cases/conformance/jsx/jsxClosingTagMapsRelaxingRules.tsx(3,12): error TS17002: Expected corresponding JSX closing tag for 'a'.
4+
5+
6+
==== tests/cases/conformance/jsx/jsxClosingTagMapsRelaxingRules.tsx (3 errors) ====
7+
<a></b>;
8+
~~~~
9+
!!! error TS17002: Expected corresponding JSX closing tag for 'a'.
10+
<a> foo {}</b>;
11+
~~~~
12+
!!! error TS17002: Expected corresponding JSX closing tag for 'a'.
13+
<a> foo bar</b>;
14+
~~~~
15+
!!! error TS17002: Expected corresponding JSX closing tag for 'a'.
16+
<MyElement.myProperty> Hello </
17+
MyElement.
18+
myProperty
19+
>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//// [jsxClosingTagMapsRelaxingRules.tsx]
2+
<a></b>;
3+
<a> foo {}</b>;
4+
<a> foo bar</b>;
5+
<MyElement.myProperty> Hello </
6+
MyElement.
7+
myProperty
8+
>
9+
10+
//// [jsxClosingTagMapsRelaxingRules.js]
11+
;
12+
;
13+
;
14+
;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(2,1): error TS17005: JSX elements are not currently supported.
2+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(8,1): error TS17005: JSX elements are not currently supported.
3+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(10,1): error TS17005: JSX elements are not currently supported.
4+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(11,1): error TS17005: JSX elements are not currently supported.
5+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(14,1): error TS17005: JSX elements are not currently supported.
6+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(16,1): error TS17005: JSX elements are not currently supported.
7+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(22,1): error TS17005: JSX elements are not currently supported.
8+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(24,1): error TS17005: JSX elements are not currently supported.
9+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(26,1): error TS17005: JSX elements are not currently supported.
10+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(28,1): error TS17005: JSX elements are not currently supported.
11+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(30,1): error TS17005: JSX elements are not currently supported.
12+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(32,1): error TS17005: JSX elements are not currently supported.
13+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(34,1): error TS17005: JSX elements are not currently supported.
14+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(36,1): error TS17005: JSX elements are not currently supported.
15+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(38,2): error TS17005: JSX elements are not currently supported.
16+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(38,13): error TS2304: Cannot find name 'x'.
17+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(40,1): error TS17005: JSX elements are not currently supported.
18+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(42,1): error TS17005: JSX elements are not currently supported.
19+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(44,1): error TS17005: JSX elements are not currently supported.
20+
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(46,1): error TS17005: JSX elements are not currently supported.
21+
22+
23+
==== tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx (20 errors) ====
24+
25+
<a />;
26+
~~~~~
27+
!!! error TS17005: JSX elements are not currently supported.
28+
29+
//<n:a n:v />; Namespace unsuported
30+
31+
//<a n:foo="bar"> {value} <b><c /></b></a>; Namespace unsuported
32+
33+
<a b={" "} c=" " d="&amp;" e="id=1&group=2" f="&#123456789" g="&#123*;" h="&#x;" />;
34+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35+
!!! error TS17005: JSX elements are not currently supported.
36+
37+
<a b="&notanentity;" />;
38+
~~~~~~~~~~~~~~~~~~~~~~~
39+
!!! error TS17005: JSX elements are not currently supported.
40+
<a
41+
~~
42+
/>;
43+
~~
44+
!!! error TS17005: JSX elements are not currently supported.
45+
46+
<日本語></日本語>;
47+
~~~~~~~~~~~
48+
!!! error TS17005: JSX elements are not currently supported.
49+
50+
<AbC_def
51+
~~~~~~~~
52+
test="&#x0026;&#38;">
53+
~~~~~~~~~~~~~~~~~~~~~~~
54+
bar
55+
~~~
56+
baz
57+
~~~
58+
</AbC_def>;
59+
~~~~~~~~~~
60+
!!! error TS17005: JSX elements are not currently supported.
61+
62+
<a b={x ? <c /> : <d />} />;
63+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
64+
!!! error TS17005: JSX elements are not currently supported.
65+
66+
<a>{}</a>;
67+
~~~~~~~~~
68+
!!! error TS17005: JSX elements are not currently supported.
69+
70+
<a>{/* this is a comment */}</a>;
71+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72+
!!! error TS17005: JSX elements are not currently supported.
73+
74+
<div>@test content</div>;
75+
~~~~~~~~~~~~~~~~~~~~~~~~
76+
!!! error TS17005: JSX elements are not currently supported.
77+
78+
<div><br />7x invalid-js-identifier</div>;
79+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80+
!!! error TS17005: JSX elements are not currently supported.
81+
82+
<LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />;
83+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84+
!!! error TS17005: JSX elements are not currently supported.
85+
86+
<a.b></a.b>;
87+
~~~~~~~~~~~
88+
!!! error TS17005: JSX elements are not currently supported.
89+
90+
<a.b.c></a.b.c>;
91+
~~~~~~~~~~~~~~~
92+
!!! error TS17005: JSX elements are not currently supported.
93+
94+
(<div />) < x;
95+
~~~~~~~
96+
!!! error TS17005: JSX elements are not currently supported.
97+
~
98+
!!! error TS2304: Cannot find name 'x'.
99+
100+
<div {...props} />;
101+
~~~~~~~~~~~~~~~~~~
102+
!!! error TS17005: JSX elements are not currently supported.
103+
104+
<div {...props} post="attribute" />;
105+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106+
!!! error TS17005: JSX elements are not currently supported.
107+
108+
<div pre="leading" pre2="attribute" {...props}></div>;
109+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110+
!!! error TS17005: JSX elements are not currently supported.
111+
112+
<a> </a>;
113+
~~~~~~~~~~~
114+
!!! error TS17005: JSX elements are not currently supported.
115+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
//// [jsxEsprimaFbTestSuite.tsx]
2+
3+
<a />;
4+
5+
//<n:a n:v />; Namespace unsuported
6+
7+
//<a n:foo="bar"> {value} <b><c /></b></a>; Namespace unsuported
8+
9+
<a b={" "} c=" " d="&amp;" e="id=1&group=2" f="&#123456789" g="&#123*;" h="&#x;" />;
10+
11+
<a b="&notanentity;" />;
12+
<a
13+
/>;
14+
15+
<日本語></日本語>;
16+
17+
<AbC_def
18+
test="&#x0026;&#38;">
19+
bar
20+
baz
21+
</AbC_def>;
22+
23+
<a b={x ? <c /> : <d />} />;
24+
25+
<a>{}</a>;
26+
27+
<a>{/* this is a comment */}</a>;
28+
29+
<div>@test content</div>;
30+
31+
<div><br />7x invalid-js-identifier</div>;
32+
33+
<LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />;
34+
35+
<a.b></a.b>;
36+
37+
<a.b.c></a.b.c>;
38+
39+
(<div />) < x;
40+
41+
<div {...props} />;
42+
43+
<div {...props} post="attribute" />;
44+
45+
<div pre="leading" pre2="attribute" {...props}></div>;
46+
47+
<a> </a>;
48+
49+
50+
//// [jsxEsprimaFbTestSuite.js]
51+
;
52+
//<n:a n:v />; Namespace unsuported
53+
//<a n:foo="bar"> {value} <b><c /></b></a>; Namespace unsuported
54+
;
55+
;
56+
;
57+
;
58+
;
59+
;
60+
;
61+
;
62+
;
63+
;
64+
;
65+
;
66+
;
67+
() < x;
68+
;
69+
;
70+
;
71+
;

0 commit comments

Comments
 (0)