diff --git a/packages/parser/tests/lib/__snapshots__/comments.ts.snap b/packages/parser/tests/lib/__snapshots__/comments.ts.snap
index b38806f8d63..d04a7d39a32 100644
--- a/packages/parser/tests/lib/__snapshots__/comments.ts.snap
+++ b/packages/parser/tests/lib/__snapshots__/comments.ts.snap
@@ -1171,7 +1171,7 @@ Object {
}
`;
-exports[`Comments fixtures/jsx-block-comment.src 1`] = `
+exports[`Comments fixtures/jsx-attr-and-text-with-url.src 1`] = `
Object {
"body": Array [
Object {
@@ -1188,7 +1188,7 @@ Object {
"line": 1,
},
},
- "name": "pure",
+ "name": "link",
"range": Array [
6,
10,
@@ -1196,234 +1196,174 @@ Object {
"type": "Identifier",
},
"init": Object {
- "async": false,
- "body": Object {
- "body": Array [
- Object {
- "argument": Object {
- "children": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 12,
- "line": 4,
- },
- "start": Object {
- "column": 13,
- "line": 3,
- },
- },
- "range": Array [
- 47,
- 60,
- ],
- "raw": "
- ",
- "type": "JSXText",
- "value": "
- ",
- },
- Object {
- "expression": Object {
- "loc": Object {
- "end": Object {
- "column": 24,
- "line": 4,
- },
- "start": Object {
- "column": 13,
- "line": 4,
- },
- },
- "range": Array [
- 61,
- 72,
- ],
- "type": "JSXEmptyExpression",
- },
- "loc": Object {
- "end": Object {
- "column": 25,
- "line": 4,
- },
- "start": Object {
- "column": 12,
- "line": 4,
- },
- },
- "range": Array [
- 60,
- 73,
- ],
- "type": "JSXExpressionContainer",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 8,
- "line": 5,
- },
- "start": Object {
- "column": 25,
- "line": 4,
- },
- },
- "range": Array [
- 73,
- 82,
- ],
- "raw": "
- ",
- "type": "JSXText",
- "value": "
- ",
- },
- ],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 5,
- },
- "start": Object {
- "column": 8,
- "line": 5,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 13,
- "line": 5,
- },
- "start": Object {
- "column": 10,
- "line": 5,
- },
- },
- "name": "Foo",
- "range": Array [
- 84,
- 87,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 82,
- 88,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 5,
- },
- "start": Object {
- "column": 8,
- "line": 3,
- },
- },
- "openingElement": Object {
- "attributes": Array [],
- "loc": Object {
- "end": Object {
- "column": 13,
- "line": 3,
- },
- "start": Object {
- "column": 8,
- "line": 3,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 12,
- "line": 3,
- },
- "start": Object {
- "column": 9,
- "line": 3,
- },
- },
- "name": "Foo",
- "range": Array [
- 43,
- 46,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 42,
- 47,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- },
- "range": Array [
- 42,
- 88,
- ],
- "type": "JSXElement",
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 61,
+ "line": 1,
},
- "loc": Object {
- "end": Object {
- "column": 6,
- "line": 6,
- },
- "start": Object {
- "column": 4,
- "line": 2,
- },
+ "start": Object {
+ "column": 43,
+ "line": 1,
},
- "range": Array [
- 25,
- 95,
- ],
- "type": "ReturnStatement",
},
- ],
+ "range": Array [
+ 43,
+ 61,
+ ],
+ "raw": "http://example.com",
+ "type": "JSXText",
+ "value": "http://example.com",
+ },
+ ],
+ "closingElement": Object {
"loc": Object {
"end": Object {
- "column": 1,
- "line": 7,
+ "column": 65,
+ "line": 1,
},
"start": Object {
- "column": 19,
+ "column": 61,
"line": 1,
},
},
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 64,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 63,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "range": Array [
+ 63,
+ 64,
+ ],
+ "type": "JSXIdentifier",
+ },
"range": Array [
- 19,
- 97,
+ 61,
+ 65,
],
- "type": "BlockStatement",
+ "type": "JSXClosingElement",
},
- "expression": false,
- "generator": false,
- "id": null,
"loc": Object {
"end": Object {
- "column": 1,
- "line": 7,
+ "column": 65,
+ "line": 1,
},
"start": Object {
- "column": 13,
+ "column": 14,
"line": 1,
},
},
- "params": Array [],
- "range": Array [
- 13,
- 97,
- ],
- "type": "ArrowFunctionExpression",
- },
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 7,
+ "openingElement": Object {
+ "attributes": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 17,
+ "line": 1,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 17,
+ "line": 1,
+ },
+ },
+ "name": "href",
+ "range": Array [
+ 17,
+ 21,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 17,
+ 42,
+ ],
+ "type": "JSXAttribute",
+ "value": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 22,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 22,
+ 42,
+ ],
+ "raw": "\\"http://example.com\\"",
+ "type": "Literal",
+ "value": "http://example.com",
+ },
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "range": Array [
+ 15,
+ 16,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 14,
+ 43,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 14,
+ 65,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 66,
+ "line": 1,
},
"start": Object {
"column": 6,
@@ -1432,7 +1372,7 @@ Object {
},
"range": Array [
6,
- 97,
+ 66,
],
"type": "VariableDeclarator",
},
@@ -1440,8 +1380,8 @@ Object {
"kind": "const",
"loc": Object {
"end": Object {
- "column": 1,
- "line": 7,
+ "column": 67,
+ "line": 1,
},
"start": Object {
"column": 0,
@@ -1450,35 +1390,16 @@ Object {
},
"range": Array [
0,
- 97,
+ 67,
],
"type": "VariableDeclaration",
},
],
- "comments": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 24,
- "line": 4,
- },
- "start": Object {
- "column": 13,
- "line": 4,
- },
- },
- "range": Array [
- 61,
- 72,
- ],
- "type": "Block",
- "value": "COMMENT",
- },
- ],
+ "comments": Array [],
"loc": Object {
"end": Object {
"column": 0,
- "line": 8,
+ "line": 2,
},
"start": Object {
"column": 0,
@@ -1487,7 +1408,7 @@ Object {
},
"range": Array [
0,
- 98,
+ 68,
],
"sourceType": "module",
"tokens": Array [
@@ -1525,7 +1446,7 @@ Object {
10,
],
"type": "Identifier",
- "value": "pure",
+ "value": "link",
},
Object {
"loc": Object {
@@ -1579,89 +1500,89 @@ Object {
15,
],
"type": "Punctuator",
- "value": ")",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 18,
+ "column": 16,
"line": 1,
},
"start": Object {
- "column": 16,
+ "column": 15,
"line": 1,
},
},
"range": Array [
+ 15,
16,
- 18,
],
- "type": "Punctuator",
- "value": "=>",
+ "type": "JSXIdentifier",
+ "value": "a",
},
Object {
"loc": Object {
"end": Object {
- "column": 20,
+ "column": 21,
"line": 1,
},
"start": Object {
- "column": 19,
+ "column": 17,
"line": 1,
},
},
"range": Array [
- 19,
- 20,
+ 17,
+ 21,
],
- "type": "Punctuator",
- "value": "{",
+ "type": "JSXIdentifier",
+ "value": "href",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 2,
+ "column": 22,
+ "line": 1,
},
"start": Object {
- "column": 4,
- "line": 2,
+ "column": 21,
+ "line": 1,
},
},
"range": Array [
- 25,
- 31,
+ 21,
+ 22,
],
- "type": "Keyword",
- "value": "return",
+ "type": "Punctuator",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 2,
+ "column": 42,
+ "line": 1,
},
"start": Object {
- "column": 11,
- "line": 2,
+ "column": 22,
+ "line": 1,
},
},
"range": Array [
- 32,
- 33,
+ 22,
+ 42,
],
- "type": "Punctuator",
- "value": "(",
+ "type": "JSXText",
+ "value": "\\"http://example.com\\"",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 3,
+ "column": 43,
+ "line": 1,
},
"start": Object {
- "column": 8,
- "line": 3,
+ "column": 42,
+ "line": 1,
},
},
"range": Array [
@@ -1669,186 +1590,94 @@ Object {
43,
],
"type": "Punctuator",
- "value": "<",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 3,
+ "column": 61,
+ "line": 1,
},
"start": Object {
- "column": 9,
- "line": 3,
+ "column": 43,
+ "line": 1,
},
},
"range": Array [
43,
- 46,
+ 61,
],
- "type": "JSXIdentifier",
- "value": "Foo",
+ "type": "JSXText",
+ "value": "http://example.com",
},
Object {
"loc": Object {
"end": Object {
- "column": 13,
- "line": 3,
+ "column": 62,
+ "line": 1,
},
"start": Object {
- "column": 12,
- "line": 3,
+ "column": 61,
+ "line": 1,
},
},
"range": Array [
- 46,
- 47,
+ 61,
+ 62,
],
"type": "Punctuator",
- "value": ">",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 4,
+ "column": 63,
+ "line": 1,
},
"start": Object {
- "column": 13,
- "line": 3,
+ "column": 62,
+ "line": 1,
},
},
"range": Array [
- 47,
- 60,
+ 62,
+ 63,
],
- "type": "JSXText",
- "value": "
- ",
+ "type": "Punctuator",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 13,
- "line": 4,
+ "column": 64,
+ "line": 1,
},
"start": Object {
- "column": 12,
- "line": 4,
- },
- },
- "range": Array [
- 60,
- 61,
- ],
- "type": "Punctuator",
- "value": "{",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 25,
- "line": 4,
- },
- "start": Object {
- "column": 24,
- "line": 4,
- },
- },
- "range": Array [
- 72,
- 73,
- ],
- "type": "Punctuator",
- "value": "}",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 8,
- "line": 5,
- },
- "start": Object {
- "column": 25,
- "line": 4,
- },
- },
- "range": Array [
- 73,
- 82,
- ],
- "type": "JSXText",
- "value": "
- ",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 9,
- "line": 5,
- },
- "start": Object {
- "column": 8,
- "line": 5,
- },
- },
- "range": Array [
- 82,
- 83,
- ],
- "type": "Punctuator",
- "value": "<",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 10,
- "line": 5,
- },
- "start": Object {
- "column": 9,
- "line": 5,
- },
- },
- "range": Array [
- 83,
- 84,
- ],
- "type": "Punctuator",
- "value": "/",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 13,
- "line": 5,
- },
- "start": Object {
- "column": 10,
- "line": 5,
+ "column": 63,
+ "line": 1,
},
},
"range": Array [
- 84,
- 87,
+ 63,
+ 64,
],
"type": "JSXIdentifier",
- "value": "Foo",
+ "value": "a",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 5,
+ "column": 65,
+ "line": 1,
},
"start": Object {
- "column": 13,
- "line": 5,
+ "column": 64,
+ "line": 1,
},
},
"range": Array [
- 87,
- 88,
+ 64,
+ 65,
],
"type": "Punctuator",
"value": ">",
@@ -1856,17 +1685,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 6,
+ "column": 66,
+ "line": 1,
},
"start": Object {
- "column": 4,
- "line": 6,
+ "column": 65,
+ "line": 1,
},
},
"range": Array [
- 93,
- 94,
+ 65,
+ 66,
],
"type": "Punctuator",
"value": ")",
@@ -1874,45 +1703,27 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 6,
+ "column": 67,
+ "line": 1,
},
"start": Object {
- "column": 5,
- "line": 6,
+ "column": 66,
+ "line": 1,
},
},
"range": Array [
- 94,
- 95,
+ 66,
+ 67,
],
"type": "Punctuator",
"value": ";",
},
- Object {
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 7,
- },
- "start": Object {
- "column": 0,
- "line": 7,
- },
- },
- "range": Array [
- 96,
- 97,
- ],
- "type": "Punctuator",
- "value": "}",
- },
],
"type": "Program",
}
`;
-exports[`Comments fixtures/jsx-comment-after-jsx.src 1`] = `
+exports[`Comments fixtures/jsx-block-comment.src 1`] = `
Object {
"body": Array [
Object {
@@ -1942,99 +1753,176 @@ Object {
"body": Array [
Object {
"argument": Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 19,
- "line": 3,
- },
- "start": Object {
- "column": 13,
- "line": 3,
- },
- },
- "name": Object {
+ "children": Array [
+ Object {
"loc": Object {
"end": Object {
- "column": 18,
- "line": 3,
+ "column": 12,
+ "line": 4,
},
"start": Object {
- "column": 15,
+ "column": 13,
"line": 3,
},
},
- "name": "Foo",
"range": Array [
- 49,
- 52,
+ 47,
+ 60,
],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 47,
- 53,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 19,
- "line": 3,
- },
- "start": Object {
- "column": 8,
- "line": 3,
+ "raw": "
+ ",
+ "type": "JSXText",
+ "value": "
+ ",
},
- },
- "openingElement": Object {
- "attributes": Array [],
- "loc": Object {
- "end": Object {
- "column": 13,
- "line": 3,
- },
- "start": Object {
- "column": 8,
- "line": 3,
+ Object {
+ "expression": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 24,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 61,
+ 72,
+ ],
+ "type": "JSXEmptyExpression",
},
- },
- "name": Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 3,
+ "column": 25,
+ "line": 4,
},
"start": Object {
- "column": 9,
- "line": 3,
+ "column": 12,
+ "line": 4,
},
},
- "name": "Foo",
"range": Array [
- 43,
- 46,
+ 60,
+ 73,
],
- "type": "JSXIdentifier",
+ "type": "JSXExpressionContainer",
},
- "range": Array [
- 42,
- 47,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- },
- "range": Array [
- 42,
- 53,
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 8,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 25,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 73,
+ 82,
+ ],
+ "raw": "
+ ",
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 13,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 10,
+ "line": 5,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 84,
+ 87,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 82,
+ 88,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 13,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 9,
+ "line": 3,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 43,
+ 46,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 42,
+ 47,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 42,
+ 88,
],
"type": "JSXElement",
},
"loc": Object {
"end": Object {
"column": 6,
- "line": 4,
+ "line": 6,
},
"start": Object {
"column": 4,
@@ -2043,7 +1931,7 @@ Object {
},
"range": Array [
25,
- 67,
+ 95,
],
"type": "ReturnStatement",
},
@@ -2051,7 +1939,7 @@ Object {
"loc": Object {
"end": Object {
"column": 1,
- "line": 5,
+ "line": 7,
},
"start": Object {
"column": 19,
@@ -2060,7 +1948,7 @@ Object {
},
"range": Array [
19,
- 69,
+ 97,
],
"type": "BlockStatement",
},
@@ -2070,7 +1958,7 @@ Object {
"loc": Object {
"end": Object {
"column": 1,
- "line": 5,
+ "line": 7,
},
"start": Object {
"column": 13,
@@ -2080,14 +1968,14 @@ Object {
"params": Array [],
"range": Array [
13,
- 69,
+ 97,
],
"type": "ArrowFunctionExpression",
},
"loc": Object {
"end": Object {
"column": 1,
- "line": 5,
+ "line": 7,
},
"start": Object {
"column": 6,
@@ -2096,7 +1984,7 @@ Object {
},
"range": Array [
6,
- 69,
+ 97,
],
"type": "VariableDeclarator",
},
@@ -2105,7 +1993,7 @@ Object {
"loc": Object {
"end": Object {
"column": 1,
- "line": 5,
+ "line": 7,
},
"start": Object {
"column": 0,
@@ -2114,7 +2002,7 @@ Object {
},
"range": Array [
0,
- 69,
+ 97,
],
"type": "VariableDeclaration",
},
@@ -2123,26 +2011,26 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 26,
- "line": 3,
+ "column": 24,
+ "line": 4,
},
"start": Object {
- "column": 20,
- "line": 3,
+ "column": 13,
+ "line": 4,
},
},
"range": Array [
- 54,
- 60,
+ 61,
+ 72,
],
- "type": "Line",
- "value": " Foo",
+ "type": "Block",
+ "value": "COMMENT",
},
],
"loc": Object {
"end": Object {
"column": 0,
- "line": 6,
+ "line": 8,
},
"start": Object {
"column": 0,
@@ -2151,7 +2039,7 @@ Object {
},
"range": Array [
0,
- 70,
+ 98,
],
"sourceType": "module",
"tokens": Array [
@@ -2374,8 +2262,8 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 3,
+ "column": 12,
+ "line": 4,
},
"start": Object {
"column": 13,
@@ -2384,131 +2272,205 @@ Object {
},
"range": Array [
47,
- 48,
+ 60,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "JSXText",
+ "value": "
+ ",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 3,
+ "column": 13,
+ "line": 4,
},
"start": Object {
- "column": 14,
- "line": 3,
+ "column": 12,
+ "line": 4,
},
},
"range": Array [
- 48,
- 49,
+ 60,
+ 61,
],
"type": "Punctuator",
- "value": "/",
+ "value": "{",
},
Object {
"loc": Object {
"end": Object {
- "column": 18,
- "line": 3,
+ "column": 25,
+ "line": 4,
},
"start": Object {
- "column": 15,
- "line": 3,
+ "column": 24,
+ "line": 4,
},
},
"range": Array [
- 49,
- 52,
+ 72,
+ 73,
],
- "type": "JSXIdentifier",
- "value": "Foo",
+ "type": "Punctuator",
+ "value": "}",
},
Object {
"loc": Object {
"end": Object {
- "column": 19,
- "line": 3,
+ "column": 8,
+ "line": 5,
},
"start": Object {
- "column": 18,
- "line": 3,
+ "column": 25,
+ "line": 4,
},
},
"range": Array [
- 52,
- 53,
+ 73,
+ 82,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "JSXText",
+ "value": "
+ ",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 4,
+ "column": 9,
+ "line": 5,
},
"start": Object {
- "column": 4,
- "line": 4,
+ "column": 8,
+ "line": 5,
},
},
"range": Array [
- 65,
- 66,
+ 82,
+ 83,
],
"type": "Punctuator",
- "value": ")",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 4,
+ "column": 10,
+ "line": 5,
},
"start": Object {
- "column": 5,
- "line": 4,
+ "column": 9,
+ "line": 5,
},
},
"range": Array [
- 66,
- 67,
+ 83,
+ 84,
],
"type": "Punctuator",
- "value": ";",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 1,
+ "column": 13,
"line": 5,
},
"start": Object {
- "column": 0,
+ "column": 10,
"line": 5,
},
},
"range": Array [
- 68,
- 69,
+ 84,
+ 87,
],
- "type": "Punctuator",
- "value": "}",
+ "type": "JSXIdentifier",
+ "value": "Foo",
},
- ],
- "type": "Program",
-}
-`;
-
-exports[`Comments fixtures/jsx-comment-after-self-closing-jsx.src 1`] = `
-Object {
- "body": Array [
Object {
- "declarations": Array [
- Object {
- "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 87,
+ 88,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 93,
+ 94,
+ ],
+ "type": "Punctuator",
+ "value": ")",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 6,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 94,
+ 95,
+ ],
+ "type": "Punctuator",
+ "value": ";",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 7,
+ },
+ },
+ "range": Array [
+ 96,
+ 97,
+ ],
+ "type": "Punctuator",
+ "value": "}",
+ },
+ ],
+ "type": "Program",
+}
+`;
+
+exports[`Comments fixtures/jsx-comment-after-jsx.src 1`] = `
+Object {
+ "body": Array [
+ Object {
+ "declarations": Array [
+ Object {
+ "id": Object {
"loc": Object {
"end": Object {
"column": 10,
@@ -2533,10 +2495,44 @@ Object {
Object {
"argument": Object {
"children": Array [],
- "closingElement": null,
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 49,
+ 52,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 47,
+ 53,
+ ],
+ "type": "JSXClosingElement",
+ },
"loc": Object {
"end": Object {
- "column": 15,
+ "column": 19,
"line": 3,
},
"start": Object {
@@ -2548,7 +2544,7 @@ Object {
"attributes": Array [],
"loc": Object {
"end": Object {
- "column": 15,
+ "column": 13,
"line": 3,
},
"start": Object {
@@ -2576,14 +2572,14 @@ Object {
},
"range": Array [
42,
- 49,
+ 47,
],
- "selfClosing": true,
+ "selfClosing": false,
"type": "JSXOpeningElement",
},
"range": Array [
42,
- 49,
+ 53,
],
"type": "JSXElement",
},
@@ -2599,7 +2595,7 @@ Object {
},
"range": Array [
25,
- 63,
+ 67,
],
"type": "ReturnStatement",
},
@@ -2616,7 +2612,7 @@ Object {
},
"range": Array [
19,
- 65,
+ 69,
],
"type": "BlockStatement",
},
@@ -2636,7 +2632,7 @@ Object {
"params": Array [],
"range": Array [
13,
- 65,
+ 69,
],
"type": "ArrowFunctionExpression",
},
@@ -2652,7 +2648,7 @@ Object {
},
"range": Array [
6,
- 65,
+ 69,
],
"type": "VariableDeclarator",
},
@@ -2670,7 +2666,7 @@ Object {
},
"range": Array [
0,
- 65,
+ 69,
],
"type": "VariableDeclaration",
},
@@ -2679,17 +2675,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 22,
+ "column": 26,
"line": 3,
},
"start": Object {
- "column": 16,
+ "column": 20,
"line": 3,
},
},
"range": Array [
- 50,
- 56,
+ 54,
+ 60,
],
"type": "Line",
"value": " Foo",
@@ -2707,7 +2703,7 @@ Object {
},
"range": Array [
0,
- 66,
+ 70,
],
"sourceType": "module",
"tokens": Array [
@@ -2909,6 +2905,24 @@ Object {
"type": "JSXIdentifier",
"value": "Foo",
},
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 13,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 12,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 46,
+ 47,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
Object {
"loc": Object {
"end": Object {
@@ -2925,7 +2939,7 @@ Object {
48,
],
"type": "Punctuator",
- "value": "/",
+ "value": "<",
},
Object {
"loc": Object {
@@ -2943,6 +2957,42 @@ Object {
49,
],
"type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 49,
+ 52,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Foo",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 18,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 52,
+ 53,
+ ],
+ "type": "Punctuator",
"value": ">",
},
Object {
@@ -2957,8 +3007,8 @@ Object {
},
},
"range": Array [
- 61,
- 62,
+ 65,
+ 66,
],
"type": "Punctuator",
"value": ")",
@@ -2975,8 +3025,8 @@ Object {
},
},
"range": Array [
- 62,
- 63,
+ 66,
+ 67,
],
"type": "Punctuator",
"value": ";",
@@ -2993,8 +3043,8 @@ Object {
},
},
"range": Array [
- 64,
- 65,
+ 68,
+ 69,
],
"type": "Punctuator",
"value": "}",
@@ -3004,7 +3054,7 @@ Object {
}
`;
-exports[`Comments fixtures/jsx-generic-with-comment-in-tag.src 1`] = `
+exports[`Comments fixtures/jsx-comment-after-self-closing-jsx.src 1`] = `
Object {
"body": Array [
Object {
@@ -3021,7 +3071,7 @@ Object {
"line": 1,
},
},
- "name": "comp",
+ "name": "pure",
"range": Array [
6,
10,
@@ -3029,792 +3079,1294 @@ Object {
"type": "Identifier",
},
"init": Object {
- "children": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 3,
- },
- "start": Object {
- "column": 4,
- "line": 2,
- },
- },
- "range": Array [
- 19,
- 24,
- ],
- "raw": "
- ",
- "type": "JSXText",
- "value": "
- ",
- },
- Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 50,
- "line": 3,
- },
- "start": Object {
- "column": 38,
- "line": 3,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 49,
- "line": 3,
- },
- "start": Object {
- "column": 40,
- "line": 3,
- },
- },
- "name": "Component",
- "range": Array [
- 60,
- 69,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 58,
- 70,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 50,
- "line": 3,
- },
- "start": Object {
- "column": 4,
- "line": 3,
- },
- },
- "openingElement": Object {
- "attributes": Array [],
- "loc": Object {
- "end": Object {
- "column": 38,
- "line": 3,
- },
- "start": Object {
- "column": 4,
- "line": 3,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 3,
- },
- "start": Object {
- "column": 5,
- "line": 3,
- },
- },
- "name": "Component",
- "range": Array [
- 25,
- 34,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 24,
- 58,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- "typeParameters": Object {
+ "async": false,
+ "body": Object {
+ "body": Array [
+ Object {
+ "argument": Object {
+ "children": Array [],
+ "closingElement": null,
"loc": Object {
"end": Object {
- "column": 22,
+ "column": 15,
"line": 3,
},
"start": Object {
- "column": 14,
+ "column": 8,
"line": 3,
},
},
- "params": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 3,
- },
- "start": Object {
- "column": 15,
- "line": 3,
- },
- },
- "range": Array [
- 35,
- 41,
- ],
- "type": "TSNumberKeyword",
- },
- ],
- "range": Array [
- 34,
- 42,
- ],
- "type": "TSTypeParameterInstantiation",
- },
- },
- "range": Array [
- 24,
- 70,
- ],
- "type": "JSXElement",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 4,
- },
- "start": Object {
- "column": 50,
- "line": 3,
- },
- },
- "range": Array [
- 70,
- 75,
- ],
- "raw": "
- ",
- "type": "JSXText",
- "value": "
- ",
- },
- Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 54,
- "line": 4,
- },
- "start": Object {
- "column": 42,
- "line": 4,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 53,
- "line": 4,
- },
- "start": Object {
- "column": 44,
- "line": 4,
- },
- },
- "name": "Component",
- "range": Array [
- 115,
- 124,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 113,
- 125,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 54,
- "line": 4,
- },
- "start": Object {
- "column": 4,
- "line": 4,
- },
- },
- "openingElement": Object {
- "attributes": Array [
- Object {
+ "openingElement": Object {
+ "attributes": Array [],
"loc": Object {
"end": Object {
- "column": 26,
- "line": 4,
+ "column": 15,
+ "line": 3,
},
"start": Object {
- "column": 23,
- "line": 4,
+ "column": 8,
+ "line": 3,
},
},
"name": Object {
"loc": Object {
"end": Object {
- "column": 26,
- "line": 4,
+ "column": 12,
+ "line": 3,
},
"start": Object {
- "column": 23,
- "line": 4,
+ "column": 9,
+ "line": 3,
},
},
- "name": "foo",
+ "name": "Foo",
"range": Array [
- 94,
- 97,
+ 43,
+ 46,
],
"type": "JSXIdentifier",
},
"range": Array [
- 94,
- 97,
+ 42,
+ 49,
],
- "type": "JSXAttribute",
- "value": null,
+ "selfClosing": true,
+ "type": "JSXOpeningElement",
},
- ],
+ "range": Array [
+ 42,
+ 49,
+ ],
+ "type": "JSXElement",
+ },
"loc": Object {
"end": Object {
- "column": 42,
+ "column": 6,
"line": 4,
},
"start": Object {
"column": 4,
- "line": 4,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 4,
- },
- "start": Object {
- "column": 5,
- "line": 4,
- },
+ "line": 2,
},
- "name": "Component",
- "range": Array [
- 76,
- 85,
- ],
- "type": "JSXIdentifier",
},
"range": Array [
- 75,
- 113,
+ 25,
+ 63,
],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- "typeParameters": Object {
- "loc": Object {
- "end": Object {
- "column": 22,
- "line": 4,
- },
- "start": Object {
- "column": 14,
- "line": 4,
- },
- },
- "params": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 4,
- },
- "start": Object {
- "column": 15,
- "line": 4,
- },
- },
- "range": Array [
- 86,
- 92,
- ],
- "type": "TSNumberKeyword",
- },
- ],
- "range": Array [
- 85,
- 93,
- ],
- "type": "TSTypeParameterInstantiation",
- },
- },
- "range": Array [
- 75,
- 125,
- ],
- "type": "JSXElement",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 5,
- },
- "start": Object {
- "column": 54,
- "line": 4,
- },
- },
- "range": Array [
- 125,
- 130,
- ],
- "raw": "
- ",
- "type": "JSXText",
- "value": "
- ",
- },
- Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 54,
- "line": 5,
- },
- "start": Object {
- "column": 42,
- "line": 5,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 53,
- "line": 5,
- },
- "start": Object {
- "column": 44,
- "line": 5,
- },
- },
- "name": "Component",
- "range": Array [
- 170,
- 179,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 168,
- 180,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 54,
- "line": 5,
- },
- "start": Object {
- "column": 4,
- "line": 5,
- },
+ "type": "ReturnStatement",
},
- "openingElement": Object {
- "attributes": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 41,
- "line": 5,
- },
- "start": Object {
- "column": 38,
- "line": 5,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 41,
- "line": 5,
- },
- "start": Object {
- "column": 38,
- "line": 5,
- },
- },
- "name": "bar",
- "range": Array [
- 164,
- 167,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 164,
- 167,
- ],
- "type": "JSXAttribute",
- "value": null,
- },
- ],
- "loc": Object {
- "end": Object {
- "column": 42,
- "line": 5,
- },
- "start": Object {
- "column": 4,
- "line": 5,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 5,
- },
- "start": Object {
- "column": 5,
- "line": 5,
- },
- },
- "name": "Component",
- "range": Array [
- 131,
- 140,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 130,
- 168,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- "typeParameters": Object {
- "loc": Object {
- "end": Object {
- "column": 22,
- "line": 5,
- },
- "start": Object {
- "column": 14,
- "line": 5,
- },
- },
- "params": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 5,
- },
- "start": Object {
- "column": 15,
- "line": 5,
- },
- },
- "range": Array [
- 141,
- 147,
- ],
- "type": "TSNumberKeyword",
- },
- ],
- "range": Array [
- 140,
- 148,
- ],
- "type": "TSTypeParameterInstantiation",
- },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 5,
},
- "range": Array [
- 130,
- 180,
- ],
- "type": "JSXElement",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 6,
- },
- "start": Object {
- "column": 54,
- "line": 5,
- },
+ "start": Object {
+ "column": 19,
+ "line": 1,
},
- "range": Array [
- 180,
- 185,
- ],
- "raw": "
- ",
- "type": "JSXText",
- "value": "
- ",
},
- Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 58,
- "line": 6,
- },
- "start": Object {
- "column": 46,
- "line": 6,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 57,
- "line": 6,
- },
- "start": Object {
- "column": 48,
- "line": 6,
- },
- },
- "name": "Component",
- "range": Array [
- 229,
- 238,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 227,
- 239,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 58,
- "line": 6,
- },
- "start": Object {
- "column": 4,
- "line": 6,
- },
- },
- "openingElement": Object {
- "attributes": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 26,
- "line": 6,
- },
- "start": Object {
- "column": 23,
- "line": 6,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 26,
- "line": 6,
- },
- "start": Object {
- "column": 23,
- "line": 6,
- },
- },
- "name": "foo",
- "range": Array [
- 204,
- 207,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 204,
- 207,
- ],
- "type": "JSXAttribute",
- "value": null,
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 45,
- "line": 6,
- },
- "start": Object {
- "column": 42,
- "line": 6,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 45,
- "line": 6,
- },
- "start": Object {
- "column": 42,
- "line": 6,
- },
- },
- "name": "bar",
- "range": Array [
- 223,
- 226,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 223,
- 226,
- ],
- "type": "JSXAttribute",
- "value": null,
- },
- ],
- "loc": Object {
- "end": Object {
- "column": 46,
- "line": 6,
- },
- "start": Object {
- "column": 4,
- "line": 6,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 6,
- },
- "start": Object {
- "column": 5,
- "line": 6,
- },
- },
- "name": "Component",
- "range": Array [
- 186,
- 195,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 185,
- 227,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- "typeParameters": Object {
- "loc": Object {
- "end": Object {
- "column": 22,
- "line": 6,
- },
- "start": Object {
- "column": 14,
- "line": 6,
- },
- },
- "params": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 6,
- },
- "start": Object {
- "column": 15,
- "line": 6,
- },
- },
- "range": Array [
- 196,
- 202,
- ],
- "type": "TSNumberKeyword",
- },
- ],
- "range": Array [
- 195,
- 203,
- ],
- "type": "TSTypeParameterInstantiation",
- },
- },
- "range": Array [
- 185,
- 239,
- ],
- "type": "JSXElement",
+ "range": Array [
+ 19,
+ 65,
+ ],
+ "type": "BlockStatement",
+ },
+ "expression": false,
+ "generator": false,
+ "id": null,
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 5,
},
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 8,
- },
- "start": Object {
- "column": 58,
- "line": 6,
- },
- },
- "range": Array [
- 239,
- 245,
- ],
- "raw": "
-
- ",
- "type": "JSXText",
- "value": "
-
- ",
+ "start": Object {
+ "column": 13,
+ "line": 1,
},
- Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 17,
- "line": 10,
- },
- "start": Object {
- "column": 5,
- "line": 10,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 16,
- "line": 10,
- },
- "start": Object {
- "column": 7,
- "line": 10,
- },
- },
- "name": "Component",
- "range": Array [
- 289,
+ },
+ "params": Array [],
+ "range": Array [
+ 13,
+ 65,
+ ],
+ "type": "ArrowFunctionExpression",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 65,
+ ],
+ "type": "VariableDeclarator",
+ },
+ ],
+ "kind": "const",
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 65,
+ ],
+ "type": "VariableDeclaration",
+ },
+ ],
+ "comments": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 16,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 50,
+ 56,
+ ],
+ "type": "Line",
+ "value": " Foo",
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 0,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 66,
+ ],
+ "sourceType": "module",
+ "tokens": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 5,
+ ],
+ "type": "Keyword",
+ "value": "const",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 10,
+ ],
+ "type": "Identifier",
+ "value": "pure",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 11,
+ 12,
+ ],
+ "type": "Punctuator",
+ "value": "=",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 13,
+ 14,
+ ],
+ "type": "Punctuator",
+ "value": "(",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 14,
+ 15,
+ ],
+ "type": "Punctuator",
+ "value": ")",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 16,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 16,
+ 18,
+ ],
+ "type": "Punctuator",
+ "value": "=>",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 19,
+ 20,
+ ],
+ "type": "Punctuator",
+ "value": "{",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 25,
+ 31,
+ ],
+ "type": "Keyword",
+ "value": "return",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 2,
+ },
+ "start": Object {
+ "column": 11,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 32,
+ 33,
+ ],
+ "type": "Punctuator",
+ "value": "(",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 9,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 42,
+ 43,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 9,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 43,
+ 46,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Foo",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 47,
+ 48,
+ ],
+ "type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 48,
+ 49,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 61,
+ 62,
+ ],
+ "type": "Punctuator",
+ "value": ")",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 6,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 62,
+ 63,
+ ],
+ "type": "Punctuator",
+ "value": ";",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 64,
+ 65,
+ ],
+ "type": "Punctuator",
+ "value": "}",
+ },
+ ],
+ "type": "Program",
+}
+`;
+
+exports[`Comments fixtures/jsx-generic-with-comment-in-tag.src 1`] = `
+Object {
+ "body": Array [
+ Object {
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "name": "comp",
+ "range": Array [
+ 6,
+ 10,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 19,
+ 24,
+ ],
+ "raw": "
+ ",
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 50,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 49,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 40,
+ "line": 3,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 60,
+ 69,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 58,
+ 70,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 50,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 3,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 25,
+ 34,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 24,
+ 58,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ "typeParameters": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 3,
+ },
+ },
+ "params": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 35,
+ 41,
+ ],
+ "type": "TSNumberKeyword",
+ },
+ ],
+ "range": Array [
+ 34,
+ 42,
+ ],
+ "type": "TSTypeParameterInstantiation",
+ },
+ },
+ "range": Array [
+ 24,
+ 70,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 50,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 70,
+ 75,
+ ],
+ "raw": "
+ ",
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 4,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 53,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 44,
+ "line": 4,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 115,
+ 124,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 113,
+ 125,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 4,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 4,
+ },
+ },
+ "name": "foo",
+ "range": Array [
+ 94,
+ 97,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 94,
+ 97,
+ ],
+ "type": "JSXAttribute",
+ "value": null,
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 4,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 76,
+ 85,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 75,
+ 113,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ "typeParameters": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 4,
+ },
+ },
+ "params": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 86,
+ 92,
+ ],
+ "type": "TSNumberKeyword",
+ },
+ ],
+ "range": Array [
+ 85,
+ 93,
+ ],
+ "type": "TSTypeParameterInstantiation",
+ },
+ },
+ "range": Array [
+ 75,
+ 125,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 54,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 125,
+ 130,
+ ],
+ "raw": "
+ ",
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 53,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 44,
+ "line": 5,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 170,
+ 179,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 168,
+ 180,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 5,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 41,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 41,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 5,
+ },
+ },
+ "name": "bar",
+ "range": Array [
+ 164,
+ 167,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 164,
+ 167,
+ ],
+ "type": "JSXAttribute",
+ "value": null,
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 5,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 131,
+ 140,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 130,
+ 168,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ "typeParameters": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 5,
+ },
+ },
+ "params": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 141,
+ 147,
+ ],
+ "type": "TSNumberKeyword",
+ },
+ ],
+ "range": Array [
+ 140,
+ 148,
+ ],
+ "type": "TSTypeParameterInstantiation",
+ },
+ },
+ "range": Array [
+ 130,
+ 180,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 54,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 180,
+ 185,
+ ],
+ "raw": "
+ ",
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 58,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 46,
+ "line": 6,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 57,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 48,
+ "line": 6,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 229,
+ 238,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 227,
+ 239,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 58,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 6,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 6,
+ },
+ },
+ "name": "foo",
+ "range": Array [
+ 204,
+ 207,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 204,
+ 207,
+ ],
+ "type": "JSXAttribute",
+ "value": null,
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 45,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 6,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 45,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 6,
+ },
+ },
+ "name": "bar",
+ "range": Array [
+ 223,
+ 226,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 223,
+ 226,
+ ],
+ "type": "JSXAttribute",
+ "value": null,
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 46,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 6,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 186,
+ 195,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 185,
+ 227,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ "typeParameters": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 6,
+ },
+ },
+ "params": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 196,
+ 202,
+ ],
+ "type": "TSNumberKeyword",
+ },
+ ],
+ "range": Array [
+ 195,
+ 203,
+ ],
+ "type": "TSTypeParameterInstantiation",
+ },
+ },
+ "range": Array [
+ 185,
+ 239,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 58,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 239,
+ 245,
+ ],
+ "raw": "
+
+ ",
+ "type": "JSXText",
+ "value": "
+
+ ",
+ },
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 10,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 10,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 16,
+ "line": 10,
+ },
+ "start": Object {
+ "column": 7,
+ "line": 10,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 289,
298,
],
"type": "JSXIdentifier",
@@ -4591,290 +5143,1358 @@ Object {
"type": "VariableDeclarator",
},
],
- "kind": "const",
+ "kind": "const",
+ "loc": Object {
+ "end": Object {
+ "column": 2,
+ "line": 25,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 525,
+ ],
+ "type": "VariableDeclaration",
+ },
+ ],
+ "comments": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 37,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 43,
+ 57,
+ ],
+ "type": "Block",
+ "value": " comment1 ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 41,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 27,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 98,
+ 112,
+ ],
+ "type": "Block",
+ "value": " comment2 ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 37,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 149,
+ 163,
+ ],
+ "type": "Block",
+ "value": " comment3 ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 41,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 27,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 208,
+ 222,
+ ],
+ "type": "Block",
+ "value": " comment4 ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 9,
+ },
+ },
+ "range": Array [
+ 270,
+ 281,
+ ],
+ "type": "Line",
+ "value": " comment5",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 13,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 13,
+ },
+ },
+ "range": Array [
+ 339,
+ 350,
+ ],
+ "type": "Line",
+ "value": " comment6",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 16,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 16,
+ },
+ },
+ "range": Array [
+ 398,
+ 409,
+ ],
+ "type": "Line",
+ "value": " comment7",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 21,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 21,
+ },
+ },
+ "range": Array [
+ 477,
+ 488,
+ ],
+ "type": "Line",
+ "value": " comment8",
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 0,
+ "line": 26,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 526,
+ ],
+ "sourceType": "module",
+ "tokens": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 5,
+ ],
+ "type": "Keyword",
+ "value": "const",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 10,
+ ],
+ "type": "Identifier",
+ "value": "comp",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 11,
+ 12,
+ ],
+ "type": "Punctuator",
+ "value": "=",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 13,
+ 14,
+ ],
+ "type": "Punctuator",
+ "value": "(",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 3,
+ "line": 2,
+ },
+ "start": Object {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 17,
+ 18,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 2,
+ },
+ "start": Object {
+ "column": 3,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 18,
+ 19,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 19,
+ 24,
+ ],
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 24,
+ 25,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 25,
+ 34,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 34,
+ 35,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 35,
+ 41,
+ ],
+ "type": "Identifier",
+ "value": "number",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 41,
+ 42,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 37,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 57,
+ 58,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 39,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 58,
+ 59,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 40,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 39,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 59,
+ 60,
+ ],
+ "type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 49,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 40,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 60,
+ 69,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 50,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 49,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 69,
+ 70,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 50,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 70,
+ 75,
+ ],
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 75,
+ 76,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 76,
+ 85,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 85,
+ 86,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 86,
+ 92,
+ ],
+ "type": "Identifier",
+ "value": "number",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 92,
+ 93,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 94,
+ 97,
+ ],
+ "type": "JSXIdentifier",
+ "value": "foo",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 41,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 112,
+ 113,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 113,
+ 114,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 44,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 43,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 114,
+ 115,
+ ],
+ "type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 53,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 44,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 115,
+ 124,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 53,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 124,
+ 125,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 54,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 125,
+ 130,
+ ],
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 130,
+ 131,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 131,
+ 140,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 140,
+ 141,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 141,
+ 147,
+ ],
+ "type": "Identifier",
+ "value": "number",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 147,
+ 148,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 41,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 164,
+ 167,
+ ],
+ "type": "JSXIdentifier",
+ "value": "bar",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 41,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 167,
+ 168,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 168,
+ 169,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 44,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 43,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 169,
+ 170,
+ ],
+ "type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 53,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 44,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 170,
+ 179,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 53,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 179,
+ 180,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 54,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 180,
+ 185,
+ ],
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 185,
+ 186,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 186,
+ 195,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 195,
+ 196,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 196,
+ 202,
+ ],
+ "type": "Identifier",
+ "value": "number",
+ },
+ Object {
"loc": Object {
"end": Object {
- "column": 2,
- "line": 25,
+ "column": 22,
+ "line": 6,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 21,
+ "line": 6,
},
},
"range": Array [
- 0,
- 525,
+ 202,
+ 203,
],
- "type": "VariableDeclaration",
+ "type": "Punctuator",
+ "value": ">",
},
- ],
- "comments": Array [
Object {
"loc": Object {
"end": Object {
- "column": 37,
- "line": 3,
+ "column": 26,
+ "line": 6,
},
"start": Object {
"column": 23,
- "line": 3,
+ "line": 6,
},
},
"range": Array [
- 43,
- 57,
+ 204,
+ 207,
],
- "type": "Block",
- "value": " comment1 ",
+ "type": "JSXIdentifier",
+ "value": "foo",
},
Object {
"loc": Object {
"end": Object {
- "column": 41,
- "line": 4,
+ "column": 45,
+ "line": 6,
},
"start": Object {
- "column": 27,
- "line": 4,
+ "column": 42,
+ "line": 6,
},
},
"range": Array [
- 98,
- 112,
+ 223,
+ 226,
],
- "type": "Block",
- "value": " comment2 ",
+ "type": "JSXIdentifier",
+ "value": "bar",
},
Object {
"loc": Object {
"end": Object {
- "column": 37,
- "line": 5,
+ "column": 46,
+ "line": 6,
},
"start": Object {
- "column": 23,
- "line": 5,
+ "column": 45,
+ "line": 6,
},
},
"range": Array [
- 149,
- 163,
+ 226,
+ 227,
],
- "type": "Block",
- "value": " comment3 ",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 41,
+ "column": 47,
"line": 6,
},
"start": Object {
- "column": 27,
+ "column": 46,
"line": 6,
},
},
"range": Array [
- 208,
- 222,
+ 227,
+ 228,
],
- "type": "Block",
- "value": " comment4 ",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 9,
+ "column": 48,
+ "line": 6,
},
"start": Object {
- "column": 6,
- "line": 9,
+ "column": 47,
+ "line": 6,
},
},
"range": Array [
- 270,
- 281,
+ 228,
+ 229,
],
- "type": "Line",
- "value": " comment5",
+ "type": "Punctuator",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 13,
+ "column": 57,
+ "line": 6,
},
"start": Object {
- "column": 6,
- "line": 13,
+ "column": 48,
+ "line": 6,
},
},
"range": Array [
- 339,
- 350,
+ 229,
+ 238,
],
- "type": "Line",
- "value": " comment6",
+ "type": "JSXIdentifier",
+ "value": "Component",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 16,
+ "column": 58,
+ "line": 6,
},
"start": Object {
- "column": 6,
- "line": 16,
+ "column": 57,
+ "line": 6,
},
},
"range": Array [
- 398,
- 409,
+ 238,
+ 239,
],
- "type": "Line",
- "value": " comment7",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 21,
+ "column": 4,
+ "line": 8,
},
"start": Object {
- "column": 6,
- "line": 21,
+ "column": 58,
+ "line": 6,
},
},
"range": Array [
- 477,
- 488,
+ 239,
+ 245,
],
- "type": "Line",
- "value": " comment8",
- },
- ],
- "loc": Object {
- "end": Object {
- "column": 0,
- "line": 26,
+ "type": "JSXText",
+ "value": "
+
+ ",
},
- "start": Object {
- "column": 0,
- "line": 1,
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 8,
+ },
+ },
+ "range": Array [
+ 245,
+ 246,
+ ],
+ "type": "Punctuator",
+ "value": "<",
},
- },
- "range": Array [
- 0,
- 526,
- ],
- "sourceType": "module",
- "tokens": Array [
Object {
"loc": Object {
"end": Object {
+ "column": 14,
+ "line": 8,
+ },
+ "start": Object {
"column": 5,
- "line": 1,
+ "line": 8,
+ },
+ },
+ "range": Array [
+ 246,
+ 255,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 8,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 14,
+ "line": 8,
},
},
"range": Array [
- 0,
- 5,
+ 255,
+ 256,
],
- "type": "Keyword",
- "value": "const",
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 8,
+ },
+ },
+ "range": Array [
+ 256,
+ 262,
+ ],
+ "type": "Identifier",
+ "value": "number",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 8,
+ },
+ },
+ "range": Array [
+ 262,
+ 263,
+ ],
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 1,
+ "column": 5,
+ "line": 10,
},
"start": Object {
- "column": 6,
- "line": 1,
+ "column": 4,
+ "line": 10,
},
},
"range": Array [
- 6,
- 10,
+ 286,
+ 287,
],
- "type": "Identifier",
- "value": "comp",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 1,
+ "column": 6,
+ "line": 10,
},
"start": Object {
- "column": 11,
- "line": 1,
+ "column": 5,
+ "line": 10,
},
},
"range": Array [
- 11,
- 12,
+ 287,
+ 288,
],
"type": "Punctuator",
- "value": "=",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 1,
+ "column": 7,
+ "line": 10,
},
"start": Object {
- "column": 13,
- "line": 1,
+ "column": 6,
+ "line": 10,
},
},
"range": Array [
- 13,
- 14,
+ 288,
+ 289,
],
"type": "Punctuator",
- "value": "(",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 3,
- "line": 2,
+ "column": 16,
+ "line": 10,
},
"start": Object {
- "column": 2,
- "line": 2,
+ "column": 7,
+ "line": 10,
},
},
"range": Array [
- 17,
- 18,
+ 289,
+ 298,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "JSXIdentifier",
+ "value": "Component",
},
Object {
"loc": Object {
"end": Object {
- "column": 4,
- "line": 2,
+ "column": 17,
+ "line": 10,
},
"start": Object {
- "column": 3,
- "line": 2,
+ "column": 16,
+ "line": 10,
},
},
"range": Array [
- 18,
- 19,
+ 298,
+ 299,
],
"type": "Punctuator",
"value": ">",
@@ -4883,16 +6503,16 @@ Object {
"loc": Object {
"end": Object {
"column": 4,
- "line": 3,
+ "line": 11,
},
"start": Object {
- "column": 4,
- "line": 2,
+ "column": 17,
+ "line": 10,
},
},
"range": Array [
- 19,
- 24,
+ 299,
+ 304,
],
"type": "JSXText",
"value": "
@@ -4902,16 +6522,16 @@ Object {
"loc": Object {
"end": Object {
"column": 5,
- "line": 3,
+ "line": 11,
},
"start": Object {
"column": 4,
- "line": 3,
+ "line": 11,
},
},
"range": Array [
- 24,
- 25,
+ 304,
+ 305,
],
"type": "Punctuator",
"value": "<",
@@ -4920,16 +6540,16 @@ Object {
"loc": Object {
"end": Object {
"column": 14,
- "line": 3,
+ "line": 11,
},
"start": Object {
"column": 5,
- "line": 3,
+ "line": 11,
},
},
"range": Array [
- 25,
- 34,
+ 305,
+ 314,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -4938,16 +6558,16 @@ Object {
"loc": Object {
"end": Object {
"column": 15,
- "line": 3,
+ "line": 11,
},
"start": Object {
"column": 14,
- "line": 3,
+ "line": 11,
},
},
"range": Array [
- 34,
- 35,
+ 314,
+ 315,
],
"type": "Punctuator",
"value": "<",
@@ -4956,16 +6576,16 @@ Object {
"loc": Object {
"end": Object {
"column": 21,
- "line": 3,
+ "line": 11,
},
"start": Object {
"column": 15,
- "line": 3,
+ "line": 11,
},
},
"range": Array [
- 35,
- 41,
+ 315,
+ 321,
],
"type": "Identifier",
"value": "number",
@@ -4974,16 +6594,16 @@ Object {
"loc": Object {
"end": Object {
"column": 22,
- "line": 3,
+ "line": 11,
},
"start": Object {
"column": 21,
- "line": 3,
+ "line": 11,
},
},
"range": Array [
- 41,
- 42,
+ 321,
+ 322,
],
"type": "Punctuator",
"value": ">",
@@ -4991,17 +6611,35 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 38,
- "line": 3,
+ "column": 9,
+ "line": 12,
},
"start": Object {
- "column": 37,
- "line": 3,
+ "column": 6,
+ "line": 12,
},
},
"range": Array [
- 57,
- 58,
+ 329,
+ 332,
+ ],
+ "type": "JSXIdentifier",
+ "value": "foo",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 14,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 14,
+ },
+ },
+ "range": Array [
+ 355,
+ 356,
],
"type": "Punctuator",
"value": ">",
@@ -5009,17 +6647,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 39,
- "line": 3,
+ "column": 6,
+ "line": 14,
},
"start": Object {
- "column": 38,
- "line": 3,
+ "column": 5,
+ "line": 14,
},
},
"range": Array [
- 58,
- 59,
+ 356,
+ 357,
],
"type": "Punctuator",
"value": "<",
@@ -5027,17 +6665,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 40,
- "line": 3,
+ "column": 7,
+ "line": 14,
},
"start": Object {
- "column": 39,
- "line": 3,
+ "column": 6,
+ "line": 14,
},
},
"range": Array [
- 59,
- 60,
+ 357,
+ 358,
],
"type": "Punctuator",
"value": "/",
@@ -5045,17 +6683,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 49,
- "line": 3,
+ "column": 16,
+ "line": 14,
},
"start": Object {
- "column": 40,
- "line": 3,
+ "column": 7,
+ "line": 14,
},
},
"range": Array [
- 60,
- 69,
+ 358,
+ 367,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -5063,17 +6701,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 50,
- "line": 3,
+ "column": 17,
+ "line": 14,
},
"start": Object {
- "column": 49,
- "line": 3,
+ "column": 16,
+ "line": 14,
},
},
"range": Array [
- 69,
- 70,
+ 367,
+ 368,
],
"type": "Punctuator",
"value": ">",
@@ -5082,16 +6720,16 @@ Object {
"loc": Object {
"end": Object {
"column": 4,
- "line": 4,
+ "line": 15,
},
"start": Object {
- "column": 50,
- "line": 3,
+ "column": 17,
+ "line": 14,
},
},
"range": Array [
- 70,
- 75,
+ 368,
+ 373,
],
"type": "JSXText",
"value": "
@@ -5101,16 +6739,16 @@ Object {
"loc": Object {
"end": Object {
"column": 5,
- "line": 4,
+ "line": 15,
},
"start": Object {
"column": 4,
- "line": 4,
+ "line": 15,
},
},
"range": Array [
- 75,
- 76,
+ 373,
+ 374,
],
"type": "Punctuator",
"value": "<",
@@ -5119,16 +6757,16 @@ Object {
"loc": Object {
"end": Object {
"column": 14,
- "line": 4,
+ "line": 15,
},
"start": Object {
"column": 5,
- "line": 4,
+ "line": 15,
},
},
"range": Array [
- 76,
- 85,
+ 374,
+ 383,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -5137,16 +6775,16 @@ Object {
"loc": Object {
"end": Object {
"column": 15,
- "line": 4,
+ "line": 15,
},
"start": Object {
"column": 14,
- "line": 4,
+ "line": 15,
},
},
"range": Array [
- 85,
- 86,
+ 383,
+ 384,
],
"type": "Punctuator",
"value": "<",
@@ -5155,16 +6793,16 @@ Object {
"loc": Object {
"end": Object {
"column": 21,
- "line": 4,
+ "line": 15,
},
"start": Object {
"column": 15,
- "line": 4,
+ "line": 15,
},
},
"range": Array [
- 86,
- 92,
+ 384,
+ 390,
],
"type": "Identifier",
"value": "number",
@@ -5173,16 +6811,16 @@ Object {
"loc": Object {
"end": Object {
"column": 22,
- "line": 4,
+ "line": 15,
},
"start": Object {
"column": 21,
- "line": 4,
+ "line": 15,
},
},
"range": Array [
- 92,
- 93,
+ 390,
+ 391,
],
"type": "Punctuator",
"value": ">",
@@ -5190,17 +6828,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 26,
- "line": 4,
+ "column": 9,
+ "line": 17,
},
"start": Object {
- "column": 23,
- "line": 4,
+ "column": 6,
+ "line": 17,
},
},
"range": Array [
- 94,
- 97,
+ 416,
+ 419,
],
"type": "JSXIdentifier",
"value": "foo",
@@ -5208,17 +6846,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 42,
- "line": 4,
+ "column": 5,
+ "line": 18,
},
"start": Object {
- "column": 41,
- "line": 4,
+ "column": 4,
+ "line": 18,
},
},
"range": Array [
- 112,
- 113,
+ 424,
+ 425,
],
"type": "Punctuator",
"value": ">",
@@ -5226,17 +6864,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 43,
- "line": 4,
+ "column": 6,
+ "line": 18,
},
"start": Object {
- "column": 42,
- "line": 4,
+ "column": 5,
+ "line": 18,
},
},
"range": Array [
- 113,
- 114,
+ 425,
+ 426,
],
"type": "Punctuator",
"value": "<",
@@ -5244,17 +6882,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 44,
- "line": 4,
+ "column": 7,
+ "line": 18,
},
"start": Object {
- "column": 43,
- "line": 4,
+ "column": 6,
+ "line": 18,
},
},
"range": Array [
- 114,
- 115,
+ 426,
+ 427,
],
"type": "Punctuator",
"value": "/",
@@ -5262,17 +6900,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 53,
- "line": 4,
+ "column": 16,
+ "line": 18,
},
"start": Object {
- "column": 44,
- "line": 4,
+ "column": 7,
+ "line": 18,
},
},
"range": Array [
- 115,
- 124,
+ 427,
+ 436,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -5280,17 +6918,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 54,
- "line": 4,
+ "column": 17,
+ "line": 18,
},
"start": Object {
- "column": 53,
- "line": 4,
+ "column": 16,
+ "line": 18,
},
},
"range": Array [
- 124,
- 125,
+ 436,
+ 437,
],
"type": "Punctuator",
"value": ">",
@@ -5299,16 +6937,16 @@ Object {
"loc": Object {
"end": Object {
"column": 4,
- "line": 5,
+ "line": 19,
},
"start": Object {
- "column": 54,
- "line": 4,
+ "column": 17,
+ "line": 18,
},
},
"range": Array [
- 125,
- 130,
+ 437,
+ 442,
],
"type": "JSXText",
"value": "
@@ -5318,16 +6956,16 @@ Object {
"loc": Object {
"end": Object {
"column": 5,
- "line": 5,
+ "line": 19,
},
"start": Object {
"column": 4,
- "line": 5,
+ "line": 19,
},
},
"range": Array [
- 130,
- 131,
+ 442,
+ 443,
],
"type": "Punctuator",
"value": "<",
@@ -5336,16 +6974,16 @@ Object {
"loc": Object {
"end": Object {
"column": 14,
- "line": 5,
+ "line": 19,
},
"start": Object {
"column": 5,
- "line": 5,
+ "line": 19,
},
},
"range": Array [
- 131,
- 140,
+ 443,
+ 452,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -5354,16 +6992,16 @@ Object {
"loc": Object {
"end": Object {
"column": 15,
- "line": 5,
+ "line": 19,
},
"start": Object {
"column": 14,
- "line": 5,
+ "line": 19,
},
},
"range": Array [
- 140,
- 141,
+ 452,
+ 453,
],
"type": "Punctuator",
"value": "<",
@@ -5372,16 +7010,16 @@ Object {
"loc": Object {
"end": Object {
"column": 21,
- "line": 5,
+ "line": 19,
},
"start": Object {
"column": 15,
- "line": 5,
+ "line": 19,
},
},
"range": Array [
- 141,
- 147,
+ 453,
+ 459,
],
"type": "Identifier",
"value": "number",
@@ -5390,16 +7028,16 @@ Object {
"loc": Object {
"end": Object {
"column": 22,
- "line": 5,
+ "line": 19,
},
"start": Object {
"column": 21,
- "line": 5,
+ "line": 19,
},
},
"range": Array [
- 147,
- 148,
+ 459,
+ 460,
],
"type": "Punctuator",
"value": ">",
@@ -5407,17 +7045,35 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 41,
- "line": 5,
+ "column": 9,
+ "line": 20,
},
"start": Object {
- "column": 38,
- "line": 5,
+ "column": 6,
+ "line": 20,
},
},
"range": Array [
- 164,
- 167,
+ 467,
+ 470,
+ ],
+ "type": "JSXIdentifier",
+ "value": "foo",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 9,
+ "line": 22,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 22,
+ },
+ },
+ "range": Array [
+ 495,
+ 498,
],
"type": "JSXIdentifier",
"value": "bar",
@@ -5425,17 +7081,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 42,
- "line": 5,
+ "column": 5,
+ "line": 23,
},
"start": Object {
- "column": 41,
- "line": 5,
+ "column": 4,
+ "line": 23,
},
},
"range": Array [
- 167,
- 168,
+ 503,
+ 504,
],
"type": "Punctuator",
"value": ">",
@@ -5443,17 +7099,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 43,
- "line": 5,
+ "column": 6,
+ "line": 23,
},
"start": Object {
- "column": 42,
- "line": 5,
+ "column": 5,
+ "line": 23,
},
},
"range": Array [
- 168,
- 169,
+ 504,
+ 505,
],
"type": "Punctuator",
"value": "<",
@@ -5461,17 +7117,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 44,
- "line": 5,
+ "column": 7,
+ "line": 23,
},
"start": Object {
- "column": 43,
- "line": 5,
+ "column": 6,
+ "line": 23,
},
},
"range": Array [
- 169,
- 170,
+ 505,
+ 506,
],
"type": "Punctuator",
"value": "/",
@@ -5479,17 +7135,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 53,
- "line": 5,
+ "column": 16,
+ "line": 23,
},
"start": Object {
- "column": 44,
- "line": 5,
+ "column": 7,
+ "line": 23,
},
},
"range": Array [
- 170,
- 179,
+ 506,
+ 515,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -5497,17 +7153,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 54,
- "line": 5,
+ "column": 17,
+ "line": 23,
},
"start": Object {
- "column": 53,
- "line": 5,
+ "column": 16,
+ "line": 23,
},
},
"range": Array [
- 179,
- 180,
+ 515,
+ 516,
],
"type": "Punctuator",
"value": ">",
@@ -5515,905 +7171,1194 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 4,
- "line": 6,
+ "column": 2,
+ "line": 24,
},
"start": Object {
- "column": 54,
- "line": 5,
+ "column": 17,
+ "line": 23,
},
},
"range": Array [
- 180,
- 185,
+ 516,
+ 519,
],
"type": "JSXText",
"value": "
- ",
+ ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 3,
+ "line": 24,
+ },
+ "start": Object {
+ "column": 2,
+ "line": 24,
+ },
+ },
+ "range": Array [
+ 519,
+ 520,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 24,
+ },
+ "start": Object {
+ "column": 3,
+ "line": 24,
+ },
+ },
+ "range": Array [
+ 520,
+ 521,
+ ],
+ "type": "Punctuator",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
"column": 5,
- "line": 6,
+ "line": 24,
},
"start": Object {
"column": 4,
- "line": 6,
+ "line": 24,
},
},
"range": Array [
- 185,
- 186,
+ 521,
+ 522,
],
"type": "Punctuator",
- "value": "<",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 6,
+ "column": 1,
+ "line": 25,
},
"start": Object {
- "column": 5,
- "line": 6,
+ "column": 0,
+ "line": 25,
},
},
"range": Array [
- 186,
- 195,
+ 523,
+ 524,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Punctuator",
+ "value": ")",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 6,
+ "column": 2,
+ "line": 25,
},
"start": Object {
- "column": 14,
- "line": 6,
+ "column": 1,
+ "line": 25,
+ },
+ },
+ "range": Array [
+ 524,
+ 525,
+ ],
+ "type": "Punctuator",
+ "value": ";",
+ },
+ ],
+ "type": "Program",
+}
+`;
+
+exports[`Comments fixtures/jsx-tag-comments.src 1`] = `
+Object {
+ "body": Array [
+ Object {
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "name": "pure",
+ "range": Array [
+ 6,
+ 10,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "async": false,
+ "body": Object {
+ "body": Array [
+ Object {
+ "argument": Object {
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 8,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 9,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 103,
+ 112,
+ ],
+ "raw": "
+ ",
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 13,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 10,
+ "line": 7,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 114,
+ 117,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 112,
+ 118,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 9,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 9,
+ "line": 3,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 43,
+ 46,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 42,
+ 103,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 42,
+ 118,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 6,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 25,
+ 125,
+ ],
+ "type": "ReturnStatement",
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 19,
+ 127,
+ ],
+ "type": "BlockStatement",
+ },
+ "expression": false,
+ "generator": false,
+ "id": null,
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "params": Array [],
+ "range": Array [
+ 13,
+ 127,
+ ],
+ "type": "ArrowFunctionExpression",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 127,
+ ],
+ "type": "VariableDeclarator",
},
- },
- "range": Array [
- 195,
- 196,
],
- "type": "Punctuator",
- "value": "<",
- },
- Object {
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 21,
- "line": 6,
+ "column": 1,
+ "line": 9,
},
"start": Object {
- "column": 15,
- "line": 6,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 196,
- 202,
+ 0,
+ 127,
],
- "type": "Identifier",
- "value": "number",
+ "type": "VariableDeclaration",
},
+ ],
+ "comments": Array [
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 6,
- },
- "start": Object {
"column": 21,
- "line": 6,
- },
- },
- "range": Array [
- 202,
- 203,
- ],
- "type": "Punctuator",
- "value": ">",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 26,
- "line": 6,
- },
- "start": Object {
- "column": 23,
- "line": 6,
- },
- },
- "range": Array [
- 204,
- 207,
- ],
- "type": "JSXIdentifier",
- "value": "foo",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 45,
- "line": 6,
- },
- "start": Object {
- "column": 42,
- "line": 6,
- },
- },
- "range": Array [
- 223,
- 226,
- ],
- "type": "JSXIdentifier",
- "value": "bar",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 46,
- "line": 6,
- },
- "start": Object {
- "column": 45,
- "line": 6,
- },
- },
- "range": Array [
- 226,
- 227,
- ],
- "type": "Punctuator",
- "value": ">",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 47,
- "line": 6,
- },
- "start": Object {
- "column": 46,
- "line": 6,
- },
- },
- "range": Array [
- 227,
- 228,
- ],
- "type": "Punctuator",
- "value": "<",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 48,
- "line": 6,
- },
- "start": Object {
- "column": 47,
- "line": 6,
- },
- },
- "range": Array [
- 228,
- 229,
- ],
- "type": "Punctuator",
- "value": "/",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 57,
- "line": 6,
+ "line": 4,
},
"start": Object {
- "column": 48,
- "line": 6,
+ "column": 12,
+ "line": 4,
},
},
"range": Array [
- 229,
- 238,
+ 59,
+ 68,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Line",
+ "value": " single",
},
Object {
"loc": Object {
"end": Object {
- "column": 58,
- "line": 6,
+ "column": 23,
+ "line": 5,
},
"start": Object {
- "column": 57,
- "line": 6,
+ "column": 12,
+ "line": 5,
},
},
"range": Array [
- 238,
- 239,
+ 81,
+ 92,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "Block",
+ "value": " block ",
},
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 8,
- },
- "start": Object {
- "column": 58,
- "line": 6,
- },
- },
- "range": Array [
- 239,
- 245,
- ],
- "type": "JSXText",
- "value": "
-
- ",
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 0,
+ "line": 11,
},
- Object {
- "loc": Object {
- "end": Object {
- "column": 5,
- "line": 8,
- },
- "start": Object {
- "column": 4,
- "line": 8,
- },
- },
- "range": Array [
- 245,
- 246,
- ],
- "type": "Punctuator",
- "value": "<",
+ "start": Object {
+ "column": 0,
+ "line": 1,
},
+ },
+ "range": Array [
+ 0,
+ 129,
+ ],
+ "sourceType": "module",
+ "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 8,
- },
- "start": Object {
"column": 5,
- "line": 8,
- },
- },
- "range": Array [
- 246,
- 255,
- ],
- "type": "JSXIdentifier",
- "value": "Component",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 15,
- "line": 8,
- },
- "start": Object {
- "column": 14,
- "line": 8,
- },
- },
- "range": Array [
- 255,
- 256,
- ],
- "type": "Punctuator",
- "value": "<",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 8,
+ "line": 1,
},
"start": Object {
- "column": 15,
- "line": 8,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 256,
- 262,
+ 0,
+ 5,
],
- "type": "Identifier",
- "value": "number",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 8,
+ "column": 10,
+ "line": 1,
},
"start": Object {
- "column": 21,
- "line": 8,
+ "column": 6,
+ "line": 1,
},
},
"range": Array [
- 262,
- 263,
+ 6,
+ 10,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "Identifier",
+ "value": "pure",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 10,
+ "column": 12,
+ "line": 1,
},
"start": Object {
- "column": 4,
- "line": 10,
+ "column": 11,
+ "line": 1,
},
},
"range": Array [
- 286,
- 287,
+ 11,
+ 12,
],
"type": "Punctuator",
- "value": ">",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 10,
+ "column": 14,
+ "line": 1,
},
"start": Object {
- "column": 5,
- "line": 10,
+ "column": 13,
+ "line": 1,
},
},
"range": Array [
- 287,
- 288,
+ 13,
+ 14,
],
"type": "Punctuator",
- "value": "<",
+ "value": "(",
},
Object {
"loc": Object {
"end": Object {
- "column": 7,
- "line": 10,
+ "column": 15,
+ "line": 1,
},
"start": Object {
- "column": 6,
- "line": 10,
+ "column": 14,
+ "line": 1,
},
},
"range": Array [
- 288,
- 289,
+ 14,
+ 15,
],
"type": "Punctuator",
- "value": "/",
+ "value": ")",
},
Object {
"loc": Object {
"end": Object {
- "column": 16,
- "line": 10,
+ "column": 18,
+ "line": 1,
},
"start": Object {
- "column": 7,
- "line": 10,
+ "column": 16,
+ "line": 1,
},
},
"range": Array [
- 289,
- 298,
+ 16,
+ 18,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Punctuator",
+ "value": "=>",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 10,
+ "column": 20,
+ "line": 1,
},
"start": Object {
- "column": 16,
- "line": 10,
+ "column": 19,
+ "line": 1,
},
},
"range": Array [
- 298,
- 299,
+ 19,
+ 20,
],
"type": "Punctuator",
- "value": ">",
+ "value": "{",
},
Object {
"loc": Object {
"end": Object {
- "column": 4,
- "line": 11,
+ "column": 10,
+ "line": 2,
},
"start": Object {
- "column": 17,
- "line": 10,
+ "column": 4,
+ "line": 2,
},
},
"range": Array [
- 299,
- 304,
+ 25,
+ 31,
],
- "type": "JSXText",
- "value": "
- ",
+ "type": "Keyword",
+ "value": "return",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 11,
+ "column": 12,
+ "line": 2,
},
"start": Object {
- "column": 4,
- "line": 11,
+ "column": 11,
+ "line": 2,
},
},
"range": Array [
- 304,
- 305,
+ 32,
+ 33,
],
"type": "Punctuator",
- "value": "<",
+ "value": "(",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 11,
+ "column": 9,
+ "line": 3,
},
"start": Object {
- "column": 5,
- "line": 11,
+ "column": 8,
+ "line": 3,
},
},
"range": Array [
- 305,
- 314,
+ 42,
+ 43,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 11,
+ "column": 12,
+ "line": 3,
},
"start": Object {
- "column": 14,
- "line": 11,
+ "column": 9,
+ "line": 3,
},
},
"range": Array [
- 314,
- 315,
+ 43,
+ 46,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "JSXIdentifier",
+ "value": "Foo",
},
Object {
"loc": Object {
"end": Object {
- "column": 21,
- "line": 11,
+ "column": 9,
+ "line": 6,
},
"start": Object {
- "column": 15,
- "line": 11,
+ "column": 8,
+ "line": 6,
},
},
"range": Array [
- 315,
- 321,
+ 102,
+ 103,
],
- "type": "Identifier",
- "value": "number",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 11,
+ "column": 8,
+ "line": 7,
},
"start": Object {
- "column": 21,
- "line": 11,
+ "column": 9,
+ "line": 6,
},
},
"range": Array [
- 321,
- 322,
+ 103,
+ 112,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "JSXText",
+ "value": "
+ ",
},
Object {
"loc": Object {
"end": Object {
"column": 9,
- "line": 12,
+ "line": 7,
},
"start": Object {
- "column": 6,
- "line": 12,
+ "column": 8,
+ "line": 7,
},
},
"range": Array [
- 329,
- 332,
+ 112,
+ 113,
],
- "type": "JSXIdentifier",
- "value": "foo",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 14,
+ "column": 10,
+ "line": 7,
},
"start": Object {
- "column": 4,
- "line": 14,
+ "column": 9,
+ "line": 7,
},
},
"range": Array [
- 355,
- 356,
+ 113,
+ 114,
],
"type": "Punctuator",
- "value": ">",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 14,
+ "column": 13,
+ "line": 7,
},
"start": Object {
- "column": 5,
- "line": 14,
+ "column": 10,
+ "line": 7,
},
},
"range": Array [
- 356,
- 357,
+ 114,
+ 117,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "JSXIdentifier",
+ "value": "Foo",
},
Object {
"loc": Object {
"end": Object {
- "column": 7,
- "line": 14,
+ "column": 14,
+ "line": 7,
},
"start": Object {
- "column": 6,
- "line": 14,
+ "column": 13,
+ "line": 7,
},
},
"range": Array [
- 357,
- 358,
+ 117,
+ 118,
],
"type": "Punctuator",
- "value": "/",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 16,
- "line": 14,
+ "column": 5,
+ "line": 8,
},
"start": Object {
- "column": 7,
- "line": 14,
+ "column": 4,
+ "line": 8,
},
},
"range": Array [
- 358,
- 367,
+ 123,
+ 124,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Punctuator",
+ "value": ")",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 14,
+ "column": 6,
+ "line": 8,
},
"start": Object {
- "column": 16,
- "line": 14,
+ "column": 5,
+ "line": 8,
},
},
"range": Array [
- 367,
- 368,
+ 124,
+ 125,
],
"type": "Punctuator",
- "value": ">",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 4,
- "line": 15,
+ "column": 1,
+ "line": 9,
},
"start": Object {
- "column": 17,
- "line": 14,
+ "column": 0,
+ "line": 9,
},
},
"range": Array [
- 368,
- 373,
+ 126,
+ 127,
],
- "type": "JSXText",
- "value": "
- ",
+ "type": "Punctuator",
+ "value": "}",
},
+ ],
+ "type": "Program",
+}
+`;
+
+exports[`Comments fixtures/jsx-text-with-multiline-non-comment.src 1`] = `
+Object {
+ "body": Array [
Object {
- "loc": Object {
- "end": Object {
- "column": 5,
- "line": 15,
- },
- "start": Object {
- "column": 4,
- "line": 15,
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "name": "pure",
+ "range": Array [
+ 6,
+ 10,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "async": false,
+ "body": Object {
+ "body": Array [
+ Object {
+ "argument": Object {
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 9,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 41,
+ 80,
+ ],
+ "raw": "
+ /**
+ * test
+ */
+ ",
+ "type": "JSXText",
+ "value": "
+ /**
+ * test
+ */
+ ",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 9,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 7,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 82,
+ 85,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 80,
+ 86,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 9,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 8,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 3,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 37,
+ 40,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 36,
+ 41,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 36,
+ 86,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 23,
+ 91,
+ ],
+ "type": "ReturnStatement",
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 19,
+ 93,
+ ],
+ "type": "BlockStatement",
+ },
+ "expression": false,
+ "generator": false,
+ "id": null,
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "params": Array [],
+ "range": Array [
+ 13,
+ 93,
+ ],
+ "type": "ArrowFunctionExpression",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 93,
+ ],
+ "type": "VariableDeclarator",
},
- },
- "range": Array [
- 373,
- 374,
],
- "type": "Punctuator",
- "value": "<",
- },
- Object {
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 14,
- "line": 15,
+ "column": 1,
+ "line": 9,
},
"start": Object {
- "column": 5,
- "line": 15,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 374,
- 383,
+ 0,
+ 93,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "VariableDeclaration",
+ },
+ ],
+ "comments": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 0,
+ "line": 10,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
},
+ },
+ "range": Array [
+ 0,
+ 94,
+ ],
+ "sourceType": "module",
+ "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 15,
+ "column": 5,
+ "line": 1,
},
"start": Object {
- "column": 14,
- "line": 15,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 383,
- 384,
+ 0,
+ 5,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 21,
- "line": 15,
+ "column": 10,
+ "line": 1,
},
"start": Object {
- "column": 15,
- "line": 15,
+ "column": 6,
+ "line": 1,
},
},
"range": Array [
- 384,
- 390,
+ 6,
+ 10,
],
"type": "Identifier",
- "value": "number",
+ "value": "pure",
},
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 15,
+ "column": 12,
+ "line": 1,
},
"start": Object {
- "column": 21,
- "line": 15,
+ "column": 11,
+ "line": 1,
},
},
"range": Array [
- 390,
- 391,
+ 11,
+ 12,
],
"type": "Punctuator",
- "value": ">",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 17,
+ "column": 14,
+ "line": 1,
},
"start": Object {
- "column": 6,
- "line": 17,
+ "column": 13,
+ "line": 1,
},
},
"range": Array [
- 416,
- 419,
+ 13,
+ 14,
],
- "type": "JSXIdentifier",
- "value": "foo",
+ "type": "Punctuator",
+ "value": "(",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 18,
+ "column": 15,
+ "line": 1,
},
"start": Object {
- "column": 4,
- "line": 18,
+ "column": 14,
+ "line": 1,
},
},
"range": Array [
- 424,
- 425,
+ 14,
+ 15,
],
"type": "Punctuator",
- "value": ">",
+ "value": ")",
},
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 18,
+ "column": 18,
+ "line": 1,
},
"start": Object {
- "column": 5,
- "line": 18,
+ "column": 16,
+ "line": 1,
},
},
"range": Array [
- 425,
- 426,
+ 16,
+ 18,
],
"type": "Punctuator",
- "value": "<",
+ "value": "=>",
},
Object {
"loc": Object {
"end": Object {
- "column": 7,
- "line": 18,
+ "column": 20,
+ "line": 1,
},
"start": Object {
- "column": 6,
- "line": 18,
+ "column": 19,
+ "line": 1,
},
},
"range": Array [
- 426,
- 427,
+ 19,
+ 20,
],
"type": "Punctuator",
- "value": "/",
+ "value": "{",
},
Object {
"loc": Object {
"end": Object {
- "column": 16,
- "line": 18,
+ "column": 8,
+ "line": 2,
},
"start": Object {
- "column": 7,
- "line": 18,
+ "column": 2,
+ "line": 2,
},
},
"range": Array [
- 427,
- 436,
+ 23,
+ 29,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Keyword",
+ "value": "return",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 18,
+ "column": 10,
+ "line": 2,
},
"start": Object {
- "column": 16,
- "line": 18,
+ "column": 9,
+ "line": 2,
},
},
"range": Array [
- 436,
- 437,
+ 30,
+ 31,
],
"type": "Punctuator",
- "value": ">",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 19,
- },
- "start": Object {
- "column": 17,
- "line": 18,
- },
- },
- "range": Array [
- 437,
- 442,
- ],
- "type": "JSXText",
- "value": "
- ",
+ "value": "(",
},
Object {
"loc": Object {
"end": Object {
"column": 5,
- "line": 19,
+ "line": 3,
},
"start": Object {
"column": 4,
- "line": 19,
+ "line": 3,
},
},
"range": Array [
- 442,
- 443,
+ 36,
+ 37,
],
"type": "Punctuator",
"value": "<",
@@ -6421,125 +8366,129 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 19,
+ "column": 8,
+ "line": 3,
},
"start": Object {
"column": 5,
- "line": 19,
+ "line": 3,
},
},
"range": Array [
- 443,
- 452,
+ 37,
+ 40,
],
"type": "JSXIdentifier",
- "value": "Component",
+ "value": "Foo",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 19,
+ "column": 9,
+ "line": 3,
},
"start": Object {
- "column": 14,
- "line": 19,
+ "column": 8,
+ "line": 3,
},
},
"range": Array [
- 452,
- 453,
+ 40,
+ 41,
],
"type": "Punctuator",
- "value": "<",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 21,
- "line": 19,
+ "column": 4,
+ "line": 7,
},
"start": Object {
- "column": 15,
- "line": 19,
+ "column": 9,
+ "line": 3,
},
},
"range": Array [
- 453,
- 459,
- ],
- "type": "Identifier",
- "value": "number",
+ 41,
+ 80,
+ ],
+ "type": "JSXText",
+ "value": "
+ /**
+ * test
+ */
+ ",
},
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 19,
+ "column": 5,
+ "line": 7,
},
"start": Object {
- "column": 21,
- "line": 19,
+ "column": 4,
+ "line": 7,
},
},
"range": Array [
- 459,
- 460,
+ 80,
+ 81,
],
"type": "Punctuator",
- "value": ">",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 20,
+ "column": 6,
+ "line": 7,
},
"start": Object {
- "column": 6,
- "line": 20,
+ "column": 5,
+ "line": 7,
},
},
"range": Array [
- 467,
- 470,
+ 81,
+ 82,
],
- "type": "JSXIdentifier",
- "value": "foo",
+ "type": "Punctuator",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
"column": 9,
- "line": 22,
+ "line": 7,
},
"start": Object {
"column": 6,
- "line": 22,
+ "line": 7,
},
},
"range": Array [
- 495,
- 498,
+ 82,
+ 85,
],
"type": "JSXIdentifier",
- "value": "bar",
+ "value": "Foo",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 23,
+ "column": 10,
+ "line": 7,
},
"start": Object {
- "column": 4,
- "line": 23,
+ "column": 9,
+ "line": 7,
},
},
"range": Array [
- 503,
- 504,
+ 85,
+ 86,
],
"type": "Punctuator",
"value": ">",
@@ -6547,396 +8496,1011 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 23,
+ "column": 3,
+ "line": 8,
},
"start": Object {
- "column": 5,
- "line": 23,
+ "column": 2,
+ "line": 8,
},
},
"range": Array [
- 504,
- 505,
+ 89,
+ 90,
],
"type": "Punctuator",
- "value": "<",
+ "value": ")",
},
Object {
"loc": Object {
"end": Object {
- "column": 7,
- "line": 23,
+ "column": 4,
+ "line": 8,
},
"start": Object {
- "column": 6,
- "line": 23,
+ "column": 3,
+ "line": 8,
},
},
"range": Array [
- 505,
- 506,
+ 90,
+ 91,
],
"type": "Punctuator",
- "value": "/",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 16,
- "line": 23,
+ "column": 1,
+ "line": 9,
},
"start": Object {
- "column": 7,
- "line": 23,
+ "column": 0,
+ "line": 9,
},
},
"range": Array [
- 506,
- 515,
+ 92,
+ 93,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Punctuator",
+ "value": "}",
},
+ ],
+ "type": "Program",
+}
+`;
+
+exports[`Comments fixtures/jsx-text-with-url.src 1`] = `
+Object {
+ "body": Array [
Object {
- "loc": Object {
- "end": Object {
- "column": 17,
- "line": 23,
- },
- "start": Object {
- "column": 16,
- "line": 23,
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 11,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "name": "first",
+ "range": Array [
+ 6,
+ 11,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 37,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 19,
+ 37,
+ ],
+ "raw": "http://example.com",
+ "type": "JSXText",
+ "value": "http://example.com",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 37,
+ "line": 1,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 39,
+ "line": 1,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 39,
+ 42,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 37,
+ 43,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 15,
+ 18,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 14,
+ 19,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 14,
+ 43,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 43,
+ ],
+ "type": "VariableDeclarator",
},
- },
- "range": Array [
- 515,
- 516,
],
- "type": "Punctuator",
- "value": ">",
- },
- Object {
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 2,
- "line": 24,
+ "column": 44,
+ "line": 1,
},
"start": Object {
- "column": 17,
- "line": 23,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 516,
- 519,
+ 0,
+ 44,
],
- "type": "JSXText",
- "value": "
- ",
+ "type": "VariableDeclaration",
},
Object {
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "name": "second",
+ "range": Array [
+ 52,
+ 58,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 35,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 17,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 63,
+ 81,
+ ],
+ "raw": "http://example.com",
+ "type": "JSXText",
+ "value": "http://example.com",
+ },
+ ],
+ "closingFragment": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 35,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 81,
+ 84,
+ ],
+ "type": "JSXClosingFragment",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "openingFragment": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 61,
+ 63,
+ ],
+ "type": "JSXOpeningFragment",
+ },
+ "range": Array [
+ 61,
+ 84,
+ ],
+ "type": "JSXFragment",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 52,
+ 84,
+ ],
+ "type": "VariableDeclarator",
+ },
+ ],
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 3,
- "line": 24,
+ "column": 39,
+ "line": 3,
},
"start": Object {
- "column": 2,
- "line": 24,
+ "column": 0,
+ "line": 3,
},
},
"range": Array [
- 519,
- 520,
+ 46,
+ 85,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "VariableDeclaration",
},
Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 24,
- },
- "start": Object {
- "column": 3,
- "line": 24,
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 11,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 5,
+ },
+ },
+ "name": "third",
+ "range": Array [
+ 93,
+ 98,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "children": Array [
+ Object {
+ "children": Array [],
+ "closingElement": null,
+ "loc": Object {
+ "end": Object {
+ "column": 25,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 5,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 25,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 20,
+ "line": 5,
+ },
+ },
+ "name": "br",
+ "range": Array [
+ 107,
+ 109,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 106,
+ 112,
+ ],
+ "selfClosing": true,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 106,
+ 112,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 25,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 112,
+ 130,
+ ],
+ "raw": "http://example.com",
+ "type": "JSXText",
+ "value": "http://example.com",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 49,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 43,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 48,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 45,
+ "line": 5,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 132,
+ 135,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 130,
+ 136,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 49,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 5,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 5,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 102,
+ 105,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 101,
+ 106,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 101,
+ 136,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 49,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 93,
+ 136,
+ ],
+ "type": "VariableDeclarator",
},
- },
- "range": Array [
- 520,
- 521,
],
- "type": "Punctuator",
- "value": "/",
- },
- Object {
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 5,
- "line": 24,
+ "column": 50,
+ "line": 5,
},
"start": Object {
- "column": 4,
- "line": 24,
+ "column": 0,
+ "line": 5,
},
},
"range": Array [
- 521,
- 522,
+ 87,
+ 137,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "VariableDeclaration",
},
Object {
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 25,
- },
- "start": Object {
- "column": 0,
- "line": 25,
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 7,
+ },
+ },
+ "name": "fourth",
+ "range": Array [
+ 145,
+ 151,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "children": Array [
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 33,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 26,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 32,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 28,
+ "line": 7,
+ },
+ },
+ "name": "span",
+ "range": Array [
+ 167,
+ 171,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 165,
+ 172,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 33,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 20,
+ "line": 7,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 20,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 25,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 7,
+ },
+ },
+ "name": "span",
+ "range": Array [
+ 160,
+ 164,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 159,
+ 165,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 159,
+ 172,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 51,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 33,
+ "line": 7,
+ },
+ },
+ "range": Array [
+ 172,
+ 190,
+ ],
+ "raw": "http://example.com",
+ "type": "JSXText",
+ "value": "http://example.com",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 57,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 51,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 56,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 53,
+ "line": 7,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 192,
+ 195,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 190,
+ 196,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 57,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 7,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 20,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 16,
+ "line": 7,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 155,
+ 158,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 154,
+ 159,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 154,
+ 196,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 57,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 7,
+ },
+ },
+ "range": Array [
+ 145,
+ 196,
+ ],
+ "type": "VariableDeclarator",
},
- },
- "range": Array [
- 523,
- 524,
],
- "type": "Punctuator",
- "value": ")",
- },
- Object {
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 2,
- "line": 25,
+ "column": 58,
+ "line": 7,
},
"start": Object {
- "column": 1,
- "line": 25,
+ "column": 0,
+ "line": 7,
},
},
"range": Array [
- 524,
- 525,
+ 139,
+ 197,
],
- "type": "Punctuator",
- "value": ";",
+ "type": "VariableDeclaration",
},
- ],
- "type": "Program",
-}
-`;
-
-exports[`Comments fixtures/jsx-tag-comments.src 1`] = `
-Object {
- "body": Array [
Object {
"declarations": Array [
Object {
"id": Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 1,
+ "column": 11,
+ "line": 9,
},
"start": Object {
"column": 6,
- "line": 1,
+ "line": 9,
},
},
- "name": "pure",
+ "name": "fifth",
"range": Array [
- 6,
- 10,
+ 205,
+ 210,
],
"type": "Identifier",
},
"init": Object {
- "async": false,
- "body": Object {
- "body": Array [
- Object {
- "argument": Object {
- "children": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 8,
- "line": 7,
- },
- "start": Object {
- "column": 9,
- "line": 6,
- },
- },
- "range": Array [
- 103,
- 112,
- ],
- "raw": "
- ",
- "type": "JSXText",
- "value": "
- ",
- },
- ],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 7,
- },
- "start": Object {
- "column": 8,
- "line": 7,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 13,
- "line": 7,
- },
- "start": Object {
- "column": 10,
- "line": 7,
- },
- },
- "name": "Foo",
- "range": Array [
- 114,
- 117,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 112,
- 118,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 7,
- },
- "start": Object {
- "column": 8,
- "line": 3,
- },
- },
- "openingElement": Object {
- "attributes": Array [],
- "loc": Object {
- "end": Object {
- "column": 9,
- "line": 6,
- },
- "start": Object {
- "column": 8,
- "line": 3,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 12,
- "line": 3,
- },
- "start": Object {
- "column": 9,
- "line": 3,
- },
- },
- "name": "Foo",
- "range": Array [
- 43,
- 46,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 42,
- 103,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- },
- "range": Array [
- 42,
- 118,
- ],
- "type": "JSXElement",
- },
+ "children": Array [
+ Object {
+ "expression": Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 8,
+ "column": 20,
+ "line": 9,
},
"start": Object {
- "column": 4,
- "line": 2,
+ "column": 20,
+ "line": 9,
},
},
"range": Array [
- 25,
- 125,
+ 219,
+ 219,
],
- "type": "ReturnStatement",
+ "type": "JSXEmptyExpression",
},
- ],
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 9,
+ },
+ },
+ "range": Array [
+ 218,
+ 220,
+ ],
+ "type": "JSXExpressionContainer",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 39,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 9,
+ },
+ },
+ "range": Array [
+ 220,
+ 238,
+ ],
+ "raw": "http://example.com",
+ "type": "JSXText",
+ "value": "http://example.com",
+ },
+ ],
+ "closingElement": Object {
"loc": Object {
"end": Object {
- "column": 1,
+ "column": 45,
"line": 9,
},
"start": Object {
+ "column": 39,
+ "line": 9,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 44,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 41,
+ "line": 9,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 240,
+ 243,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 238,
+ 244,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 45,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 9,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
"column": 19,
- "line": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 9,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 9,
+ },
},
+ "name": "div",
+ "range": Array [
+ 214,
+ 217,
+ ],
+ "type": "JSXIdentifier",
},
"range": Array [
- 19,
- 127,
+ 213,
+ 218,
],
- "type": "BlockStatement",
- },
- "expression": false,
- "generator": false,
- "id": null,
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 9,
- },
- "start": Object {
- "column": 13,
- "line": 1,
- },
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
},
- "params": Array [],
"range": Array [
- 13,
- 127,
+ 213,
+ 244,
],
- "type": "ArrowFunctionExpression",
+ "type": "JSXElement",
},
"loc": Object {
"end": Object {
- "column": 1,
+ "column": 45,
"line": 9,
},
"start": Object {
"column": 6,
- "line": 1,
+ "line": 9,
},
},
"range": Array [
- 6,
- 127,
+ 205,
+ 244,
],
"type": "VariableDeclarator",
},
@@ -6944,378 +9508,538 @@ Object {
"kind": "const",
"loc": Object {
"end": Object {
- "column": 1,
+ "column": 46,
"line": 9,
},
"start": Object {
"column": 0,
- "line": 1,
+ "line": 9,
},
},
"range": Array [
- 0,
- 127,
+ 199,
+ 245,
],
"type": "VariableDeclaration",
},
],
- "comments": Array [
+ "comments": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 0,
+ "line": 10,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 246,
+ ],
+ "sourceType": "module",
+ "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 21,
- "line": 4,
+ "column": 5,
+ "line": 1,
},
"start": Object {
- "column": 12,
- "line": 4,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 59,
- 68,
+ 0,
+ 5,
],
- "type": "Line",
- "value": " single",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 23,
- "line": 5,
+ "column": 11,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 11,
+ ],
+ "type": "Identifier",
+ "value": "first",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 13,
+ "line": 1,
},
"start": Object {
"column": 12,
- "line": 5,
+ "line": 1,
},
},
"range": Array [
- 81,
- 92,
+ 12,
+ 13,
],
- "type": "Block",
- "value": " block ",
+ "type": "Punctuator",
+ "value": "=",
},
- ],
- "loc": Object {
- "end": Object {
- "column": 0,
- "line": 11,
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 14,
+ 15,
+ ],
+ "type": "Punctuator",
+ "value": "<",
},
- "start": Object {
- "column": 0,
- "line": 1,
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 15,
+ 18,
+ ],
+ "type": "JSXIdentifier",
+ "value": "div",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 18,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 18,
+ 19,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 37,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 19,
+ 37,
+ ],
+ "type": "JSXText",
+ "value": "http://example.com",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 37,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 37,
+ 38,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 39,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 38,
+ 39,
+ ],
+ "type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 39,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 39,
+ 42,
+ ],
+ "type": "JSXIdentifier",
+ "value": "div",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 42,
+ 43,
+ ],
+ "type": "Punctuator",
+ "value": ">",
},
- },
- "range": Array [
- 0,
- 129,
- ],
- "sourceType": "module",
- "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 5,
+ "column": 44,
"line": 1,
},
"start": Object {
- "column": 0,
+ "column": 43,
"line": 1,
},
},
"range": Array [
- 0,
- 5,
+ 43,
+ 44,
],
- "type": "Keyword",
- "value": "const",
+ "type": "Punctuator",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 1,
+ "column": 5,
+ "line": 3,
},
"start": Object {
- "column": 6,
- "line": 1,
+ "column": 0,
+ "line": 3,
},
},
"range": Array [
- 6,
- 10,
+ 46,
+ 51,
],
- "type": "Identifier",
- "value": "pure",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
"column": 12,
- "line": 1,
+ "line": 3,
},
"start": Object {
- "column": 11,
- "line": 1,
+ "column": 6,
+ "line": 3,
},
},
"range": Array [
- 11,
- 12,
+ 52,
+ 58,
],
- "type": "Punctuator",
- "value": "=",
+ "type": "Identifier",
+ "value": "second",
},
Object {
"loc": Object {
"end": Object {
"column": 14,
- "line": 1,
+ "line": 3,
},
"start": Object {
"column": 13,
- "line": 1,
+ "line": 3,
},
},
"range": Array [
- 13,
- 14,
+ 59,
+ 60,
],
"type": "Punctuator",
- "value": "(",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 1,
+ "column": 16,
+ "line": 3,
},
"start": Object {
- "column": 14,
- "line": 1,
+ "column": 15,
+ "line": 3,
},
},
"range": Array [
- 14,
- 15,
+ 61,
+ 62,
],
"type": "Punctuator",
- "value": ")",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 18,
- "line": 1,
+ "column": 17,
+ "line": 3,
},
"start": Object {
"column": 16,
- "line": 1,
+ "line": 3,
},
},
"range": Array [
- 16,
- 18,
+ 62,
+ 63,
],
"type": "Punctuator",
- "value": "=>",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 20,
- "line": 1,
+ "column": 35,
+ "line": 3,
},
"start": Object {
- "column": 19,
- "line": 1,
+ "column": 17,
+ "line": 3,
},
},
"range": Array [
- 19,
- 20,
+ 63,
+ 81,
],
- "type": "Punctuator",
- "value": "{",
+ "type": "JSXText",
+ "value": "http://example.com",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 2,
+ "column": 36,
+ "line": 3,
},
"start": Object {
- "column": 4,
- "line": 2,
+ "column": 35,
+ "line": 3,
},
},
"range": Array [
- 25,
- 31,
+ 81,
+ 82,
],
- "type": "Keyword",
- "value": "return",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 2,
+ "column": 37,
+ "line": 3,
},
"start": Object {
- "column": 11,
- "line": 2,
+ "column": 36,
+ "line": 3,
},
},
"range": Array [
- 32,
- 33,
+ 82,
+ 83,
],
"type": "Punctuator",
- "value": "(",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
+ "column": 38,
"line": 3,
},
"start": Object {
- "column": 8,
+ "column": 37,
"line": 3,
},
},
"range": Array [
- 42,
- 43,
+ 83,
+ 84,
],
"type": "Punctuator",
- "value": "<",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
+ "column": 39,
"line": 3,
},
"start": Object {
- "column": 9,
+ "column": 38,
"line": 3,
},
},
"range": Array [
- 43,
- 46,
+ 84,
+ 85,
],
- "type": "JSXIdentifier",
- "value": "Foo",
+ "type": "Punctuator",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 6,
+ "column": 5,
+ "line": 5,
},
"start": Object {
- "column": 8,
- "line": 6,
+ "column": 0,
+ "line": 5,
},
},
"range": Array [
- 102,
- 103,
+ 87,
+ 92,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 8,
- "line": 7,
+ "column": 11,
+ "line": 5,
},
"start": Object {
- "column": 9,
- "line": 6,
+ "column": 6,
+ "line": 5,
},
},
"range": Array [
- 103,
- 112,
+ 93,
+ 98,
],
- "type": "JSXText",
- "value": "
- ",
+ "type": "Identifier",
+ "value": "third",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 7,
+ "column": 13,
+ "line": 5,
},
"start": Object {
- "column": 8,
- "line": 7,
+ "column": 12,
+ "line": 5,
},
},
"range": Array [
- 112,
- 113,
+ 99,
+ 100,
],
"type": "Punctuator",
- "value": "<",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 7,
+ "column": 15,
+ "line": 5,
},
"start": Object {
- "column": 9,
- "line": 7,
+ "column": 14,
+ "line": 5,
},
},
"range": Array [
- 113,
- 114,
+ 101,
+ 102,
],
"type": "Punctuator",
- "value": "/",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 13,
- "line": 7,
+ "column": 18,
+ "line": 5,
},
"start": Object {
- "column": 10,
- "line": 7,
+ "column": 15,
+ "line": 5,
},
},
"range": Array [
- 114,
- 117,
+ 102,
+ 105,
],
"type": "JSXIdentifier",
- "value": "Foo",
+ "value": "div",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 7,
+ "column": 19,
+ "line": 5,
},
"start": Object {
- "column": 13,
- "line": 7,
+ "column": 18,
+ "line": 5,
},
},
"range": Array [
- 117,
- 118,
+ 105,
+ 106,
],
"type": "Punctuator",
"value": ">",
@@ -7323,566 +10047,359 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 8,
+ "column": 20,
+ "line": 5,
},
"start": Object {
- "column": 4,
- "line": 8,
+ "column": 19,
+ "line": 5,
},
},
"range": Array [
- 123,
- 124,
+ 106,
+ 107,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 20,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 107,
+ 109,
],
- "type": "Punctuator",
- "value": ")",
+ "type": "JSXIdentifier",
+ "value": "br",
},
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 8,
+ "column": 24,
+ "line": 5,
},
"start": Object {
- "column": 5,
- "line": 8,
+ "column": 23,
+ "line": 5,
},
},
"range": Array [
- 124,
- 125,
+ 110,
+ 111,
],
"type": "Punctuator",
- "value": ";",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 1,
- "line": 9,
+ "column": 25,
+ "line": 5,
},
"start": Object {
- "column": 0,
- "line": 9,
+ "column": 24,
+ "line": 5,
},
},
"range": Array [
- 126,
- 127,
+ 111,
+ 112,
],
"type": "Punctuator",
- "value": "}",
+ "value": ">",
},
- ],
- "type": "Program",
-}
-`;
-
-exports[`Comments fixtures/jsx-text-with-multiline-non-comment.src 1`] = `
-Object {
- "body": Array [
Object {
- "declarations": Array [
- Object {
- "id": Object {
- "loc": Object {
- "end": Object {
- "column": 10,
- "line": 1,
- },
- "start": Object {
- "column": 6,
- "line": 1,
- },
- },
- "name": "pure",
- "range": Array [
- 6,
- 10,
- ],
- "type": "Identifier",
- },
- "init": Object {
- "async": false,
- "body": Object {
- "body": Array [
- Object {
- "argument": Object {
- "children": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 7,
- },
- "start": Object {
- "column": 9,
- "line": 3,
- },
- },
- "range": Array [
- 41,
- 80,
- ],
- "raw": "
- /**
- * test
- */
- ",
- "type": "JSXText",
- "value": "
- /**
- * test
- */
- ",
- },
- ],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 10,
- "line": 7,
- },
- "start": Object {
- "column": 4,
- "line": 7,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 9,
- "line": 7,
- },
- "start": Object {
- "column": 6,
- "line": 7,
- },
- },
- "name": "Foo",
- "range": Array [
- 82,
- 85,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 80,
- 86,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 10,
- "line": 7,
- },
- "start": Object {
- "column": 4,
- "line": 3,
- },
- },
- "openingElement": Object {
- "attributes": Array [],
- "loc": Object {
- "end": Object {
- "column": 9,
- "line": 3,
- },
- "start": Object {
- "column": 4,
- "line": 3,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 8,
- "line": 3,
- },
- "start": Object {
- "column": 5,
- "line": 3,
- },
- },
- "name": "Foo",
- "range": Array [
- 37,
- 40,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 36,
- 41,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- },
- "range": Array [
- 36,
- 86,
- ],
- "type": "JSXElement",
- },
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 8,
- },
- "start": Object {
- "column": 2,
- "line": 2,
- },
- },
- "range": Array [
- 23,
- 91,
- ],
- "type": "ReturnStatement",
- },
- ],
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 9,
- },
- "start": Object {
- "column": 19,
- "line": 1,
- },
- },
- "range": Array [
- 19,
- 93,
- ],
- "type": "BlockStatement",
- },
- "expression": false,
- "generator": false,
- "id": null,
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 9,
- },
- "start": Object {
- "column": 13,
- "line": 1,
- },
- },
- "params": Array [],
- "range": Array [
- 13,
- 93,
- ],
- "type": "ArrowFunctionExpression",
- },
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 9,
- },
- "start": Object {
- "column": 6,
- "line": 1,
- },
- },
- "range": Array [
- 6,
- 93,
- ],
- "type": "VariableDeclarator",
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 5,
},
+ "start": Object {
+ "column": 25,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 112,
+ 130,
],
- "kind": "const",
+ "type": "JSXText",
+ "value": "http://example.com",
+ },
+ Object {
"loc": Object {
"end": Object {
- "column": 1,
- "line": 9,
+ "column": 44,
+ "line": 5,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 43,
+ "line": 5,
},
},
"range": Array [
- 0,
- 93,
+ 130,
+ 131,
],
- "type": "VariableDeclaration",
- },
- ],
- "comments": Array [],
- "loc": Object {
- "end": Object {
- "column": 0,
- "line": 10,
- },
- "start": Object {
- "column": 0,
- "line": 1,
+ "type": "Punctuator",
+ "value": "<",
},
- },
- "range": Array [
- 0,
- 94,
- ],
- "sourceType": "module",
- "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 1,
+ "column": 45,
+ "line": 5,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 44,
+ "line": 5,
},
},
"range": Array [
- 0,
- 5,
+ 131,
+ 132,
],
- "type": "Keyword",
- "value": "const",
+ "type": "Punctuator",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 1,
+ "column": 48,
+ "line": 5,
},
"start": Object {
- "column": 6,
- "line": 1,
+ "column": 45,
+ "line": 5,
},
},
"range": Array [
- 6,
- 10,
+ 132,
+ 135,
],
- "type": "Identifier",
- "value": "pure",
+ "type": "JSXIdentifier",
+ "value": "div",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 1,
+ "column": 49,
+ "line": 5,
},
"start": Object {
- "column": 11,
- "line": 1,
+ "column": 48,
+ "line": 5,
},
},
"range": Array [
- 11,
- 12,
+ 135,
+ 136,
],
"type": "Punctuator",
- "value": "=",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 1,
+ "column": 50,
+ "line": 5,
},
"start": Object {
- "column": 13,
- "line": 1,
+ "column": 49,
+ "line": 5,
},
},
"range": Array [
- 13,
- 14,
+ 136,
+ 137,
],
"type": "Punctuator",
- "value": "(",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 1,
+ "column": 5,
+ "line": 7,
},
"start": Object {
- "column": 14,
- "line": 1,
+ "column": 0,
+ "line": 7,
},
},
"range": Array [
- 14,
- 15,
+ 139,
+ 144,
],
- "type": "Punctuator",
- "value": ")",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 18,
- "line": 1,
+ "column": 12,
+ "line": 7,
},
"start": Object {
- "column": 16,
- "line": 1,
+ "column": 6,
+ "line": 7,
},
},
"range": Array [
- 16,
- 18,
+ 145,
+ 151,
],
- "type": "Punctuator",
- "value": "=>",
+ "type": "Identifier",
+ "value": "fourth",
},
Object {
"loc": Object {
"end": Object {
- "column": 20,
- "line": 1,
+ "column": 14,
+ "line": 7,
},
"start": Object {
- "column": 19,
- "line": 1,
+ "column": 13,
+ "line": 7,
},
},
"range": Array [
- 19,
- 20,
+ 152,
+ 153,
],
"type": "Punctuator",
- "value": "{",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 8,
- "line": 2,
+ "column": 16,
+ "line": 7,
},
"start": Object {
- "column": 2,
- "line": 2,
+ "column": 15,
+ "line": 7,
},
},
"range": Array [
- 23,
- 29,
+ 154,
+ 155,
],
- "type": "Keyword",
- "value": "return",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 2,
+ "column": 19,
+ "line": 7,
},
"start": Object {
- "column": 9,
- "line": 2,
+ "column": 16,
+ "line": 7,
},
},
"range": Array [
- 30,
- 31,
+ 155,
+ 158,
],
- "type": "Punctuator",
- "value": "(",
+ "type": "JSXIdentifier",
+ "value": "div",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 3,
+ "column": 20,
+ "line": 7,
},
"start": Object {
- "column": 4,
- "line": 3,
+ "column": 19,
+ "line": 7,
},
},
"range": Array [
- 36,
- 37,
+ 158,
+ 159,
],
"type": "Punctuator",
- "value": "<",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 8,
- "line": 3,
+ "column": 21,
+ "line": 7,
},
"start": Object {
- "column": 5,
- "line": 3,
+ "column": 20,
+ "line": 7,
},
},
"range": Array [
- 37,
- 40,
+ 159,
+ 160,
],
- "type": "JSXIdentifier",
- "value": "Foo",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 3,
+ "column": 25,
+ "line": 7,
},
"start": Object {
- "column": 8,
- "line": 3,
+ "column": 21,
+ "line": 7,
},
},
"range": Array [
- 40,
- 41,
+ 160,
+ 164,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "JSXIdentifier",
+ "value": "span",
},
Object {
"loc": Object {
"end": Object {
- "column": 4,
+ "column": 26,
"line": 7,
},
"start": Object {
- "column": 9,
- "line": 3,
+ "column": 25,
+ "line": 7,
},
},
"range": Array [
- 41,
- 80,
+ 164,
+ 165,
],
- "type": "JSXText",
- "value": "
- /**
- * test
- */
- ",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
+ "column": 27,
"line": 7,
},
"start": Object {
- "column": 4,
+ "column": 26,
"line": 7,
},
},
"range": Array [
- 80,
- 81,
+ 165,
+ 166,
],
"type": "Punctuator",
"value": "<",
@@ -7890,17 +10407,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 6,
+ "column": 28,
"line": 7,
},
"start": Object {
- "column": 5,
+ "column": 27,
"line": 7,
},
},
"range": Array [
- 81,
- 82,
+ 166,
+ 167,
],
"type": "Punctuator",
"value": "/",
@@ -7908,35 +10425,35 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 9,
+ "column": 32,
"line": 7,
},
"start": Object {
- "column": 6,
+ "column": 28,
"line": 7,
},
},
"range": Array [
- 82,
- 85,
+ 167,
+ 171,
],
"type": "JSXIdentifier",
- "value": "Foo",
+ "value": "span",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
+ "column": 33,
"line": 7,
},
"start": Object {
- "column": 9,
+ "column": 32,
"line": 7,
},
},
"range": Array [
- 85,
- 86,
+ 171,
+ 172,
],
"type": "Punctuator",
"value": ">",
@@ -7944,497 +10461,269 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 3,
- "line": 8,
+ "column": 51,
+ "line": 7,
},
"start": Object {
- "column": 2,
- "line": 8,
+ "column": 33,
+ "line": 7,
},
},
"range": Array [
- 89,
- 90,
+ 172,
+ 190,
],
- "type": "Punctuator",
- "value": ")",
+ "type": "JSXText",
+ "value": "http://example.com",
},
Object {
"loc": Object {
"end": Object {
- "column": 4,
- "line": 8,
+ "column": 52,
+ "line": 7,
},
"start": Object {
- "column": 3,
- "line": 8,
+ "column": 51,
+ "line": 7,
},
},
"range": Array [
- 90,
- 91,
+ 190,
+ 191,
],
"type": "Punctuator",
- "value": ";",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 1,
- "line": 9,
+ "column": 53,
+ "line": 7,
},
"start": Object {
- "column": 0,
- "line": 9,
+ "column": 52,
+ "line": 7,
},
},
"range": Array [
- 92,
- 93,
+ 191,
+ 192,
],
"type": "Punctuator",
- "value": "}",
+ "value": "/",
},
- ],
- "type": "Program",
-}
-`;
-
-exports[`Comments fixtures/jsx-text-with-url.src 1`] = `
-Object {
- "body": Array [
Object {
- "declarations": Array [
- Object {
- "id": Object {
- "loc": Object {
- "end": Object {
- "column": 10,
- "line": 1,
- },
- "start": Object {
- "column": 6,
- "line": 1,
- },
- },
- "name": "link",
- "range": Array [
- 6,
- 10,
- ],
- "type": "Identifier",
- },
- "init": Object {
- "children": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 61,
- "line": 1,
- },
- "start": Object {
- "column": 43,
- "line": 1,
- },
- },
- "range": Array [
- 43,
- 61,
- ],
- "raw": "http://example.com",
- "type": "JSXText",
- "value": "http://example.com",
- },
- ],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 65,
- "line": 1,
- },
- "start": Object {
- "column": 61,
- "line": 1,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 64,
- "line": 1,
- },
- "start": Object {
- "column": 63,
- "line": 1,
- },
- },
- "name": "a",
- "range": Array [
- 63,
- 64,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 61,
- 65,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 65,
- "line": 1,
- },
- "start": Object {
- "column": 14,
- "line": 1,
- },
- },
- "openingElement": Object {
- "attributes": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 42,
- "line": 1,
- },
- "start": Object {
- "column": 17,
- "line": 1,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 1,
- },
- "start": Object {
- "column": 17,
- "line": 1,
- },
- },
- "name": "href",
- "range": Array [
- 17,
- 21,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 17,
- 42,
- ],
- "type": "JSXAttribute",
- "value": Object {
- "loc": Object {
- "end": Object {
- "column": 42,
- "line": 1,
- },
- "start": Object {
- "column": 22,
- "line": 1,
- },
- },
- "range": Array [
- 22,
- 42,
- ],
- "raw": "\\"http://example.com\\"",
- "type": "Literal",
- "value": "http://example.com",
- },
- },
- ],
- "loc": Object {
- "end": Object {
- "column": 43,
- "line": 1,
- },
- "start": Object {
- "column": 14,
- "line": 1,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 16,
- "line": 1,
- },
- "start": Object {
- "column": 15,
- "line": 1,
- },
- },
- "name": "a",
- "range": Array [
- 15,
- 16,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 14,
- 43,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- },
- "range": Array [
- 14,
- 65,
- ],
- "type": "JSXElement",
- },
- "loc": Object {
- "end": Object {
- "column": 66,
- "line": 1,
- },
- "start": Object {
- "column": 6,
- "line": 1,
- },
- },
- "range": Array [
- 6,
- 66,
- ],
- "type": "VariableDeclarator",
- },
- ],
- "kind": "const",
"loc": Object {
"end": Object {
- "column": 67,
- "line": 1,
+ "column": 56,
+ "line": 7,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 53,
+ "line": 7,
},
},
"range": Array [
- 0,
- 67,
+ 192,
+ 195,
],
- "type": "VariableDeclaration",
- },
- ],
- "comments": Array [],
- "loc": Object {
- "end": Object {
- "column": 0,
- "line": 2,
- },
- "start": Object {
- "column": 0,
- "line": 1,
+ "type": "JSXIdentifier",
+ "value": "div",
},
- },
- "range": Array [
- 0,
- 68,
- ],
- "sourceType": "module",
- "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 1,
+ "column": 57,
+ "line": 7,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 56,
+ "line": 7,
},
},
"range": Array [
- 0,
- 5,
+ 195,
+ 196,
],
- "type": "Keyword",
- "value": "const",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 1,
+ "column": 58,
+ "line": 7,
},
"start": Object {
- "column": 6,
- "line": 1,
+ "column": 57,
+ "line": 7,
},
},
"range": Array [
- 6,
- 10,
+ 196,
+ 197,
],
- "type": "Identifier",
- "value": "link",
+ "type": "Punctuator",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 1,
+ "column": 5,
+ "line": 9,
},
"start": Object {
- "column": 11,
- "line": 1,
+ "column": 0,
+ "line": 9,
},
},
"range": Array [
- 11,
- 12,
+ 199,
+ 204,
],
- "type": "Punctuator",
- "value": "=",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 1,
+ "column": 11,
+ "line": 9,
},
"start": Object {
- "column": 13,
- "line": 1,
+ "column": 6,
+ "line": 9,
},
},
"range": Array [
- 13,
- 14,
+ 205,
+ 210,
],
- "type": "Punctuator",
- "value": "(",
+ "type": "Identifier",
+ "value": "fifth",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 1,
+ "column": 13,
+ "line": 9,
},
"start": Object {
- "column": 14,
- "line": 1,
+ "column": 12,
+ "line": 9,
},
},
"range": Array [
- 14,
- 15,
+ 211,
+ 212,
],
"type": "Punctuator",
- "value": "<",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 16,
- "line": 1,
+ "column": 15,
+ "line": 9,
},
"start": Object {
- "column": 15,
- "line": 1,
+ "column": 14,
+ "line": 9,
},
},
"range": Array [
- 15,
- 16,
+ 213,
+ 214,
],
- "type": "JSXIdentifier",
- "value": "a",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 21,
- "line": 1,
+ "column": 18,
+ "line": 9,
},
"start": Object {
- "column": 17,
- "line": 1,
+ "column": 15,
+ "line": 9,
},
},
"range": Array [
- 17,
- 21,
+ 214,
+ 217,
],
"type": "JSXIdentifier",
- "value": "href",
+ "value": "div",
},
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 1,
+ "column": 19,
+ "line": 9,
},
"start": Object {
- "column": 21,
- "line": 1,
+ "column": 18,
+ "line": 9,
},
},
"range": Array [
- 21,
- 22,
+ 217,
+ 218,
],
"type": "Punctuator",
- "value": "=",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 42,
- "line": 1,
+ "column": 20,
+ "line": 9,
},
"start": Object {
- "column": 22,
- "line": 1,
+ "column": 19,
+ "line": 9,
},
},
"range": Array [
- 22,
- 42,
+ 218,
+ 219,
],
- "type": "JSXText",
- "value": "\\"http://example.com\\"",
+ "type": "Punctuator",
+ "value": "{",
},
Object {
"loc": Object {
"end": Object {
- "column": 43,
- "line": 1,
+ "column": 21,
+ "line": 9,
},
"start": Object {
- "column": 42,
- "line": 1,
+ "column": 20,
+ "line": 9,
},
},
"range": Array [
- 42,
- 43,
+ 219,
+ 220,
],
"type": "Punctuator",
- "value": ">",
+ "value": "}",
},
Object {
"loc": Object {
"end": Object {
- "column": 61,
- "line": 1,
+ "column": 39,
+ "line": 9,
},
"start": Object {
- "column": 43,
- "line": 1,
+ "column": 21,
+ "line": 9,
},
},
"range": Array [
- 43,
- 61,
+ 220,
+ 238,
],
"type": "JSXText",
"value": "http://example.com",
@@ -8442,17 +10731,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 62,
- "line": 1,
+ "column": 40,
+ "line": 9,
},
"start": Object {
- "column": 61,
- "line": 1,
+ "column": 39,
+ "line": 9,
},
},
"range": Array [
- 61,
- 62,
+ 238,
+ 239,
],
"type": "Punctuator",
"value": "<",
@@ -8460,17 +10749,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 63,
- "line": 1,
+ "column": 41,
+ "line": 9,
},
"start": Object {
- "column": 62,
- "line": 1,
+ "column": 40,
+ "line": 9,
},
},
"range": Array [
- 62,
- 63,
+ 239,
+ 240,
],
"type": "Punctuator",
"value": "/",
@@ -8478,35 +10767,35 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 64,
- "line": 1,
+ "column": 44,
+ "line": 9,
},
"start": Object {
- "column": 63,
- "line": 1,
+ "column": 41,
+ "line": 9,
},
},
"range": Array [
- 63,
- 64,
+ 240,
+ 243,
],
"type": "JSXIdentifier",
- "value": "a",
+ "value": "div",
},
Object {
"loc": Object {
"end": Object {
- "column": 65,
- "line": 1,
+ "column": 45,
+ "line": 9,
},
"start": Object {
- "column": 64,
- "line": 1,
+ "column": 44,
+ "line": 9,
},
},
"range": Array [
- 64,
- 65,
+ 243,
+ 244,
],
"type": "Punctuator",
"value": ">",
@@ -8514,35 +10803,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 66,
- "line": 1,
- },
- "start": Object {
- "column": 65,
- "line": 1,
- },
- },
- "range": Array [
- 65,
- 66,
- ],
- "type": "Punctuator",
- "value": ")",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 67,
- "line": 1,
+ "column": 46,
+ "line": 9,
},
"start": Object {
- "column": 66,
- "line": 1,
+ "column": 45,
+ "line": 9,
},
},
"range": Array [
- 66,
- 67,
+ 244,
+ 245,
],
"type": "Punctuator",
"value": ";",
diff --git a/packages/shared-fixtures/fixtures/comments/jsx-attr-and-text-with-url.src.js b/packages/shared-fixtures/fixtures/comments/jsx-attr-and-text-with-url.src.js
new file mode 100644
index 00000000000..ab57e8d95da
--- /dev/null
+++ b/packages/shared-fixtures/fixtures/comments/jsx-attr-and-text-with-url.src.js
@@ -0,0 +1 @@
+const link = (http://example.com);
diff --git a/packages/shared-fixtures/fixtures/comments/jsx-text-with-url.src.js b/packages/shared-fixtures/fixtures/comments/jsx-text-with-url.src.js
index ab57e8d95da..a20de1676b9 100644
--- a/packages/shared-fixtures/fixtures/comments/jsx-text-with-url.src.js
+++ b/packages/shared-fixtures/fixtures/comments/jsx-text-with-url.src.js
@@ -1 +1,9 @@
-const link = (http://example.com);
+const first =
http://example.com
;
+
+const second = <>http://example.com>;
+
+const third =
http://example.com
;
+
+const fourth = http://example.com
;
+
+const fifth = {}http://example.com
;
diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts
index 15900403914..159c24cf3ef 100644
--- a/packages/typescript-estree/src/convert-comments.ts
+++ b/packages/typescript-estree/src/convert-comments.ts
@@ -118,13 +118,24 @@ export function convertComments(
case ts.SyntaxKind.GreaterThanToken:
container = getNodeContainer(ast, start, end);
if (
- container &&
- container.parent &&
- container.parent.kind === ts.SyntaxKind.JsxOpeningElement &&
- // Make sure this is the end of the opening element and not type parameter
- end === container.parent.end &&
- container.parent.parent &&
- container.parent.parent.kind === ts.SyntaxKind.JsxElement
+ (container.parent &&
+ container.parent.parent &&
+ // Rescan after an opening element or fragment
+ (container.parent.kind === ts.SyntaxKind.JsxOpeningElement &&
+ // Make sure this is the end of a tag like `>`
+ container.parent.end === end)) ||
+ container.parent.kind === ts.SyntaxKind.JsxOpeningFragment ||
+ // Rescan after a self-closing element if it's inside another JSX element
+ (container.parent.kind === ts.SyntaxKind.JsxSelfClosingElement &&
+ (container.parent.parent.kind === ts.SyntaxKind.JsxElement ||
+ container.parent.parent.kind === ts.SyntaxKind.JsxFragment)) ||
+ // Rescan after a closing element if it's inside another JSX element
+ ((container.parent.kind === ts.SyntaxKind.JsxClosingElement ||
+ container.parent.kind === ts.SyntaxKind.JsxClosingFragment) &&
+ container.parent.parent.parent &&
+ (container.parent.parent.parent.kind === ts.SyntaxKind.JsxElement ||
+ container.parent.parent.parent.kind ===
+ ts.SyntaxKind.JsxFragment))
) {
kind = triviaScanner.reScanJsxToken();
continue;
@@ -133,6 +144,15 @@ export function convertComments(
case ts.SyntaxKind.CloseBraceToken:
container = getNodeContainer(ast, start, end);
+ // Rescan after a JSX expression
+ if (
+ container.parent &&
+ container.parent.kind === ts.SyntaxKind.JsxExpression
+ ) {
+ kind = triviaScanner.reScanJsxToken();
+ continue;
+ }
+
if (
container.kind === ts.SyntaxKind.TemplateMiddle ||
container.kind === ts.SyntaxKind.TemplateTail
diff --git a/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap
index ba119ad7aa5..e143fdb8524 100644
--- a/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap
+++ b/packages/typescript-estree/tests/lib/__snapshots__/comments.ts.snap
@@ -1171,7 +1171,7 @@ Object {
}
`;
-exports[`Comments fixtures/jsx-block-comment.src 1`] = `
+exports[`Comments fixtures/jsx-attr-and-text-with-url.src 1`] = `
Object {
"body": Array [
Object {
@@ -1188,7 +1188,7 @@ Object {
"line": 1,
},
},
- "name": "pure",
+ "name": "link",
"range": Array [
6,
10,
@@ -1196,234 +1196,174 @@ Object {
"type": "Identifier",
},
"init": Object {
- "async": false,
- "body": Object {
- "body": Array [
- Object {
- "argument": Object {
- "children": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 12,
- "line": 4,
- },
- "start": Object {
- "column": 13,
- "line": 3,
- },
- },
- "range": Array [
- 47,
- 60,
- ],
- "raw": "
- ",
- "type": "Literal",
- "value": "
- ",
- },
- Object {
- "expression": Object {
- "loc": Object {
- "end": Object {
- "column": 24,
- "line": 4,
- },
- "start": Object {
- "column": 13,
- "line": 4,
- },
- },
- "range": Array [
- 61,
- 72,
- ],
- "type": "JSXEmptyExpression",
- },
- "loc": Object {
- "end": Object {
- "column": 25,
- "line": 4,
- },
- "start": Object {
- "column": 12,
- "line": 4,
- },
- },
- "range": Array [
- 60,
- 73,
- ],
- "type": "JSXExpressionContainer",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 8,
- "line": 5,
- },
- "start": Object {
- "column": 25,
- "line": 4,
- },
- },
- "range": Array [
- 73,
- 82,
- ],
- "raw": "
- ",
- "type": "Literal",
- "value": "
- ",
- },
- ],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 5,
- },
- "start": Object {
- "column": 8,
- "line": 5,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 13,
- "line": 5,
- },
- "start": Object {
- "column": 10,
- "line": 5,
- },
- },
- "name": "Foo",
- "range": Array [
- 84,
- 87,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 82,
- 88,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 5,
- },
- "start": Object {
- "column": 8,
- "line": 3,
- },
- },
- "openingElement": Object {
- "attributes": Array [],
- "loc": Object {
- "end": Object {
- "column": 13,
- "line": 3,
- },
- "start": Object {
- "column": 8,
- "line": 3,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 12,
- "line": 3,
- },
- "start": Object {
- "column": 9,
- "line": 3,
- },
- },
- "name": "Foo",
- "range": Array [
- 43,
- 46,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 42,
- 47,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- },
- "range": Array [
- 42,
- 88,
- ],
- "type": "JSXElement",
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 61,
+ "line": 1,
},
- "loc": Object {
- "end": Object {
- "column": 6,
- "line": 6,
- },
- "start": Object {
- "column": 4,
- "line": 2,
- },
+ "start": Object {
+ "column": 43,
+ "line": 1,
},
- "range": Array [
- 25,
- 95,
- ],
- "type": "ReturnStatement",
},
- ],
+ "range": Array [
+ 43,
+ 61,
+ ],
+ "raw": "http://example.com",
+ "type": "Literal",
+ "value": "http://example.com",
+ },
+ ],
+ "closingElement": Object {
"loc": Object {
"end": Object {
- "column": 1,
- "line": 7,
+ "column": 65,
+ "line": 1,
},
"start": Object {
- "column": 19,
+ "column": 61,
"line": 1,
},
},
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 64,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 63,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "range": Array [
+ 63,
+ 64,
+ ],
+ "type": "JSXIdentifier",
+ },
"range": Array [
- 19,
- 97,
+ 61,
+ 65,
],
- "type": "BlockStatement",
+ "type": "JSXClosingElement",
},
- "expression": false,
- "generator": false,
- "id": null,
"loc": Object {
"end": Object {
- "column": 1,
- "line": 7,
+ "column": 65,
+ "line": 1,
},
"start": Object {
- "column": 13,
+ "column": 14,
"line": 1,
},
},
- "params": Array [],
- "range": Array [
- 13,
- 97,
- ],
- "type": "ArrowFunctionExpression",
- },
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 7,
+ "openingElement": Object {
+ "attributes": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 17,
+ "line": 1,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 17,
+ "line": 1,
+ },
+ },
+ "name": "href",
+ "range": Array [
+ 17,
+ 21,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 17,
+ 42,
+ ],
+ "type": "JSXAttribute",
+ "value": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 22,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 22,
+ 42,
+ ],
+ "raw": "\\"http://example.com\\"",
+ "type": "Literal",
+ "value": "http://example.com",
+ },
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 16,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "name": "a",
+ "range": Array [
+ 15,
+ 16,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 14,
+ 43,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 14,
+ 65,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 66,
+ "line": 1,
},
"start": Object {
"column": 6,
@@ -1432,7 +1372,7 @@ Object {
},
"range": Array [
6,
- 97,
+ 66,
],
"type": "VariableDeclarator",
},
@@ -1440,8 +1380,8 @@ Object {
"kind": "const",
"loc": Object {
"end": Object {
- "column": 1,
- "line": 7,
+ "column": 67,
+ "line": 1,
},
"start": Object {
"column": 0,
@@ -1450,35 +1390,16 @@ Object {
},
"range": Array [
0,
- 97,
+ 67,
],
"type": "VariableDeclaration",
},
],
- "comments": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 24,
- "line": 4,
- },
- "start": Object {
- "column": 13,
- "line": 4,
- },
- },
- "range": Array [
- 61,
- 72,
- ],
- "type": "Block",
- "value": "COMMENT",
- },
- ],
+ "comments": Array [],
"loc": Object {
"end": Object {
"column": 0,
- "line": 8,
+ "line": 2,
},
"start": Object {
"column": 0,
@@ -1487,7 +1408,7 @@ Object {
},
"range": Array [
0,
- 98,
+ 68,
],
"sourceType": "script",
"tokens": Array [
@@ -1525,7 +1446,7 @@ Object {
10,
],
"type": "Identifier",
- "value": "pure",
+ "value": "link",
},
Object {
"loc": Object {
@@ -1579,89 +1500,89 @@ Object {
15,
],
"type": "Punctuator",
- "value": ")",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 18,
+ "column": 16,
"line": 1,
},
"start": Object {
- "column": 16,
+ "column": 15,
"line": 1,
},
},
"range": Array [
+ 15,
16,
- 18,
],
- "type": "Punctuator",
- "value": "=>",
+ "type": "JSXIdentifier",
+ "value": "a",
},
Object {
"loc": Object {
"end": Object {
- "column": 20,
+ "column": 21,
"line": 1,
},
"start": Object {
- "column": 19,
+ "column": 17,
"line": 1,
},
},
"range": Array [
- 19,
- 20,
+ 17,
+ 21,
],
- "type": "Punctuator",
- "value": "{",
+ "type": "JSXIdentifier",
+ "value": "href",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 2,
+ "column": 22,
+ "line": 1,
},
"start": Object {
- "column": 4,
- "line": 2,
+ "column": 21,
+ "line": 1,
},
},
"range": Array [
- 25,
- 31,
+ 21,
+ 22,
],
- "type": "Keyword",
- "value": "return",
+ "type": "Punctuator",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 2,
+ "column": 42,
+ "line": 1,
},
"start": Object {
- "column": 11,
- "line": 2,
+ "column": 22,
+ "line": 1,
},
},
"range": Array [
- 32,
- 33,
+ 22,
+ 42,
],
- "type": "Punctuator",
- "value": "(",
+ "type": "JSXText",
+ "value": "\\"http://example.com\\"",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 3,
+ "column": 43,
+ "line": 1,
},
"start": Object {
- "column": 8,
- "line": 3,
+ "column": 42,
+ "line": 1,
},
},
"range": Array [
@@ -1669,186 +1590,94 @@ Object {
43,
],
"type": "Punctuator",
- "value": "<",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 3,
+ "column": 61,
+ "line": 1,
},
"start": Object {
- "column": 9,
- "line": 3,
+ "column": 43,
+ "line": 1,
},
},
"range": Array [
43,
- 46,
+ 61,
],
- "type": "JSXIdentifier",
- "value": "Foo",
+ "type": "JSXText",
+ "value": "http://example.com",
},
Object {
"loc": Object {
"end": Object {
- "column": 13,
- "line": 3,
+ "column": 62,
+ "line": 1,
},
"start": Object {
- "column": 12,
- "line": 3,
+ "column": 61,
+ "line": 1,
},
},
"range": Array [
- 46,
- 47,
+ 61,
+ 62,
],
"type": "Punctuator",
- "value": ">",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 4,
+ "column": 63,
+ "line": 1,
},
"start": Object {
- "column": 13,
- "line": 3,
+ "column": 62,
+ "line": 1,
},
},
"range": Array [
- 47,
- 60,
+ 62,
+ 63,
],
- "type": "JSXText",
- "value": "
- ",
+ "type": "Punctuator",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 13,
- "line": 4,
+ "column": 64,
+ "line": 1,
},
"start": Object {
- "column": 12,
- "line": 4,
- },
- },
- "range": Array [
- 60,
- 61,
- ],
- "type": "Punctuator",
- "value": "{",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 25,
- "line": 4,
- },
- "start": Object {
- "column": 24,
- "line": 4,
- },
- },
- "range": Array [
- 72,
- 73,
- ],
- "type": "Punctuator",
- "value": "}",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 8,
- "line": 5,
- },
- "start": Object {
- "column": 25,
- "line": 4,
- },
- },
- "range": Array [
- 73,
- 82,
- ],
- "type": "JSXText",
- "value": "
- ",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 9,
- "line": 5,
- },
- "start": Object {
- "column": 8,
- "line": 5,
- },
- },
- "range": Array [
- 82,
- 83,
- ],
- "type": "Punctuator",
- "value": "<",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 10,
- "line": 5,
- },
- "start": Object {
- "column": 9,
- "line": 5,
- },
- },
- "range": Array [
- 83,
- 84,
- ],
- "type": "Punctuator",
- "value": "/",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 13,
- "line": 5,
- },
- "start": Object {
- "column": 10,
- "line": 5,
+ "column": 63,
+ "line": 1,
},
},
"range": Array [
- 84,
- 87,
+ 63,
+ 64,
],
"type": "JSXIdentifier",
- "value": "Foo",
+ "value": "a",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 5,
+ "column": 65,
+ "line": 1,
},
"start": Object {
- "column": 13,
- "line": 5,
+ "column": 64,
+ "line": 1,
},
},
"range": Array [
- 87,
- 88,
+ 64,
+ 65,
],
"type": "Punctuator",
"value": ">",
@@ -1856,17 +1685,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 6,
+ "column": 66,
+ "line": 1,
},
"start": Object {
- "column": 4,
- "line": 6,
+ "column": 65,
+ "line": 1,
},
},
"range": Array [
- 93,
- 94,
+ 65,
+ 66,
],
"type": "Punctuator",
"value": ")",
@@ -1874,45 +1703,27 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 6,
+ "column": 67,
+ "line": 1,
},
"start": Object {
- "column": 5,
- "line": 6,
+ "column": 66,
+ "line": 1,
},
},
"range": Array [
- 94,
- 95,
+ 66,
+ 67,
],
"type": "Punctuator",
"value": ";",
},
- Object {
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 7,
- },
- "start": Object {
- "column": 0,
- "line": 7,
- },
- },
- "range": Array [
- 96,
- 97,
- ],
- "type": "Punctuator",
- "value": "}",
- },
],
"type": "Program",
}
`;
-exports[`Comments fixtures/jsx-comment-after-jsx.src 1`] = `
+exports[`Comments fixtures/jsx-block-comment.src 1`] = `
Object {
"body": Array [
Object {
@@ -1942,99 +1753,176 @@ Object {
"body": Array [
Object {
"argument": Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 19,
- "line": 3,
- },
- "start": Object {
- "column": 13,
- "line": 3,
- },
- },
- "name": Object {
+ "children": Array [
+ Object {
"loc": Object {
"end": Object {
- "column": 18,
- "line": 3,
+ "column": 12,
+ "line": 4,
},
"start": Object {
- "column": 15,
+ "column": 13,
"line": 3,
},
},
- "name": "Foo",
"range": Array [
- 49,
- 52,
+ 47,
+ 60,
],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 47,
- 53,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 19,
- "line": 3,
- },
- "start": Object {
- "column": 8,
- "line": 3,
+ "raw": "
+ ",
+ "type": "Literal",
+ "value": "
+ ",
},
- },
- "openingElement": Object {
- "attributes": Array [],
- "loc": Object {
- "end": Object {
- "column": 13,
- "line": 3,
- },
- "start": Object {
- "column": 8,
- "line": 3,
+ Object {
+ "expression": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 24,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 61,
+ 72,
+ ],
+ "type": "JSXEmptyExpression",
},
- },
- "name": Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 3,
+ "column": 25,
+ "line": 4,
},
"start": Object {
- "column": 9,
- "line": 3,
+ "column": 12,
+ "line": 4,
},
},
- "name": "Foo",
"range": Array [
- 43,
- 46,
+ 60,
+ 73,
],
- "type": "JSXIdentifier",
+ "type": "JSXExpressionContainer",
},
- "range": Array [
- 42,
- 47,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- },
- "range": Array [
- 42,
- 53,
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 8,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 25,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 73,
+ 82,
+ ],
+ "raw": "
+ ",
+ "type": "Literal",
+ "value": "
+ ",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 13,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 10,
+ "line": 5,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 84,
+ 87,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 82,
+ 88,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 13,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 9,
+ "line": 3,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 43,
+ 46,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 42,
+ 47,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 42,
+ 88,
],
"type": "JSXElement",
},
"loc": Object {
"end": Object {
"column": 6,
- "line": 4,
+ "line": 6,
},
"start": Object {
"column": 4,
@@ -2043,7 +1931,7 @@ Object {
},
"range": Array [
25,
- 67,
+ 95,
],
"type": "ReturnStatement",
},
@@ -2051,7 +1939,7 @@ Object {
"loc": Object {
"end": Object {
"column": 1,
- "line": 5,
+ "line": 7,
},
"start": Object {
"column": 19,
@@ -2060,7 +1948,7 @@ Object {
},
"range": Array [
19,
- 69,
+ 97,
],
"type": "BlockStatement",
},
@@ -2070,7 +1958,7 @@ Object {
"loc": Object {
"end": Object {
"column": 1,
- "line": 5,
+ "line": 7,
},
"start": Object {
"column": 13,
@@ -2080,14 +1968,14 @@ Object {
"params": Array [],
"range": Array [
13,
- 69,
+ 97,
],
"type": "ArrowFunctionExpression",
},
"loc": Object {
"end": Object {
"column": 1,
- "line": 5,
+ "line": 7,
},
"start": Object {
"column": 6,
@@ -2096,7 +1984,7 @@ Object {
},
"range": Array [
6,
- 69,
+ 97,
],
"type": "VariableDeclarator",
},
@@ -2105,7 +1993,7 @@ Object {
"loc": Object {
"end": Object {
"column": 1,
- "line": 5,
+ "line": 7,
},
"start": Object {
"column": 0,
@@ -2114,7 +2002,7 @@ Object {
},
"range": Array [
0,
- 69,
+ 97,
],
"type": "VariableDeclaration",
},
@@ -2123,26 +2011,26 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 26,
- "line": 3,
+ "column": 24,
+ "line": 4,
},
"start": Object {
- "column": 20,
- "line": 3,
+ "column": 13,
+ "line": 4,
},
},
"range": Array [
- 54,
- 60,
+ 61,
+ 72,
],
- "type": "Line",
- "value": " Foo",
+ "type": "Block",
+ "value": "COMMENT",
},
],
"loc": Object {
"end": Object {
"column": 0,
- "line": 6,
+ "line": 8,
},
"start": Object {
"column": 0,
@@ -2151,7 +2039,7 @@ Object {
},
"range": Array [
0,
- 70,
+ 98,
],
"sourceType": "script",
"tokens": Array [
@@ -2374,8 +2262,8 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 3,
+ "column": 12,
+ "line": 4,
},
"start": Object {
"column": 13,
@@ -2384,131 +2272,205 @@ Object {
},
"range": Array [
47,
- 48,
+ 60,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "JSXText",
+ "value": "
+ ",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 3,
+ "column": 13,
+ "line": 4,
},
"start": Object {
- "column": 14,
- "line": 3,
+ "column": 12,
+ "line": 4,
},
},
"range": Array [
- 48,
- 49,
+ 60,
+ 61,
],
"type": "Punctuator",
- "value": "/",
+ "value": "{",
},
Object {
"loc": Object {
"end": Object {
- "column": 18,
- "line": 3,
+ "column": 25,
+ "line": 4,
},
"start": Object {
- "column": 15,
- "line": 3,
+ "column": 24,
+ "line": 4,
},
},
"range": Array [
- 49,
- 52,
+ 72,
+ 73,
],
- "type": "JSXIdentifier",
- "value": "Foo",
+ "type": "Punctuator",
+ "value": "}",
},
Object {
"loc": Object {
"end": Object {
- "column": 19,
- "line": 3,
+ "column": 8,
+ "line": 5,
},
"start": Object {
- "column": 18,
- "line": 3,
+ "column": 25,
+ "line": 4,
},
},
"range": Array [
- 52,
- 53,
+ 73,
+ 82,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "JSXText",
+ "value": "
+ ",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 4,
+ "column": 9,
+ "line": 5,
},
"start": Object {
- "column": 4,
- "line": 4,
+ "column": 8,
+ "line": 5,
},
},
"range": Array [
- 65,
- 66,
+ 82,
+ 83,
],
"type": "Punctuator",
- "value": ")",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 4,
+ "column": 10,
+ "line": 5,
},
"start": Object {
- "column": 5,
- "line": 4,
+ "column": 9,
+ "line": 5,
},
},
"range": Array [
- 66,
- 67,
+ 83,
+ 84,
],
"type": "Punctuator",
- "value": ";",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 1,
+ "column": 13,
"line": 5,
},
"start": Object {
- "column": 0,
+ "column": 10,
"line": 5,
},
},
"range": Array [
- 68,
- 69,
+ 84,
+ 87,
],
- "type": "Punctuator",
- "value": "}",
+ "type": "JSXIdentifier",
+ "value": "Foo",
},
- ],
- "type": "Program",
-}
-`;
-
-exports[`Comments fixtures/jsx-comment-after-self-closing-jsx.src 1`] = `
-Object {
- "body": Array [
Object {
- "declarations": Array [
- Object {
- "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 87,
+ 88,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 93,
+ 94,
+ ],
+ "type": "Punctuator",
+ "value": ")",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 6,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 94,
+ 95,
+ ],
+ "type": "Punctuator",
+ "value": ";",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 7,
+ },
+ },
+ "range": Array [
+ 96,
+ 97,
+ ],
+ "type": "Punctuator",
+ "value": "}",
+ },
+ ],
+ "type": "Program",
+}
+`;
+
+exports[`Comments fixtures/jsx-comment-after-jsx.src 1`] = `
+Object {
+ "body": Array [
+ Object {
+ "declarations": Array [
+ Object {
+ "id": Object {
"loc": Object {
"end": Object {
"column": 10,
@@ -2533,10 +2495,44 @@ Object {
Object {
"argument": Object {
"children": Array [],
- "closingElement": null,
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 49,
+ 52,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 47,
+ 53,
+ ],
+ "type": "JSXClosingElement",
+ },
"loc": Object {
"end": Object {
- "column": 15,
+ "column": 19,
"line": 3,
},
"start": Object {
@@ -2548,7 +2544,7 @@ Object {
"attributes": Array [],
"loc": Object {
"end": Object {
- "column": 15,
+ "column": 13,
"line": 3,
},
"start": Object {
@@ -2576,14 +2572,14 @@ Object {
},
"range": Array [
42,
- 49,
+ 47,
],
- "selfClosing": true,
+ "selfClosing": false,
"type": "JSXOpeningElement",
},
"range": Array [
42,
- 49,
+ 53,
],
"type": "JSXElement",
},
@@ -2599,7 +2595,7 @@ Object {
},
"range": Array [
25,
- 63,
+ 67,
],
"type": "ReturnStatement",
},
@@ -2616,7 +2612,7 @@ Object {
},
"range": Array [
19,
- 65,
+ 69,
],
"type": "BlockStatement",
},
@@ -2636,7 +2632,7 @@ Object {
"params": Array [],
"range": Array [
13,
- 65,
+ 69,
],
"type": "ArrowFunctionExpression",
},
@@ -2652,7 +2648,7 @@ Object {
},
"range": Array [
6,
- 65,
+ 69,
],
"type": "VariableDeclarator",
},
@@ -2670,7 +2666,7 @@ Object {
},
"range": Array [
0,
- 65,
+ 69,
],
"type": "VariableDeclaration",
},
@@ -2679,17 +2675,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 22,
+ "column": 26,
"line": 3,
},
"start": Object {
- "column": 16,
+ "column": 20,
"line": 3,
},
},
"range": Array [
- 50,
- 56,
+ 54,
+ 60,
],
"type": "Line",
"value": " Foo",
@@ -2707,7 +2703,7 @@ Object {
},
"range": Array [
0,
- 66,
+ 70,
],
"sourceType": "script",
"tokens": Array [
@@ -2909,6 +2905,24 @@ Object {
"type": "JSXIdentifier",
"value": "Foo",
},
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 13,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 12,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 46,
+ 47,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
Object {
"loc": Object {
"end": Object {
@@ -2925,7 +2939,7 @@ Object {
48,
],
"type": "Punctuator",
- "value": "/",
+ "value": "<",
},
Object {
"loc": Object {
@@ -2943,6 +2957,42 @@ Object {
49,
],
"type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 49,
+ 52,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Foo",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 18,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 52,
+ 53,
+ ],
+ "type": "Punctuator",
"value": ">",
},
Object {
@@ -2957,8 +3007,8 @@ Object {
},
},
"range": Array [
- 61,
- 62,
+ 65,
+ 66,
],
"type": "Punctuator",
"value": ")",
@@ -2975,8 +3025,8 @@ Object {
},
},
"range": Array [
- 62,
- 63,
+ 66,
+ 67,
],
"type": "Punctuator",
"value": ";",
@@ -2993,8 +3043,8 @@ Object {
},
},
"range": Array [
- 64,
- 65,
+ 68,
+ 69,
],
"type": "Punctuator",
"value": "}",
@@ -3004,7 +3054,7 @@ Object {
}
`;
-exports[`Comments fixtures/jsx-generic-with-comment-in-tag.src 1`] = `
+exports[`Comments fixtures/jsx-comment-after-self-closing-jsx.src 1`] = `
Object {
"body": Array [
Object {
@@ -3021,7 +3071,7 @@ Object {
"line": 1,
},
},
- "name": "comp",
+ "name": "pure",
"range": Array [
6,
10,
@@ -3029,792 +3079,1294 @@ Object {
"type": "Identifier",
},
"init": Object {
- "children": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 3,
- },
- "start": Object {
- "column": 4,
- "line": 2,
- },
- },
- "range": Array [
- 19,
- 24,
- ],
- "raw": "
- ",
- "type": "Literal",
- "value": "
- ",
- },
- Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 50,
- "line": 3,
- },
- "start": Object {
- "column": 38,
- "line": 3,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 49,
- "line": 3,
- },
- "start": Object {
- "column": 40,
- "line": 3,
- },
- },
- "name": "Component",
- "range": Array [
- 60,
- 69,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 58,
- 70,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 50,
- "line": 3,
- },
- "start": Object {
- "column": 4,
- "line": 3,
- },
- },
- "openingElement": Object {
- "attributes": Array [],
- "loc": Object {
- "end": Object {
- "column": 38,
- "line": 3,
- },
- "start": Object {
- "column": 4,
- "line": 3,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 3,
- },
- "start": Object {
- "column": 5,
- "line": 3,
- },
- },
- "name": "Component",
- "range": Array [
- 25,
- 34,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 24,
- 58,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- "typeParameters": Object {
+ "async": false,
+ "body": Object {
+ "body": Array [
+ Object {
+ "argument": Object {
+ "children": Array [],
+ "closingElement": null,
"loc": Object {
"end": Object {
- "column": 22,
+ "column": 15,
"line": 3,
},
"start": Object {
- "column": 14,
+ "column": 8,
"line": 3,
},
},
- "params": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 3,
- },
- "start": Object {
- "column": 15,
- "line": 3,
- },
- },
- "range": Array [
- 35,
- 41,
- ],
- "type": "TSNumberKeyword",
- },
- ],
- "range": Array [
- 34,
- 42,
- ],
- "type": "TSTypeParameterInstantiation",
- },
- },
- "range": Array [
- 24,
- 70,
- ],
- "type": "JSXElement",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 4,
- },
- "start": Object {
- "column": 50,
- "line": 3,
- },
- },
- "range": Array [
- 70,
- 75,
- ],
- "raw": "
- ",
- "type": "Literal",
- "value": "
- ",
- },
- Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 54,
- "line": 4,
- },
- "start": Object {
- "column": 42,
- "line": 4,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 53,
- "line": 4,
- },
- "start": Object {
- "column": 44,
- "line": 4,
- },
- },
- "name": "Component",
- "range": Array [
- 115,
- 124,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 113,
- 125,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 54,
- "line": 4,
- },
- "start": Object {
- "column": 4,
- "line": 4,
- },
- },
- "openingElement": Object {
- "attributes": Array [
- Object {
+ "openingElement": Object {
+ "attributes": Array [],
"loc": Object {
"end": Object {
- "column": 26,
- "line": 4,
+ "column": 15,
+ "line": 3,
},
"start": Object {
- "column": 23,
- "line": 4,
+ "column": 8,
+ "line": 3,
},
},
"name": Object {
"loc": Object {
"end": Object {
- "column": 26,
- "line": 4,
+ "column": 12,
+ "line": 3,
},
"start": Object {
- "column": 23,
- "line": 4,
+ "column": 9,
+ "line": 3,
},
},
- "name": "foo",
+ "name": "Foo",
"range": Array [
- 94,
- 97,
+ 43,
+ 46,
],
"type": "JSXIdentifier",
},
"range": Array [
- 94,
- 97,
+ 42,
+ 49,
],
- "type": "JSXAttribute",
- "value": null,
+ "selfClosing": true,
+ "type": "JSXOpeningElement",
},
- ],
+ "range": Array [
+ 42,
+ 49,
+ ],
+ "type": "JSXElement",
+ },
"loc": Object {
"end": Object {
- "column": 42,
+ "column": 6,
"line": 4,
},
"start": Object {
"column": 4,
- "line": 4,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 4,
- },
- "start": Object {
- "column": 5,
- "line": 4,
- },
+ "line": 2,
},
- "name": "Component",
- "range": Array [
- 76,
- 85,
- ],
- "type": "JSXIdentifier",
},
"range": Array [
- 75,
- 113,
+ 25,
+ 63,
],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- "typeParameters": Object {
- "loc": Object {
- "end": Object {
- "column": 22,
- "line": 4,
- },
- "start": Object {
- "column": 14,
- "line": 4,
- },
- },
- "params": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 4,
- },
- "start": Object {
- "column": 15,
- "line": 4,
- },
- },
- "range": Array [
- 86,
- 92,
- ],
- "type": "TSNumberKeyword",
- },
- ],
- "range": Array [
- 85,
- 93,
- ],
- "type": "TSTypeParameterInstantiation",
- },
- },
- "range": Array [
- 75,
- 125,
- ],
- "type": "JSXElement",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 5,
- },
- "start": Object {
- "column": 54,
- "line": 4,
- },
- },
- "range": Array [
- 125,
- 130,
- ],
- "raw": "
- ",
- "type": "Literal",
- "value": "
- ",
- },
- Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 54,
- "line": 5,
- },
- "start": Object {
- "column": 42,
- "line": 5,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 53,
- "line": 5,
- },
- "start": Object {
- "column": 44,
- "line": 5,
- },
- },
- "name": "Component",
- "range": Array [
- 170,
- 179,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 168,
- 180,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 54,
- "line": 5,
- },
- "start": Object {
- "column": 4,
- "line": 5,
- },
+ "type": "ReturnStatement",
},
- "openingElement": Object {
- "attributes": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 41,
- "line": 5,
- },
- "start": Object {
- "column": 38,
- "line": 5,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 41,
- "line": 5,
- },
- "start": Object {
- "column": 38,
- "line": 5,
- },
- },
- "name": "bar",
- "range": Array [
- 164,
- 167,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 164,
- 167,
- ],
- "type": "JSXAttribute",
- "value": null,
- },
- ],
- "loc": Object {
- "end": Object {
- "column": 42,
- "line": 5,
- },
- "start": Object {
- "column": 4,
- "line": 5,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 5,
- },
- "start": Object {
- "column": 5,
- "line": 5,
- },
- },
- "name": "Component",
- "range": Array [
- 131,
- 140,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 130,
- 168,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- "typeParameters": Object {
- "loc": Object {
- "end": Object {
- "column": 22,
- "line": 5,
- },
- "start": Object {
- "column": 14,
- "line": 5,
- },
- },
- "params": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 5,
- },
- "start": Object {
- "column": 15,
- "line": 5,
- },
- },
- "range": Array [
- 141,
- 147,
- ],
- "type": "TSNumberKeyword",
- },
- ],
- "range": Array [
- 140,
- 148,
- ],
- "type": "TSTypeParameterInstantiation",
- },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 5,
},
- "range": Array [
- 130,
- 180,
- ],
- "type": "JSXElement",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 6,
- },
- "start": Object {
- "column": 54,
- "line": 5,
- },
+ "start": Object {
+ "column": 19,
+ "line": 1,
},
- "range": Array [
- 180,
- 185,
- ],
- "raw": "
- ",
- "type": "Literal",
- "value": "
- ",
},
- Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 58,
- "line": 6,
- },
- "start": Object {
- "column": 46,
- "line": 6,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 57,
- "line": 6,
- },
- "start": Object {
- "column": 48,
- "line": 6,
- },
- },
- "name": "Component",
- "range": Array [
- 229,
- 238,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 227,
- 239,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 58,
- "line": 6,
- },
- "start": Object {
- "column": 4,
- "line": 6,
- },
- },
- "openingElement": Object {
- "attributes": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 26,
- "line": 6,
- },
- "start": Object {
- "column": 23,
- "line": 6,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 26,
- "line": 6,
- },
- "start": Object {
- "column": 23,
- "line": 6,
- },
- },
- "name": "foo",
- "range": Array [
- 204,
- 207,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 204,
- 207,
- ],
- "type": "JSXAttribute",
- "value": null,
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 45,
- "line": 6,
- },
- "start": Object {
- "column": 42,
- "line": 6,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 45,
- "line": 6,
- },
- "start": Object {
- "column": 42,
- "line": 6,
- },
- },
- "name": "bar",
- "range": Array [
- 223,
- 226,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 223,
- 226,
- ],
- "type": "JSXAttribute",
- "value": null,
- },
- ],
- "loc": Object {
- "end": Object {
- "column": 46,
- "line": 6,
- },
- "start": Object {
- "column": 4,
- "line": 6,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 6,
- },
- "start": Object {
- "column": 5,
- "line": 6,
- },
- },
- "name": "Component",
- "range": Array [
- 186,
- 195,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 185,
- 227,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- "typeParameters": Object {
- "loc": Object {
- "end": Object {
- "column": 22,
- "line": 6,
- },
- "start": Object {
- "column": 14,
- "line": 6,
- },
- },
- "params": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 6,
- },
- "start": Object {
- "column": 15,
- "line": 6,
- },
- },
- "range": Array [
- 196,
- 202,
- ],
- "type": "TSNumberKeyword",
- },
- ],
- "range": Array [
- 195,
- 203,
- ],
- "type": "TSTypeParameterInstantiation",
- },
- },
- "range": Array [
- 185,
- 239,
- ],
- "type": "JSXElement",
+ "range": Array [
+ 19,
+ 65,
+ ],
+ "type": "BlockStatement",
+ },
+ "expression": false,
+ "generator": false,
+ "id": null,
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 5,
},
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 8,
- },
- "start": Object {
- "column": 58,
- "line": 6,
- },
- },
- "range": Array [
- 239,
- 245,
- ],
- "raw": "
-
- ",
- "type": "Literal",
- "value": "
-
- ",
+ "start": Object {
+ "column": 13,
+ "line": 1,
},
- Object {
- "children": Array [],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 17,
- "line": 10,
- },
- "start": Object {
- "column": 5,
- "line": 10,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 16,
- "line": 10,
- },
- "start": Object {
- "column": 7,
- "line": 10,
- },
- },
- "name": "Component",
- "range": Array [
- 289,
+ },
+ "params": Array [],
+ "range": Array [
+ 13,
+ 65,
+ ],
+ "type": "ArrowFunctionExpression",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 65,
+ ],
+ "type": "VariableDeclarator",
+ },
+ ],
+ "kind": "const",
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 65,
+ ],
+ "type": "VariableDeclaration",
+ },
+ ],
+ "comments": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 16,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 50,
+ 56,
+ ],
+ "type": "Line",
+ "value": " Foo",
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 0,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 66,
+ ],
+ "sourceType": "script",
+ "tokens": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 5,
+ ],
+ "type": "Keyword",
+ "value": "const",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 10,
+ ],
+ "type": "Identifier",
+ "value": "pure",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 11,
+ 12,
+ ],
+ "type": "Punctuator",
+ "value": "=",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 13,
+ 14,
+ ],
+ "type": "Punctuator",
+ "value": "(",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 14,
+ 15,
+ ],
+ "type": "Punctuator",
+ "value": ")",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 16,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 16,
+ 18,
+ ],
+ "type": "Punctuator",
+ "value": "=>",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 20,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 19,
+ 20,
+ ],
+ "type": "Punctuator",
+ "value": "{",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 2,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 25,
+ 31,
+ ],
+ "type": "Keyword",
+ "value": "return",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 2,
+ },
+ "start": Object {
+ "column": 11,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 32,
+ 33,
+ ],
+ "type": "Punctuator",
+ "value": "(",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 9,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 42,
+ 43,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 9,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 43,
+ 46,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Foo",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 47,
+ 48,
+ ],
+ "type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 48,
+ 49,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 61,
+ 62,
+ ],
+ "type": "Punctuator",
+ "value": ")",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 6,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 62,
+ 63,
+ ],
+ "type": "Punctuator",
+ "value": ";",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 64,
+ 65,
+ ],
+ "type": "Punctuator",
+ "value": "}",
+ },
+ ],
+ "type": "Program",
+}
+`;
+
+exports[`Comments fixtures/jsx-generic-with-comment-in-tag.src 1`] = `
+Object {
+ "body": Array [
+ Object {
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "name": "comp",
+ "range": Array [
+ 6,
+ 10,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 19,
+ 24,
+ ],
+ "raw": "
+ ",
+ "type": "Literal",
+ "value": "
+ ",
+ },
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 50,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 49,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 40,
+ "line": 3,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 60,
+ 69,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 58,
+ 70,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 50,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 3,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 25,
+ 34,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 24,
+ 58,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ "typeParameters": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 3,
+ },
+ },
+ "params": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 35,
+ 41,
+ ],
+ "type": "TSNumberKeyword",
+ },
+ ],
+ "range": Array [
+ 34,
+ 42,
+ ],
+ "type": "TSTypeParameterInstantiation",
+ },
+ },
+ "range": Array [
+ 24,
+ 70,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 50,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 70,
+ 75,
+ ],
+ "raw": "
+ ",
+ "type": "Literal",
+ "value": "
+ ",
+ },
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 4,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 53,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 44,
+ "line": 4,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 115,
+ 124,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 113,
+ 125,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 4,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 4,
+ },
+ },
+ "name": "foo",
+ "range": Array [
+ 94,
+ 97,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 94,
+ 97,
+ ],
+ "type": "JSXAttribute",
+ "value": null,
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 4,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 76,
+ 85,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 75,
+ 113,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ "typeParameters": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 4,
+ },
+ },
+ "params": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 86,
+ 92,
+ ],
+ "type": "TSNumberKeyword",
+ },
+ ],
+ "range": Array [
+ 85,
+ 93,
+ ],
+ "type": "TSTypeParameterInstantiation",
+ },
+ },
+ "range": Array [
+ 75,
+ 125,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 54,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 125,
+ 130,
+ ],
+ "raw": "
+ ",
+ "type": "Literal",
+ "value": "
+ ",
+ },
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 53,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 44,
+ "line": 5,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 170,
+ 179,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 168,
+ 180,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 5,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 41,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 41,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 5,
+ },
+ },
+ "name": "bar",
+ "range": Array [
+ 164,
+ 167,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 164,
+ 167,
+ ],
+ "type": "JSXAttribute",
+ "value": null,
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 5,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 131,
+ 140,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 130,
+ 168,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ "typeParameters": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 5,
+ },
+ },
+ "params": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 141,
+ 147,
+ ],
+ "type": "TSNumberKeyword",
+ },
+ ],
+ "range": Array [
+ 140,
+ 148,
+ ],
+ "type": "TSTypeParameterInstantiation",
+ },
+ },
+ "range": Array [
+ 130,
+ 180,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 54,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 180,
+ 185,
+ ],
+ "raw": "
+ ",
+ "type": "Literal",
+ "value": "
+ ",
+ },
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 58,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 46,
+ "line": 6,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 57,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 48,
+ "line": 6,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 229,
+ 238,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 227,
+ 239,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 58,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 6,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 6,
+ },
+ },
+ "name": "foo",
+ "range": Array [
+ 204,
+ 207,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 204,
+ 207,
+ ],
+ "type": "JSXAttribute",
+ "value": null,
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 45,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 6,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 45,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 6,
+ },
+ },
+ "name": "bar",
+ "range": Array [
+ 223,
+ 226,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 223,
+ 226,
+ ],
+ "type": "JSXAttribute",
+ "value": null,
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 46,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 6,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 186,
+ 195,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 185,
+ 227,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ "typeParameters": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 6,
+ },
+ },
+ "params": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 196,
+ 202,
+ ],
+ "type": "TSNumberKeyword",
+ },
+ ],
+ "range": Array [
+ 195,
+ 203,
+ ],
+ "type": "TSTypeParameterInstantiation",
+ },
+ },
+ "range": Array [
+ 185,
+ 239,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 58,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 239,
+ 245,
+ ],
+ "raw": "
+
+ ",
+ "type": "Literal",
+ "value": "
+
+ ",
+ },
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 10,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 10,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 16,
+ "line": 10,
+ },
+ "start": Object {
+ "column": 7,
+ "line": 10,
+ },
+ },
+ "name": "Component",
+ "range": Array [
+ 289,
298,
],
"type": "JSXIdentifier",
@@ -4591,290 +5143,1358 @@ Object {
"type": "VariableDeclarator",
},
],
- "kind": "const",
+ "kind": "const",
+ "loc": Object {
+ "end": Object {
+ "column": 2,
+ "line": 25,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 525,
+ ],
+ "type": "VariableDeclaration",
+ },
+ ],
+ "comments": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 37,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 43,
+ 57,
+ ],
+ "type": "Block",
+ "value": " comment1 ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 41,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 27,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 98,
+ 112,
+ ],
+ "type": "Block",
+ "value": " comment2 ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 37,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 149,
+ 163,
+ ],
+ "type": "Block",
+ "value": " comment3 ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 41,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 27,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 208,
+ 222,
+ ],
+ "type": "Block",
+ "value": " comment4 ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 9,
+ },
+ },
+ "range": Array [
+ 270,
+ 281,
+ ],
+ "type": "Line",
+ "value": " comment5",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 13,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 13,
+ },
+ },
+ "range": Array [
+ 339,
+ 350,
+ ],
+ "type": "Line",
+ "value": " comment6",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 16,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 16,
+ },
+ },
+ "range": Array [
+ 398,
+ 409,
+ ],
+ "type": "Line",
+ "value": " comment7",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 21,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 21,
+ },
+ },
+ "range": Array [
+ 477,
+ 488,
+ ],
+ "type": "Line",
+ "value": " comment8",
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 0,
+ "line": 26,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 526,
+ ],
+ "sourceType": "script",
+ "tokens": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 5,
+ ],
+ "type": "Keyword",
+ "value": "const",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 10,
+ ],
+ "type": "Identifier",
+ "value": "comp",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 11,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 11,
+ 12,
+ ],
+ "type": "Punctuator",
+ "value": "=",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 13,
+ 14,
+ ],
+ "type": "Punctuator",
+ "value": "(",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 3,
+ "line": 2,
+ },
+ "start": Object {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 17,
+ 18,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 2,
+ },
+ "start": Object {
+ "column": 3,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 18,
+ 19,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 19,
+ 24,
+ ],
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 24,
+ 25,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 25,
+ 34,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 34,
+ 35,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 35,
+ 41,
+ ],
+ "type": "Identifier",
+ "value": "number",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 41,
+ 42,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 37,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 57,
+ 58,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 39,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 58,
+ 59,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 40,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 39,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 59,
+ 60,
+ ],
+ "type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 49,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 40,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 60,
+ 69,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 50,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 49,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 69,
+ 70,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 50,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 70,
+ 75,
+ ],
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 75,
+ 76,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 76,
+ 85,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 85,
+ 86,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 86,
+ 92,
+ ],
+ "type": "Identifier",
+ "value": "number",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 92,
+ 93,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 23,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 94,
+ 97,
+ ],
+ "type": "JSXIdentifier",
+ "value": "foo",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 41,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 112,
+ 113,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 113,
+ 114,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 44,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 43,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 114,
+ 115,
+ ],
+ "type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 53,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 44,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 115,
+ 124,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 4,
+ },
+ "start": Object {
+ "column": 53,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 124,
+ 125,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 54,
+ "line": 4,
+ },
+ },
+ "range": Array [
+ 125,
+ 130,
+ ],
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 130,
+ 131,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 131,
+ 140,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 140,
+ 141,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 141,
+ 147,
+ ],
+ "type": "Identifier",
+ "value": "number",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 147,
+ 148,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 41,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 164,
+ 167,
+ ],
+ "type": "JSXIdentifier",
+ "value": "bar",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 41,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 167,
+ 168,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 168,
+ 169,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 44,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 43,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 169,
+ 170,
+ ],
+ "type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 53,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 44,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 170,
+ 179,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 54,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 53,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 179,
+ 180,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 54,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 180,
+ 185,
+ ],
+ "type": "JSXText",
+ "value": "
+ ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 185,
+ 186,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 186,
+ 195,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 195,
+ 196,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 196,
+ 202,
+ ],
+ "type": "Identifier",
+ "value": "number",
+ },
+ Object {
"loc": Object {
"end": Object {
- "column": 2,
- "line": 25,
+ "column": 22,
+ "line": 6,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 21,
+ "line": 6,
},
},
"range": Array [
- 0,
- 525,
+ 202,
+ 203,
],
- "type": "VariableDeclaration",
+ "type": "Punctuator",
+ "value": ">",
},
- ],
- "comments": Array [
Object {
"loc": Object {
"end": Object {
- "column": 37,
- "line": 3,
+ "column": 26,
+ "line": 6,
},
"start": Object {
"column": 23,
- "line": 3,
+ "line": 6,
},
},
"range": Array [
- 43,
- 57,
+ 204,
+ 207,
],
- "type": "Block",
- "value": " comment1 ",
+ "type": "JSXIdentifier",
+ "value": "foo",
},
Object {
"loc": Object {
"end": Object {
- "column": 41,
- "line": 4,
+ "column": 45,
+ "line": 6,
},
"start": Object {
- "column": 27,
- "line": 4,
+ "column": 42,
+ "line": 6,
},
},
"range": Array [
- 98,
- 112,
+ 223,
+ 226,
],
- "type": "Block",
- "value": " comment2 ",
+ "type": "JSXIdentifier",
+ "value": "bar",
},
Object {
"loc": Object {
"end": Object {
- "column": 37,
- "line": 5,
+ "column": 46,
+ "line": 6,
},
"start": Object {
- "column": 23,
- "line": 5,
+ "column": 45,
+ "line": 6,
},
},
"range": Array [
- 149,
- 163,
+ 226,
+ 227,
],
- "type": "Block",
- "value": " comment3 ",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 41,
+ "column": 47,
"line": 6,
},
"start": Object {
- "column": 27,
+ "column": 46,
"line": 6,
},
},
"range": Array [
- 208,
- 222,
+ 227,
+ 228,
],
- "type": "Block",
- "value": " comment4 ",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 9,
+ "column": 48,
+ "line": 6,
},
"start": Object {
- "column": 6,
- "line": 9,
+ "column": 47,
+ "line": 6,
},
},
"range": Array [
- 270,
- 281,
+ 228,
+ 229,
],
- "type": "Line",
- "value": " comment5",
+ "type": "Punctuator",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 13,
+ "column": 57,
+ "line": 6,
},
"start": Object {
- "column": 6,
- "line": 13,
+ "column": 48,
+ "line": 6,
},
},
"range": Array [
- 339,
- 350,
+ 229,
+ 238,
],
- "type": "Line",
- "value": " comment6",
+ "type": "JSXIdentifier",
+ "value": "Component",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 16,
+ "column": 58,
+ "line": 6,
},
"start": Object {
- "column": 6,
- "line": 16,
+ "column": 57,
+ "line": 6,
},
},
"range": Array [
- 398,
- 409,
+ 238,
+ 239,
],
- "type": "Line",
- "value": " comment7",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 21,
+ "column": 4,
+ "line": 8,
},
"start": Object {
- "column": 6,
- "line": 21,
+ "column": 58,
+ "line": 6,
},
},
"range": Array [
- 477,
- 488,
+ 239,
+ 245,
],
- "type": "Line",
- "value": " comment8",
- },
- ],
- "loc": Object {
- "end": Object {
- "column": 0,
- "line": 26,
+ "type": "JSXText",
+ "value": "
+
+ ",
},
- "start": Object {
- "column": 0,
- "line": 1,
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 8,
+ },
+ },
+ "range": Array [
+ 245,
+ 246,
+ ],
+ "type": "Punctuator",
+ "value": "<",
},
- },
- "range": Array [
- 0,
- 526,
- ],
- "sourceType": "script",
- "tokens": Array [
Object {
"loc": Object {
"end": Object {
+ "column": 14,
+ "line": 8,
+ },
+ "start": Object {
"column": 5,
- "line": 1,
+ "line": 8,
+ },
+ },
+ "range": Array [
+ 246,
+ 255,
+ ],
+ "type": "JSXIdentifier",
+ "value": "Component",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 8,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 14,
+ "line": 8,
},
},
"range": Array [
- 0,
- 5,
+ 255,
+ 256,
],
- "type": "Keyword",
- "value": "const",
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 8,
+ },
+ },
+ "range": Array [
+ 256,
+ 262,
+ ],
+ "type": "Identifier",
+ "value": "number",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 8,
+ },
+ },
+ "range": Array [
+ 262,
+ 263,
+ ],
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 1,
+ "column": 5,
+ "line": 10,
},
"start": Object {
- "column": 6,
- "line": 1,
+ "column": 4,
+ "line": 10,
},
},
"range": Array [
- 6,
- 10,
+ 286,
+ 287,
],
- "type": "Identifier",
- "value": "comp",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 1,
+ "column": 6,
+ "line": 10,
},
"start": Object {
- "column": 11,
- "line": 1,
+ "column": 5,
+ "line": 10,
},
},
"range": Array [
- 11,
- 12,
+ 287,
+ 288,
],
"type": "Punctuator",
- "value": "=",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 1,
+ "column": 7,
+ "line": 10,
},
"start": Object {
- "column": 13,
- "line": 1,
+ "column": 6,
+ "line": 10,
},
},
"range": Array [
- 13,
- 14,
+ 288,
+ 289,
],
"type": "Punctuator",
- "value": "(",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 3,
- "line": 2,
+ "column": 16,
+ "line": 10,
},
"start": Object {
- "column": 2,
- "line": 2,
+ "column": 7,
+ "line": 10,
},
},
"range": Array [
- 17,
- 18,
+ 289,
+ 298,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "JSXIdentifier",
+ "value": "Component",
},
Object {
"loc": Object {
"end": Object {
- "column": 4,
- "line": 2,
+ "column": 17,
+ "line": 10,
},
"start": Object {
- "column": 3,
- "line": 2,
+ "column": 16,
+ "line": 10,
},
},
"range": Array [
- 18,
- 19,
+ 298,
+ 299,
],
"type": "Punctuator",
"value": ">",
@@ -4883,16 +6503,16 @@ Object {
"loc": Object {
"end": Object {
"column": 4,
- "line": 3,
+ "line": 11,
},
"start": Object {
- "column": 4,
- "line": 2,
+ "column": 17,
+ "line": 10,
},
},
"range": Array [
- 19,
- 24,
+ 299,
+ 304,
],
"type": "JSXText",
"value": "
@@ -4902,16 +6522,16 @@ Object {
"loc": Object {
"end": Object {
"column": 5,
- "line": 3,
+ "line": 11,
},
"start": Object {
"column": 4,
- "line": 3,
+ "line": 11,
},
},
"range": Array [
- 24,
- 25,
+ 304,
+ 305,
],
"type": "Punctuator",
"value": "<",
@@ -4920,16 +6540,16 @@ Object {
"loc": Object {
"end": Object {
"column": 14,
- "line": 3,
+ "line": 11,
},
"start": Object {
"column": 5,
- "line": 3,
+ "line": 11,
},
},
"range": Array [
- 25,
- 34,
+ 305,
+ 314,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -4938,16 +6558,16 @@ Object {
"loc": Object {
"end": Object {
"column": 15,
- "line": 3,
+ "line": 11,
},
"start": Object {
"column": 14,
- "line": 3,
+ "line": 11,
},
},
"range": Array [
- 34,
- 35,
+ 314,
+ 315,
],
"type": "Punctuator",
"value": "<",
@@ -4956,16 +6576,16 @@ Object {
"loc": Object {
"end": Object {
"column": 21,
- "line": 3,
+ "line": 11,
},
"start": Object {
"column": 15,
- "line": 3,
+ "line": 11,
},
},
"range": Array [
- 35,
- 41,
+ 315,
+ 321,
],
"type": "Identifier",
"value": "number",
@@ -4974,16 +6594,16 @@ Object {
"loc": Object {
"end": Object {
"column": 22,
- "line": 3,
+ "line": 11,
},
"start": Object {
"column": 21,
- "line": 3,
+ "line": 11,
},
},
"range": Array [
- 41,
- 42,
+ 321,
+ 322,
],
"type": "Punctuator",
"value": ">",
@@ -4991,17 +6611,35 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 38,
- "line": 3,
+ "column": 9,
+ "line": 12,
},
"start": Object {
- "column": 37,
- "line": 3,
+ "column": 6,
+ "line": 12,
},
},
"range": Array [
- 57,
- 58,
+ 329,
+ 332,
+ ],
+ "type": "JSXIdentifier",
+ "value": "foo",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 5,
+ "line": 14,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 14,
+ },
+ },
+ "range": Array [
+ 355,
+ 356,
],
"type": "Punctuator",
"value": ">",
@@ -5009,17 +6647,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 39,
- "line": 3,
+ "column": 6,
+ "line": 14,
},
"start": Object {
- "column": 38,
- "line": 3,
+ "column": 5,
+ "line": 14,
},
},
"range": Array [
- 58,
- 59,
+ 356,
+ 357,
],
"type": "Punctuator",
"value": "<",
@@ -5027,17 +6665,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 40,
- "line": 3,
+ "column": 7,
+ "line": 14,
},
"start": Object {
- "column": 39,
- "line": 3,
+ "column": 6,
+ "line": 14,
},
},
"range": Array [
- 59,
- 60,
+ 357,
+ 358,
],
"type": "Punctuator",
"value": "/",
@@ -5045,17 +6683,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 49,
- "line": 3,
+ "column": 16,
+ "line": 14,
},
"start": Object {
- "column": 40,
- "line": 3,
+ "column": 7,
+ "line": 14,
},
},
"range": Array [
- 60,
- 69,
+ 358,
+ 367,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -5063,17 +6701,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 50,
- "line": 3,
+ "column": 17,
+ "line": 14,
},
"start": Object {
- "column": 49,
- "line": 3,
+ "column": 16,
+ "line": 14,
},
},
"range": Array [
- 69,
- 70,
+ 367,
+ 368,
],
"type": "Punctuator",
"value": ">",
@@ -5082,16 +6720,16 @@ Object {
"loc": Object {
"end": Object {
"column": 4,
- "line": 4,
+ "line": 15,
},
"start": Object {
- "column": 50,
- "line": 3,
+ "column": 17,
+ "line": 14,
},
},
"range": Array [
- 70,
- 75,
+ 368,
+ 373,
],
"type": "JSXText",
"value": "
@@ -5101,16 +6739,16 @@ Object {
"loc": Object {
"end": Object {
"column": 5,
- "line": 4,
+ "line": 15,
},
"start": Object {
"column": 4,
- "line": 4,
+ "line": 15,
},
},
"range": Array [
- 75,
- 76,
+ 373,
+ 374,
],
"type": "Punctuator",
"value": "<",
@@ -5119,16 +6757,16 @@ Object {
"loc": Object {
"end": Object {
"column": 14,
- "line": 4,
+ "line": 15,
},
"start": Object {
"column": 5,
- "line": 4,
+ "line": 15,
},
},
"range": Array [
- 76,
- 85,
+ 374,
+ 383,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -5137,16 +6775,16 @@ Object {
"loc": Object {
"end": Object {
"column": 15,
- "line": 4,
+ "line": 15,
},
"start": Object {
"column": 14,
- "line": 4,
+ "line": 15,
},
},
"range": Array [
- 85,
- 86,
+ 383,
+ 384,
],
"type": "Punctuator",
"value": "<",
@@ -5155,16 +6793,16 @@ Object {
"loc": Object {
"end": Object {
"column": 21,
- "line": 4,
+ "line": 15,
},
"start": Object {
"column": 15,
- "line": 4,
+ "line": 15,
},
},
"range": Array [
- 86,
- 92,
+ 384,
+ 390,
],
"type": "Identifier",
"value": "number",
@@ -5173,16 +6811,16 @@ Object {
"loc": Object {
"end": Object {
"column": 22,
- "line": 4,
+ "line": 15,
},
"start": Object {
"column": 21,
- "line": 4,
+ "line": 15,
},
},
"range": Array [
- 92,
- 93,
+ 390,
+ 391,
],
"type": "Punctuator",
"value": ">",
@@ -5190,17 +6828,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 26,
- "line": 4,
+ "column": 9,
+ "line": 17,
},
"start": Object {
- "column": 23,
- "line": 4,
+ "column": 6,
+ "line": 17,
},
},
"range": Array [
- 94,
- 97,
+ 416,
+ 419,
],
"type": "JSXIdentifier",
"value": "foo",
@@ -5208,17 +6846,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 42,
- "line": 4,
+ "column": 5,
+ "line": 18,
},
"start": Object {
- "column": 41,
- "line": 4,
+ "column": 4,
+ "line": 18,
},
},
"range": Array [
- 112,
- 113,
+ 424,
+ 425,
],
"type": "Punctuator",
"value": ">",
@@ -5226,17 +6864,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 43,
- "line": 4,
+ "column": 6,
+ "line": 18,
},
"start": Object {
- "column": 42,
- "line": 4,
+ "column": 5,
+ "line": 18,
},
},
"range": Array [
- 113,
- 114,
+ 425,
+ 426,
],
"type": "Punctuator",
"value": "<",
@@ -5244,17 +6882,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 44,
- "line": 4,
+ "column": 7,
+ "line": 18,
},
"start": Object {
- "column": 43,
- "line": 4,
+ "column": 6,
+ "line": 18,
},
},
"range": Array [
- 114,
- 115,
+ 426,
+ 427,
],
"type": "Punctuator",
"value": "/",
@@ -5262,17 +6900,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 53,
- "line": 4,
+ "column": 16,
+ "line": 18,
},
"start": Object {
- "column": 44,
- "line": 4,
+ "column": 7,
+ "line": 18,
},
},
"range": Array [
- 115,
- 124,
+ 427,
+ 436,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -5280,17 +6918,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 54,
- "line": 4,
+ "column": 17,
+ "line": 18,
},
"start": Object {
- "column": 53,
- "line": 4,
+ "column": 16,
+ "line": 18,
},
},
"range": Array [
- 124,
- 125,
+ 436,
+ 437,
],
"type": "Punctuator",
"value": ">",
@@ -5299,16 +6937,16 @@ Object {
"loc": Object {
"end": Object {
"column": 4,
- "line": 5,
+ "line": 19,
},
"start": Object {
- "column": 54,
- "line": 4,
+ "column": 17,
+ "line": 18,
},
},
"range": Array [
- 125,
- 130,
+ 437,
+ 442,
],
"type": "JSXText",
"value": "
@@ -5318,16 +6956,16 @@ Object {
"loc": Object {
"end": Object {
"column": 5,
- "line": 5,
+ "line": 19,
},
"start": Object {
"column": 4,
- "line": 5,
+ "line": 19,
},
},
"range": Array [
- 130,
- 131,
+ 442,
+ 443,
],
"type": "Punctuator",
"value": "<",
@@ -5336,16 +6974,16 @@ Object {
"loc": Object {
"end": Object {
"column": 14,
- "line": 5,
+ "line": 19,
},
"start": Object {
"column": 5,
- "line": 5,
+ "line": 19,
},
},
"range": Array [
- 131,
- 140,
+ 443,
+ 452,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -5354,16 +6992,16 @@ Object {
"loc": Object {
"end": Object {
"column": 15,
- "line": 5,
+ "line": 19,
},
"start": Object {
"column": 14,
- "line": 5,
+ "line": 19,
},
},
"range": Array [
- 140,
- 141,
+ 452,
+ 453,
],
"type": "Punctuator",
"value": "<",
@@ -5372,16 +7010,16 @@ Object {
"loc": Object {
"end": Object {
"column": 21,
- "line": 5,
+ "line": 19,
},
"start": Object {
"column": 15,
- "line": 5,
+ "line": 19,
},
},
"range": Array [
- 141,
- 147,
+ 453,
+ 459,
],
"type": "Identifier",
"value": "number",
@@ -5390,16 +7028,16 @@ Object {
"loc": Object {
"end": Object {
"column": 22,
- "line": 5,
+ "line": 19,
},
"start": Object {
"column": 21,
- "line": 5,
+ "line": 19,
},
},
"range": Array [
- 147,
- 148,
+ 459,
+ 460,
],
"type": "Punctuator",
"value": ">",
@@ -5407,17 +7045,35 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 41,
- "line": 5,
+ "column": 9,
+ "line": 20,
},
"start": Object {
- "column": 38,
- "line": 5,
+ "column": 6,
+ "line": 20,
},
},
"range": Array [
- 164,
- 167,
+ 467,
+ 470,
+ ],
+ "type": "JSXIdentifier",
+ "value": "foo",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 9,
+ "line": 22,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 22,
+ },
+ },
+ "range": Array [
+ 495,
+ 498,
],
"type": "JSXIdentifier",
"value": "bar",
@@ -5425,17 +7081,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 42,
- "line": 5,
+ "column": 5,
+ "line": 23,
},
"start": Object {
- "column": 41,
- "line": 5,
+ "column": 4,
+ "line": 23,
},
},
"range": Array [
- 167,
- 168,
+ 503,
+ 504,
],
"type": "Punctuator",
"value": ">",
@@ -5443,17 +7099,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 43,
- "line": 5,
+ "column": 6,
+ "line": 23,
},
"start": Object {
- "column": 42,
- "line": 5,
+ "column": 5,
+ "line": 23,
},
},
"range": Array [
- 168,
- 169,
+ 504,
+ 505,
],
"type": "Punctuator",
"value": "<",
@@ -5461,17 +7117,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 44,
- "line": 5,
+ "column": 7,
+ "line": 23,
},
"start": Object {
- "column": 43,
- "line": 5,
+ "column": 6,
+ "line": 23,
},
},
"range": Array [
- 169,
- 170,
+ 505,
+ 506,
],
"type": "Punctuator",
"value": "/",
@@ -5479,17 +7135,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 53,
- "line": 5,
+ "column": 16,
+ "line": 23,
},
"start": Object {
- "column": 44,
- "line": 5,
+ "column": 7,
+ "line": 23,
},
},
"range": Array [
- 170,
- 179,
+ 506,
+ 515,
],
"type": "JSXIdentifier",
"value": "Component",
@@ -5497,17 +7153,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 54,
- "line": 5,
+ "column": 17,
+ "line": 23,
},
"start": Object {
- "column": 53,
- "line": 5,
+ "column": 16,
+ "line": 23,
},
},
"range": Array [
- 179,
- 180,
+ 515,
+ 516,
],
"type": "Punctuator",
"value": ">",
@@ -5515,905 +7171,1194 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 4,
- "line": 6,
+ "column": 2,
+ "line": 24,
},
"start": Object {
- "column": 54,
- "line": 5,
+ "column": 17,
+ "line": 23,
},
},
"range": Array [
- 180,
- 185,
+ 516,
+ 519,
],
"type": "JSXText",
"value": "
- ",
+ ",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 3,
+ "line": 24,
+ },
+ "start": Object {
+ "column": 2,
+ "line": 24,
+ },
+ },
+ "range": Array [
+ 519,
+ 520,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 24,
+ },
+ "start": Object {
+ "column": 3,
+ "line": 24,
+ },
+ },
+ "range": Array [
+ 520,
+ 521,
+ ],
+ "type": "Punctuator",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
"column": 5,
- "line": 6,
+ "line": 24,
},
"start": Object {
"column": 4,
- "line": 6,
+ "line": 24,
},
},
"range": Array [
- 185,
- 186,
+ 521,
+ 522,
],
"type": "Punctuator",
- "value": "<",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 6,
+ "column": 1,
+ "line": 25,
},
"start": Object {
- "column": 5,
- "line": 6,
+ "column": 0,
+ "line": 25,
},
},
"range": Array [
- 186,
- 195,
+ 523,
+ 524,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Punctuator",
+ "value": ")",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 6,
+ "column": 2,
+ "line": 25,
},
"start": Object {
- "column": 14,
- "line": 6,
+ "column": 1,
+ "line": 25,
+ },
+ },
+ "range": Array [
+ 524,
+ 525,
+ ],
+ "type": "Punctuator",
+ "value": ";",
+ },
+ ],
+ "type": "Program",
+}
+`;
+
+exports[`Comments fixtures/jsx-tag-comments.src 1`] = `
+Object {
+ "body": Array [
+ Object {
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "name": "pure",
+ "range": Array [
+ 6,
+ 10,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "async": false,
+ "body": Object {
+ "body": Array [
+ Object {
+ "argument": Object {
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 8,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 9,
+ "line": 6,
+ },
+ },
+ "range": Array [
+ 103,
+ 112,
+ ],
+ "raw": "
+ ",
+ "type": "Literal",
+ "value": "
+ ",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 13,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 10,
+ "line": 7,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 114,
+ 117,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 112,
+ 118,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 14,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 9,
+ "line": 6,
+ },
+ "start": Object {
+ "column": 8,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 9,
+ "line": 3,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 43,
+ 46,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 42,
+ 103,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 42,
+ 118,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 6,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 25,
+ 125,
+ ],
+ "type": "ReturnStatement",
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 19,
+ 127,
+ ],
+ "type": "BlockStatement",
+ },
+ "expression": false,
+ "generator": false,
+ "id": null,
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "params": Array [],
+ "range": Array [
+ 13,
+ 127,
+ ],
+ "type": "ArrowFunctionExpression",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 127,
+ ],
+ "type": "VariableDeclarator",
},
- },
- "range": Array [
- 195,
- 196,
],
- "type": "Punctuator",
- "value": "<",
- },
- Object {
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 21,
- "line": 6,
+ "column": 1,
+ "line": 9,
},
"start": Object {
- "column": 15,
- "line": 6,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 196,
- 202,
+ 0,
+ 127,
],
- "type": "Identifier",
- "value": "number",
+ "type": "VariableDeclaration",
},
+ ],
+ "comments": Array [
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 6,
- },
- "start": Object {
"column": 21,
- "line": 6,
- },
- },
- "range": Array [
- 202,
- 203,
- ],
- "type": "Punctuator",
- "value": ">",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 26,
- "line": 6,
- },
- "start": Object {
- "column": 23,
- "line": 6,
- },
- },
- "range": Array [
- 204,
- 207,
- ],
- "type": "JSXIdentifier",
- "value": "foo",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 45,
- "line": 6,
- },
- "start": Object {
- "column": 42,
- "line": 6,
- },
- },
- "range": Array [
- 223,
- 226,
- ],
- "type": "JSXIdentifier",
- "value": "bar",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 46,
- "line": 6,
- },
- "start": Object {
- "column": 45,
- "line": 6,
- },
- },
- "range": Array [
- 226,
- 227,
- ],
- "type": "Punctuator",
- "value": ">",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 47,
- "line": 6,
- },
- "start": Object {
- "column": 46,
- "line": 6,
- },
- },
- "range": Array [
- 227,
- 228,
- ],
- "type": "Punctuator",
- "value": "<",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 48,
- "line": 6,
- },
- "start": Object {
- "column": 47,
- "line": 6,
- },
- },
- "range": Array [
- 228,
- 229,
- ],
- "type": "Punctuator",
- "value": "/",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 57,
- "line": 6,
+ "line": 4,
},
"start": Object {
- "column": 48,
- "line": 6,
+ "column": 12,
+ "line": 4,
},
},
"range": Array [
- 229,
- 238,
+ 59,
+ 68,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Line",
+ "value": " single",
},
Object {
"loc": Object {
"end": Object {
- "column": 58,
- "line": 6,
+ "column": 23,
+ "line": 5,
},
"start": Object {
- "column": 57,
- "line": 6,
+ "column": 12,
+ "line": 5,
},
},
"range": Array [
- 238,
- 239,
+ 81,
+ 92,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "Block",
+ "value": " block ",
},
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 8,
- },
- "start": Object {
- "column": 58,
- "line": 6,
- },
- },
- "range": Array [
- 239,
- 245,
- ],
- "type": "JSXText",
- "value": "
-
- ",
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 0,
+ "line": 11,
},
- Object {
- "loc": Object {
- "end": Object {
- "column": 5,
- "line": 8,
- },
- "start": Object {
- "column": 4,
- "line": 8,
- },
- },
- "range": Array [
- 245,
- 246,
- ],
- "type": "Punctuator",
- "value": "<",
+ "start": Object {
+ "column": 0,
+ "line": 1,
},
+ },
+ "range": Array [
+ 0,
+ 129,
+ ],
+ "sourceType": "script",
+ "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 8,
- },
- "start": Object {
"column": 5,
- "line": 8,
- },
- },
- "range": Array [
- 246,
- 255,
- ],
- "type": "JSXIdentifier",
- "value": "Component",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 15,
- "line": 8,
- },
- "start": Object {
- "column": 14,
- "line": 8,
- },
- },
- "range": Array [
- 255,
- 256,
- ],
- "type": "Punctuator",
- "value": "<",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 8,
+ "line": 1,
},
"start": Object {
- "column": 15,
- "line": 8,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 256,
- 262,
+ 0,
+ 5,
],
- "type": "Identifier",
- "value": "number",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 8,
+ "column": 10,
+ "line": 1,
},
"start": Object {
- "column": 21,
- "line": 8,
+ "column": 6,
+ "line": 1,
},
},
"range": Array [
- 262,
- 263,
+ 6,
+ 10,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "Identifier",
+ "value": "pure",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 10,
+ "column": 12,
+ "line": 1,
},
"start": Object {
- "column": 4,
- "line": 10,
+ "column": 11,
+ "line": 1,
},
},
"range": Array [
- 286,
- 287,
+ 11,
+ 12,
],
"type": "Punctuator",
- "value": ">",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 10,
+ "column": 14,
+ "line": 1,
},
"start": Object {
- "column": 5,
- "line": 10,
+ "column": 13,
+ "line": 1,
},
},
"range": Array [
- 287,
- 288,
+ 13,
+ 14,
],
"type": "Punctuator",
- "value": "<",
+ "value": "(",
},
Object {
"loc": Object {
"end": Object {
- "column": 7,
- "line": 10,
+ "column": 15,
+ "line": 1,
},
"start": Object {
- "column": 6,
- "line": 10,
+ "column": 14,
+ "line": 1,
},
},
"range": Array [
- 288,
- 289,
+ 14,
+ 15,
],
"type": "Punctuator",
- "value": "/",
+ "value": ")",
},
Object {
"loc": Object {
"end": Object {
- "column": 16,
- "line": 10,
+ "column": 18,
+ "line": 1,
},
"start": Object {
- "column": 7,
- "line": 10,
+ "column": 16,
+ "line": 1,
},
},
"range": Array [
- 289,
- 298,
+ 16,
+ 18,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Punctuator",
+ "value": "=>",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 10,
+ "column": 20,
+ "line": 1,
},
"start": Object {
- "column": 16,
- "line": 10,
+ "column": 19,
+ "line": 1,
},
},
"range": Array [
- 298,
- 299,
+ 19,
+ 20,
],
"type": "Punctuator",
- "value": ">",
+ "value": "{",
},
Object {
"loc": Object {
"end": Object {
- "column": 4,
- "line": 11,
+ "column": 10,
+ "line": 2,
},
"start": Object {
- "column": 17,
- "line": 10,
+ "column": 4,
+ "line": 2,
},
},
"range": Array [
- 299,
- 304,
+ 25,
+ 31,
],
- "type": "JSXText",
- "value": "
- ",
+ "type": "Keyword",
+ "value": "return",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 11,
+ "column": 12,
+ "line": 2,
},
"start": Object {
- "column": 4,
- "line": 11,
+ "column": 11,
+ "line": 2,
},
},
"range": Array [
- 304,
- 305,
+ 32,
+ 33,
],
"type": "Punctuator",
- "value": "<",
+ "value": "(",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 11,
+ "column": 9,
+ "line": 3,
},
"start": Object {
- "column": 5,
- "line": 11,
+ "column": 8,
+ "line": 3,
},
},
"range": Array [
- 305,
- 314,
+ 42,
+ 43,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 11,
+ "column": 12,
+ "line": 3,
},
"start": Object {
- "column": 14,
- "line": 11,
+ "column": 9,
+ "line": 3,
},
},
"range": Array [
- 314,
- 315,
+ 43,
+ 46,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "JSXIdentifier",
+ "value": "Foo",
},
Object {
"loc": Object {
"end": Object {
- "column": 21,
- "line": 11,
+ "column": 9,
+ "line": 6,
},
"start": Object {
- "column": 15,
- "line": 11,
+ "column": 8,
+ "line": 6,
},
},
"range": Array [
- 315,
- 321,
+ 102,
+ 103,
],
- "type": "Identifier",
- "value": "number",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 11,
+ "column": 8,
+ "line": 7,
},
"start": Object {
- "column": 21,
- "line": 11,
+ "column": 9,
+ "line": 6,
},
},
"range": Array [
- 321,
- 322,
+ 103,
+ 112,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "JSXText",
+ "value": "
+ ",
},
Object {
"loc": Object {
"end": Object {
"column": 9,
- "line": 12,
+ "line": 7,
},
"start": Object {
- "column": 6,
- "line": 12,
+ "column": 8,
+ "line": 7,
},
},
"range": Array [
- 329,
- 332,
+ 112,
+ 113,
],
- "type": "JSXIdentifier",
- "value": "foo",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 14,
+ "column": 10,
+ "line": 7,
},
"start": Object {
- "column": 4,
- "line": 14,
+ "column": 9,
+ "line": 7,
},
},
"range": Array [
- 355,
- 356,
+ 113,
+ 114,
],
"type": "Punctuator",
- "value": ">",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 14,
+ "column": 13,
+ "line": 7,
},
"start": Object {
- "column": 5,
- "line": 14,
+ "column": 10,
+ "line": 7,
},
},
"range": Array [
- 356,
- 357,
+ 114,
+ 117,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "JSXIdentifier",
+ "value": "Foo",
},
Object {
"loc": Object {
"end": Object {
- "column": 7,
- "line": 14,
+ "column": 14,
+ "line": 7,
},
"start": Object {
- "column": 6,
- "line": 14,
+ "column": 13,
+ "line": 7,
},
},
"range": Array [
- 357,
- 358,
+ 117,
+ 118,
],
"type": "Punctuator",
- "value": "/",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 16,
- "line": 14,
+ "column": 5,
+ "line": 8,
},
"start": Object {
- "column": 7,
- "line": 14,
+ "column": 4,
+ "line": 8,
},
},
"range": Array [
- 358,
- 367,
+ 123,
+ 124,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Punctuator",
+ "value": ")",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 14,
+ "column": 6,
+ "line": 8,
},
"start": Object {
- "column": 16,
- "line": 14,
+ "column": 5,
+ "line": 8,
},
},
"range": Array [
- 367,
- 368,
+ 124,
+ 125,
],
"type": "Punctuator",
- "value": ">",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 4,
- "line": 15,
+ "column": 1,
+ "line": 9,
},
"start": Object {
- "column": 17,
- "line": 14,
+ "column": 0,
+ "line": 9,
},
},
"range": Array [
- 368,
- 373,
+ 126,
+ 127,
],
- "type": "JSXText",
- "value": "
- ",
+ "type": "Punctuator",
+ "value": "}",
},
+ ],
+ "type": "Program",
+}
+`;
+
+exports[`Comments fixtures/jsx-text-with-multiline-non-comment.src 1`] = `
+Object {
+ "body": Array [
Object {
- "loc": Object {
- "end": Object {
- "column": 5,
- "line": 15,
- },
- "start": Object {
- "column": 4,
- "line": 15,
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "name": "pure",
+ "range": Array [
+ 6,
+ 10,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "async": false,
+ "body": Object {
+ "body": Array [
+ Object {
+ "argument": Object {
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 9,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 41,
+ 80,
+ ],
+ "raw": "
+ /**
+ * test
+ */
+ ",
+ "type": "Literal",
+ "value": "
+ /**
+ * test
+ */
+ ",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 9,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 7,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 82,
+ 85,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 80,
+ 86,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 10,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 9,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 4,
+ "line": 3,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 8,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 5,
+ "line": 3,
+ },
+ },
+ "name": "Foo",
+ "range": Array [
+ 37,
+ 40,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 36,
+ 41,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 36,
+ 86,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 4,
+ "line": 8,
+ },
+ "start": Object {
+ "column": 2,
+ "line": 2,
+ },
+ },
+ "range": Array [
+ 23,
+ 91,
+ ],
+ "type": "ReturnStatement",
+ },
+ ],
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 19,
+ 93,
+ ],
+ "type": "BlockStatement",
+ },
+ "expression": false,
+ "generator": false,
+ "id": null,
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 13,
+ "line": 1,
+ },
+ },
+ "params": Array [],
+ "range": Array [
+ 13,
+ 93,
+ ],
+ "type": "ArrowFunctionExpression",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 93,
+ ],
+ "type": "VariableDeclarator",
},
- },
- "range": Array [
- 373,
- 374,
],
- "type": "Punctuator",
- "value": "<",
- },
- Object {
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 14,
- "line": 15,
+ "column": 1,
+ "line": 9,
},
"start": Object {
- "column": 5,
- "line": 15,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 374,
- 383,
+ 0,
+ 93,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "VariableDeclaration",
+ },
+ ],
+ "comments": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 0,
+ "line": 10,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
},
+ },
+ "range": Array [
+ 0,
+ 94,
+ ],
+ "sourceType": "script",
+ "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 15,
+ "column": 5,
+ "line": 1,
},
"start": Object {
- "column": 14,
- "line": 15,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 383,
- 384,
+ 0,
+ 5,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 21,
- "line": 15,
+ "column": 10,
+ "line": 1,
},
"start": Object {
- "column": 15,
- "line": 15,
+ "column": 6,
+ "line": 1,
},
},
"range": Array [
- 384,
- 390,
+ 6,
+ 10,
],
"type": "Identifier",
- "value": "number",
+ "value": "pure",
},
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 15,
+ "column": 12,
+ "line": 1,
},
"start": Object {
- "column": 21,
- "line": 15,
+ "column": 11,
+ "line": 1,
},
},
"range": Array [
- 390,
- 391,
+ 11,
+ 12,
],
"type": "Punctuator",
- "value": ">",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 17,
+ "column": 14,
+ "line": 1,
},
"start": Object {
- "column": 6,
- "line": 17,
+ "column": 13,
+ "line": 1,
},
},
"range": Array [
- 416,
- 419,
+ 13,
+ 14,
],
- "type": "JSXIdentifier",
- "value": "foo",
+ "type": "Punctuator",
+ "value": "(",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 18,
+ "column": 15,
+ "line": 1,
},
"start": Object {
- "column": 4,
- "line": 18,
+ "column": 14,
+ "line": 1,
},
},
"range": Array [
- 424,
- 425,
+ 14,
+ 15,
],
"type": "Punctuator",
- "value": ">",
+ "value": ")",
},
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 18,
+ "column": 18,
+ "line": 1,
},
"start": Object {
- "column": 5,
- "line": 18,
+ "column": 16,
+ "line": 1,
},
},
"range": Array [
- 425,
- 426,
+ 16,
+ 18,
],
"type": "Punctuator",
- "value": "<",
+ "value": "=>",
},
Object {
"loc": Object {
"end": Object {
- "column": 7,
- "line": 18,
+ "column": 20,
+ "line": 1,
},
"start": Object {
- "column": 6,
- "line": 18,
+ "column": 19,
+ "line": 1,
},
},
"range": Array [
- 426,
- 427,
+ 19,
+ 20,
],
"type": "Punctuator",
- "value": "/",
+ "value": "{",
},
Object {
"loc": Object {
"end": Object {
- "column": 16,
- "line": 18,
+ "column": 8,
+ "line": 2,
},
"start": Object {
- "column": 7,
- "line": 18,
+ "column": 2,
+ "line": 2,
},
},
"range": Array [
- 427,
- 436,
+ 23,
+ 29,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Keyword",
+ "value": "return",
},
Object {
"loc": Object {
"end": Object {
- "column": 17,
- "line": 18,
+ "column": 10,
+ "line": 2,
},
"start": Object {
- "column": 16,
- "line": 18,
+ "column": 9,
+ "line": 2,
},
},
"range": Array [
- 436,
- 437,
+ 30,
+ 31,
],
"type": "Punctuator",
- "value": ">",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 19,
- },
- "start": Object {
- "column": 17,
- "line": 18,
- },
- },
- "range": Array [
- 437,
- 442,
- ],
- "type": "JSXText",
- "value": "
- ",
+ "value": "(",
},
Object {
"loc": Object {
"end": Object {
"column": 5,
- "line": 19,
+ "line": 3,
},
"start": Object {
"column": 4,
- "line": 19,
+ "line": 3,
},
},
"range": Array [
- 442,
- 443,
+ 36,
+ 37,
],
"type": "Punctuator",
"value": "<",
@@ -6421,125 +8366,129 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 19,
+ "column": 8,
+ "line": 3,
},
"start": Object {
"column": 5,
- "line": 19,
+ "line": 3,
},
},
"range": Array [
- 443,
- 452,
+ 37,
+ 40,
],
"type": "JSXIdentifier",
- "value": "Component",
+ "value": "Foo",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 19,
+ "column": 9,
+ "line": 3,
},
"start": Object {
- "column": 14,
- "line": 19,
+ "column": 8,
+ "line": 3,
},
},
"range": Array [
- 452,
- 453,
+ 40,
+ 41,
],
"type": "Punctuator",
- "value": "<",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 21,
- "line": 19,
+ "column": 4,
+ "line": 7,
},
"start": Object {
- "column": 15,
- "line": 19,
+ "column": 9,
+ "line": 3,
},
},
"range": Array [
- 453,
- 459,
- ],
- "type": "Identifier",
- "value": "number",
+ 41,
+ 80,
+ ],
+ "type": "JSXText",
+ "value": "
+ /**
+ * test
+ */
+ ",
},
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 19,
+ "column": 5,
+ "line": 7,
},
"start": Object {
- "column": 21,
- "line": 19,
+ "column": 4,
+ "line": 7,
},
},
"range": Array [
- 459,
- 460,
+ 80,
+ 81,
],
"type": "Punctuator",
- "value": ">",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 20,
+ "column": 6,
+ "line": 7,
},
"start": Object {
- "column": 6,
- "line": 20,
+ "column": 5,
+ "line": 7,
},
},
"range": Array [
- 467,
- 470,
+ 81,
+ 82,
],
- "type": "JSXIdentifier",
- "value": "foo",
+ "type": "Punctuator",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
"column": 9,
- "line": 22,
+ "line": 7,
},
"start": Object {
"column": 6,
- "line": 22,
+ "line": 7,
},
},
"range": Array [
- 495,
- 498,
+ 82,
+ 85,
],
"type": "JSXIdentifier",
- "value": "bar",
+ "value": "Foo",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 23,
+ "column": 10,
+ "line": 7,
},
"start": Object {
- "column": 4,
- "line": 23,
+ "column": 9,
+ "line": 7,
},
},
"range": Array [
- 503,
- 504,
+ 85,
+ 86,
],
"type": "Punctuator",
"value": ">",
@@ -6547,396 +8496,1011 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 23,
+ "column": 3,
+ "line": 8,
},
"start": Object {
- "column": 5,
- "line": 23,
+ "column": 2,
+ "line": 8,
},
},
"range": Array [
- 504,
- 505,
+ 89,
+ 90,
],
"type": "Punctuator",
- "value": "<",
+ "value": ")",
},
Object {
"loc": Object {
"end": Object {
- "column": 7,
- "line": 23,
+ "column": 4,
+ "line": 8,
},
"start": Object {
- "column": 6,
- "line": 23,
+ "column": 3,
+ "line": 8,
},
},
"range": Array [
- 505,
- 506,
+ 90,
+ 91,
],
"type": "Punctuator",
- "value": "/",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 16,
- "line": 23,
+ "column": 1,
+ "line": 9,
},
"start": Object {
- "column": 7,
- "line": 23,
+ "column": 0,
+ "line": 9,
},
},
"range": Array [
- 506,
- 515,
+ 92,
+ 93,
],
- "type": "JSXIdentifier",
- "value": "Component",
+ "type": "Punctuator",
+ "value": "}",
},
+ ],
+ "type": "Program",
+}
+`;
+
+exports[`Comments fixtures/jsx-text-with-url.src 1`] = `
+Object {
+ "body": Array [
Object {
- "loc": Object {
- "end": Object {
- "column": 17,
- "line": 23,
- },
- "start": Object {
- "column": 16,
- "line": 23,
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 11,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "name": "first",
+ "range": Array [
+ 6,
+ 11,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 37,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 19,
+ 37,
+ ],
+ "raw": "http://example.com",
+ "type": "Literal",
+ "value": "http://example.com",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 37,
+ "line": 1,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 39,
+ "line": 1,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 39,
+ 42,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 37,
+ 43,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 15,
+ 18,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 14,
+ 19,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 14,
+ 43,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 43,
+ ],
+ "type": "VariableDeclarator",
},
- },
- "range": Array [
- 515,
- 516,
],
- "type": "Punctuator",
- "value": ">",
- },
- Object {
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 2,
- "line": 24,
+ "column": 44,
+ "line": 1,
},
"start": Object {
- "column": 17,
- "line": 23,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 516,
- 519,
+ 0,
+ 44,
],
- "type": "JSXText",
- "value": "
- ",
+ "type": "VariableDeclaration",
},
Object {
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "name": "second",
+ "range": Array [
+ 52,
+ 58,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "children": Array [
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 35,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 17,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 63,
+ 81,
+ ],
+ "raw": "http://example.com",
+ "type": "Literal",
+ "value": "http://example.com",
+ },
+ ],
+ "closingFragment": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 35,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 81,
+ 84,
+ ],
+ "type": "JSXClosingFragment",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "openingFragment": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 17,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 61,
+ 63,
+ ],
+ "type": "JSXOpeningFragment",
+ },
+ "range": Array [
+ 61,
+ 84,
+ ],
+ "type": "JSXFragment",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 3,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 3,
+ },
+ },
+ "range": Array [
+ 52,
+ 84,
+ ],
+ "type": "VariableDeclarator",
+ },
+ ],
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 3,
- "line": 24,
+ "column": 39,
+ "line": 3,
},
"start": Object {
- "column": 2,
- "line": 24,
+ "column": 0,
+ "line": 3,
},
},
"range": Array [
- 519,
- 520,
+ 46,
+ 85,
],
- "type": "Punctuator",
- "value": "<",
+ "type": "VariableDeclaration",
},
Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 24,
- },
- "start": Object {
- "column": 3,
- "line": 24,
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 11,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 5,
+ },
+ },
+ "name": "third",
+ "range": Array [
+ 93,
+ 98,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "children": Array [
+ Object {
+ "children": Array [],
+ "closingElement": null,
+ "loc": Object {
+ "end": Object {
+ "column": 25,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 5,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 25,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 20,
+ "line": 5,
+ },
+ },
+ "name": "br",
+ "range": Array [
+ 107,
+ 109,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 106,
+ 112,
+ ],
+ "selfClosing": true,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 106,
+ 112,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 25,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 112,
+ 130,
+ ],
+ "raw": "http://example.com",
+ "type": "Literal",
+ "value": "http://example.com",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 49,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 43,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 48,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 45,
+ "line": 5,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 132,
+ 135,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 130,
+ 136,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 49,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 5,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 5,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 5,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 102,
+ 105,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 101,
+ 106,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 101,
+ 136,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 49,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 93,
+ 136,
+ ],
+ "type": "VariableDeclarator",
},
- },
- "range": Array [
- 520,
- 521,
],
- "type": "Punctuator",
- "value": "/",
- },
- Object {
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 5,
- "line": 24,
+ "column": 50,
+ "line": 5,
},
"start": Object {
- "column": 4,
- "line": 24,
+ "column": 0,
+ "line": 5,
},
},
"range": Array [
- 521,
- 522,
+ 87,
+ 137,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "VariableDeclaration",
},
Object {
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 25,
- },
- "start": Object {
- "column": 0,
- "line": 25,
+ "declarations": Array [
+ Object {
+ "id": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 12,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 7,
+ },
+ },
+ "name": "fourth",
+ "range": Array [
+ 145,
+ 151,
+ ],
+ "type": "Identifier",
+ },
+ "init": Object {
+ "children": Array [
+ Object {
+ "children": Array [],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 33,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 26,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 32,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 28,
+ "line": 7,
+ },
+ },
+ "name": "span",
+ "range": Array [
+ 167,
+ 171,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 165,
+ 172,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 33,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 20,
+ "line": 7,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 26,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 20,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 25,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 7,
+ },
+ },
+ "name": "span",
+ "range": Array [
+ 160,
+ 164,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 159,
+ 165,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 159,
+ 172,
+ ],
+ "type": "JSXElement",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 51,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 33,
+ "line": 7,
+ },
+ },
+ "range": Array [
+ 172,
+ 190,
+ ],
+ "raw": "http://example.com",
+ "type": "Literal",
+ "value": "http://example.com",
+ },
+ ],
+ "closingElement": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 57,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 51,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 56,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 53,
+ "line": 7,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 192,
+ 195,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 190,
+ 196,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 57,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 7,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 20,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 7,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 16,
+ "line": 7,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 155,
+ 158,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 154,
+ 159,
+ ],
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
+ },
+ "range": Array [
+ 154,
+ 196,
+ ],
+ "type": "JSXElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 57,
+ "line": 7,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 7,
+ },
+ },
+ "range": Array [
+ 145,
+ 196,
+ ],
+ "type": "VariableDeclarator",
},
- },
- "range": Array [
- 523,
- 524,
],
- "type": "Punctuator",
- "value": ")",
- },
- Object {
+ "kind": "const",
"loc": Object {
"end": Object {
- "column": 2,
- "line": 25,
+ "column": 58,
+ "line": 7,
},
"start": Object {
- "column": 1,
- "line": 25,
+ "column": 0,
+ "line": 7,
},
},
"range": Array [
- 524,
- 525,
+ 139,
+ 197,
],
- "type": "Punctuator",
- "value": ";",
+ "type": "VariableDeclaration",
},
- ],
- "type": "Program",
-}
-`;
-
-exports[`Comments fixtures/jsx-tag-comments.src 1`] = `
-Object {
- "body": Array [
Object {
"declarations": Array [
Object {
"id": Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 1,
+ "column": 11,
+ "line": 9,
},
"start": Object {
"column": 6,
- "line": 1,
+ "line": 9,
},
},
- "name": "pure",
+ "name": "fifth",
"range": Array [
- 6,
- 10,
+ 205,
+ 210,
],
"type": "Identifier",
},
"init": Object {
- "async": false,
- "body": Object {
- "body": Array [
- Object {
- "argument": Object {
- "children": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 8,
- "line": 7,
- },
- "start": Object {
- "column": 9,
- "line": 6,
- },
- },
- "range": Array [
- 103,
- 112,
- ],
- "raw": "
- ",
- "type": "Literal",
- "value": "
- ",
- },
- ],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 7,
- },
- "start": Object {
- "column": 8,
- "line": 7,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 13,
- "line": 7,
- },
- "start": Object {
- "column": 10,
- "line": 7,
- },
- },
- "name": "Foo",
- "range": Array [
- 114,
- 117,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 112,
- 118,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 14,
- "line": 7,
- },
- "start": Object {
- "column": 8,
- "line": 3,
- },
- },
- "openingElement": Object {
- "attributes": Array [],
- "loc": Object {
- "end": Object {
- "column": 9,
- "line": 6,
- },
- "start": Object {
- "column": 8,
- "line": 3,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 12,
- "line": 3,
- },
- "start": Object {
- "column": 9,
- "line": 3,
- },
- },
- "name": "Foo",
- "range": Array [
- 43,
- 46,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 42,
- 103,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- },
- "range": Array [
- 42,
- 118,
- ],
- "type": "JSXElement",
- },
+ "children": Array [
+ Object {
+ "expression": Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 8,
+ "column": 20,
+ "line": 9,
},
"start": Object {
- "column": 4,
- "line": 2,
+ "column": 20,
+ "line": 9,
},
},
"range": Array [
- 25,
- 125,
+ 219,
+ 219,
],
- "type": "ReturnStatement",
+ "type": "JSXEmptyExpression",
},
- ],
+ "loc": Object {
+ "end": Object {
+ "column": 21,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 9,
+ },
+ },
+ "range": Array [
+ 218,
+ 220,
+ ],
+ "type": "JSXExpressionContainer",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 39,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 21,
+ "line": 9,
+ },
+ },
+ "range": Array [
+ 220,
+ 238,
+ ],
+ "raw": "http://example.com",
+ "type": "Literal",
+ "value": "http://example.com",
+ },
+ ],
+ "closingElement": Object {
"loc": Object {
"end": Object {
- "column": 1,
+ "column": 45,
"line": 9,
},
"start": Object {
+ "column": 39,
+ "line": 9,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 44,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 41,
+ "line": 9,
+ },
+ },
+ "name": "div",
+ "range": Array [
+ 240,
+ 243,
+ ],
+ "type": "JSXIdentifier",
+ },
+ "range": Array [
+ 238,
+ 244,
+ ],
+ "type": "JSXClosingElement",
+ },
+ "loc": Object {
+ "end": Object {
+ "column": 45,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 9,
+ },
+ },
+ "openingElement": Object {
+ "attributes": Array [],
+ "loc": Object {
+ "end": Object {
"column": 19,
- "line": 1,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 9,
+ },
+ },
+ "name": Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 9,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 9,
+ },
},
+ "name": "div",
+ "range": Array [
+ 214,
+ 217,
+ ],
+ "type": "JSXIdentifier",
},
"range": Array [
- 19,
- 127,
+ 213,
+ 218,
],
- "type": "BlockStatement",
- },
- "expression": false,
- "generator": false,
- "id": null,
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 9,
- },
- "start": Object {
- "column": 13,
- "line": 1,
- },
+ "selfClosing": false,
+ "type": "JSXOpeningElement",
},
- "params": Array [],
"range": Array [
- 13,
- 127,
+ 213,
+ 244,
],
- "type": "ArrowFunctionExpression",
+ "type": "JSXElement",
},
"loc": Object {
"end": Object {
- "column": 1,
+ "column": 45,
"line": 9,
},
"start": Object {
"column": 6,
- "line": 1,
+ "line": 9,
},
},
"range": Array [
- 6,
- 127,
+ 205,
+ 244,
],
"type": "VariableDeclarator",
},
@@ -6944,378 +9508,538 @@ Object {
"kind": "const",
"loc": Object {
"end": Object {
- "column": 1,
+ "column": 46,
"line": 9,
},
"start": Object {
"column": 0,
- "line": 1,
+ "line": 9,
},
},
"range": Array [
- 0,
- 127,
+ 199,
+ 245,
],
"type": "VariableDeclaration",
},
],
- "comments": Array [
+ "comments": Array [],
+ "loc": Object {
+ "end": Object {
+ "column": 0,
+ "line": 10,
+ },
+ "start": Object {
+ "column": 0,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 0,
+ 246,
+ ],
+ "sourceType": "script",
+ "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 21,
- "line": 4,
+ "column": 5,
+ "line": 1,
},
"start": Object {
- "column": 12,
- "line": 4,
+ "column": 0,
+ "line": 1,
},
},
"range": Array [
- 59,
- 68,
+ 0,
+ 5,
],
- "type": "Line",
- "value": " single",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 23,
- "line": 5,
+ "column": 11,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 6,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 6,
+ 11,
+ ],
+ "type": "Identifier",
+ "value": "first",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 13,
+ "line": 1,
},
"start": Object {
"column": 12,
- "line": 5,
+ "line": 1,
},
},
"range": Array [
- 81,
- 92,
+ 12,
+ 13,
],
- "type": "Block",
- "value": " block ",
+ "type": "Punctuator",
+ "value": "=",
},
- ],
- "loc": Object {
- "end": Object {
- "column": 0,
- "line": 11,
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 15,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 14,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 14,
+ 15,
+ ],
+ "type": "Punctuator",
+ "value": "<",
},
- "start": Object {
- "column": 0,
- "line": 1,
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 18,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 15,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 15,
+ 18,
+ ],
+ "type": "JSXIdentifier",
+ "value": "div",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 19,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 18,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 18,
+ 19,
+ ],
+ "type": "Punctuator",
+ "value": ">",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 37,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 19,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 19,
+ 37,
+ ],
+ "type": "JSXText",
+ "value": "http://example.com",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 38,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 37,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 37,
+ 38,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 39,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 38,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 38,
+ 39,
+ ],
+ "type": "Punctuator",
+ "value": "/",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 42,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 39,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 39,
+ 42,
+ ],
+ "type": "JSXIdentifier",
+ "value": "div",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 1,
+ },
+ "start": Object {
+ "column": 42,
+ "line": 1,
+ },
+ },
+ "range": Array [
+ 42,
+ 43,
+ ],
+ "type": "Punctuator",
+ "value": ">",
},
- },
- "range": Array [
- 0,
- 129,
- ],
- "sourceType": "script",
- "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 5,
+ "column": 44,
"line": 1,
},
"start": Object {
- "column": 0,
+ "column": 43,
"line": 1,
},
},
"range": Array [
- 0,
- 5,
+ 43,
+ 44,
],
- "type": "Keyword",
- "value": "const",
+ "type": "Punctuator",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 1,
+ "column": 5,
+ "line": 3,
},
"start": Object {
- "column": 6,
- "line": 1,
+ "column": 0,
+ "line": 3,
},
},
"range": Array [
- 6,
- 10,
+ 46,
+ 51,
],
- "type": "Identifier",
- "value": "pure",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
"column": 12,
- "line": 1,
+ "line": 3,
},
"start": Object {
- "column": 11,
- "line": 1,
+ "column": 6,
+ "line": 3,
},
},
"range": Array [
- 11,
- 12,
+ 52,
+ 58,
],
- "type": "Punctuator",
- "value": "=",
+ "type": "Identifier",
+ "value": "second",
},
Object {
"loc": Object {
"end": Object {
"column": 14,
- "line": 1,
+ "line": 3,
},
"start": Object {
"column": 13,
- "line": 1,
+ "line": 3,
},
},
"range": Array [
- 13,
- 14,
+ 59,
+ 60,
],
"type": "Punctuator",
- "value": "(",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 1,
+ "column": 16,
+ "line": 3,
},
"start": Object {
- "column": 14,
- "line": 1,
+ "column": 15,
+ "line": 3,
},
},
"range": Array [
- 14,
- 15,
+ 61,
+ 62,
],
"type": "Punctuator",
- "value": ")",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 18,
- "line": 1,
+ "column": 17,
+ "line": 3,
},
"start": Object {
"column": 16,
- "line": 1,
+ "line": 3,
},
},
"range": Array [
- 16,
- 18,
+ 62,
+ 63,
],
"type": "Punctuator",
- "value": "=>",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 20,
- "line": 1,
+ "column": 35,
+ "line": 3,
},
"start": Object {
- "column": 19,
- "line": 1,
+ "column": 17,
+ "line": 3,
},
},
"range": Array [
- 19,
- 20,
+ 63,
+ 81,
],
- "type": "Punctuator",
- "value": "{",
+ "type": "JSXText",
+ "value": "http://example.com",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 2,
+ "column": 36,
+ "line": 3,
},
"start": Object {
- "column": 4,
- "line": 2,
+ "column": 35,
+ "line": 3,
},
},
"range": Array [
- 25,
- 31,
+ 81,
+ 82,
],
- "type": "Keyword",
- "value": "return",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 2,
+ "column": 37,
+ "line": 3,
},
"start": Object {
- "column": 11,
- "line": 2,
+ "column": 36,
+ "line": 3,
},
},
"range": Array [
- 32,
- 33,
+ 82,
+ 83,
],
"type": "Punctuator",
- "value": "(",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
+ "column": 38,
"line": 3,
},
"start": Object {
- "column": 8,
+ "column": 37,
"line": 3,
},
},
"range": Array [
- 42,
- 43,
+ 83,
+ 84,
],
"type": "Punctuator",
- "value": "<",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
+ "column": 39,
"line": 3,
},
"start": Object {
- "column": 9,
+ "column": 38,
"line": 3,
},
},
"range": Array [
- 43,
- 46,
+ 84,
+ 85,
],
- "type": "JSXIdentifier",
- "value": "Foo",
+ "type": "Punctuator",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 6,
+ "column": 5,
+ "line": 5,
},
"start": Object {
- "column": 8,
- "line": 6,
+ "column": 0,
+ "line": 5,
},
},
"range": Array [
- 102,
- 103,
+ 87,
+ 92,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 8,
- "line": 7,
+ "column": 11,
+ "line": 5,
},
"start": Object {
- "column": 9,
- "line": 6,
+ "column": 6,
+ "line": 5,
},
},
"range": Array [
- 103,
- 112,
+ 93,
+ 98,
],
- "type": "JSXText",
- "value": "
- ",
+ "type": "Identifier",
+ "value": "third",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 7,
+ "column": 13,
+ "line": 5,
},
"start": Object {
- "column": 8,
- "line": 7,
+ "column": 12,
+ "line": 5,
},
},
"range": Array [
- 112,
- 113,
+ 99,
+ 100,
],
"type": "Punctuator",
- "value": "<",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 7,
+ "column": 15,
+ "line": 5,
},
"start": Object {
- "column": 9,
- "line": 7,
+ "column": 14,
+ "line": 5,
},
},
"range": Array [
- 113,
- 114,
+ 101,
+ 102,
],
"type": "Punctuator",
- "value": "/",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 13,
- "line": 7,
+ "column": 18,
+ "line": 5,
},
"start": Object {
- "column": 10,
- "line": 7,
+ "column": 15,
+ "line": 5,
},
},
"range": Array [
- 114,
- 117,
+ 102,
+ 105,
],
"type": "JSXIdentifier",
- "value": "Foo",
+ "value": "div",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 7,
+ "column": 19,
+ "line": 5,
},
"start": Object {
- "column": 13,
- "line": 7,
+ "column": 18,
+ "line": 5,
},
},
"range": Array [
- 117,
- 118,
+ 105,
+ 106,
],
"type": "Punctuator",
"value": ">",
@@ -7323,566 +10047,359 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 8,
+ "column": 20,
+ "line": 5,
},
"start": Object {
- "column": 4,
- "line": 8,
+ "column": 19,
+ "line": 5,
},
},
"range": Array [
- 123,
- 124,
+ 106,
+ 107,
+ ],
+ "type": "Punctuator",
+ "value": "<",
+ },
+ Object {
+ "loc": Object {
+ "end": Object {
+ "column": 22,
+ "line": 5,
+ },
+ "start": Object {
+ "column": 20,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 107,
+ 109,
],
- "type": "Punctuator",
- "value": ")",
+ "type": "JSXIdentifier",
+ "value": "br",
},
Object {
"loc": Object {
"end": Object {
- "column": 6,
- "line": 8,
+ "column": 24,
+ "line": 5,
},
"start": Object {
- "column": 5,
- "line": 8,
+ "column": 23,
+ "line": 5,
},
},
"range": Array [
- 124,
- 125,
+ 110,
+ 111,
],
"type": "Punctuator",
- "value": ";",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 1,
- "line": 9,
+ "column": 25,
+ "line": 5,
},
"start": Object {
- "column": 0,
- "line": 9,
+ "column": 24,
+ "line": 5,
},
},
"range": Array [
- 126,
- 127,
+ 111,
+ 112,
],
"type": "Punctuator",
- "value": "}",
+ "value": ">",
},
- ],
- "type": "Program",
-}
-`;
-
-exports[`Comments fixtures/jsx-text-with-multiline-non-comment.src 1`] = `
-Object {
- "body": Array [
Object {
- "declarations": Array [
- Object {
- "id": Object {
- "loc": Object {
- "end": Object {
- "column": 10,
- "line": 1,
- },
- "start": Object {
- "column": 6,
- "line": 1,
- },
- },
- "name": "pure",
- "range": Array [
- 6,
- 10,
- ],
- "type": "Identifier",
- },
- "init": Object {
- "async": false,
- "body": Object {
- "body": Array [
- Object {
- "argument": Object {
- "children": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 7,
- },
- "start": Object {
- "column": 9,
- "line": 3,
- },
- },
- "range": Array [
- 41,
- 80,
- ],
- "raw": "
- /**
- * test
- */
- ",
- "type": "Literal",
- "value": "
- /**
- * test
- */
- ",
- },
- ],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 10,
- "line": 7,
- },
- "start": Object {
- "column": 4,
- "line": 7,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 9,
- "line": 7,
- },
- "start": Object {
- "column": 6,
- "line": 7,
- },
- },
- "name": "Foo",
- "range": Array [
- 82,
- 85,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 80,
- 86,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 10,
- "line": 7,
- },
- "start": Object {
- "column": 4,
- "line": 3,
- },
- },
- "openingElement": Object {
- "attributes": Array [],
- "loc": Object {
- "end": Object {
- "column": 9,
- "line": 3,
- },
- "start": Object {
- "column": 4,
- "line": 3,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 8,
- "line": 3,
- },
- "start": Object {
- "column": 5,
- "line": 3,
- },
- },
- "name": "Foo",
- "range": Array [
- 37,
- 40,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 36,
- 41,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- },
- "range": Array [
- 36,
- 86,
- ],
- "type": "JSXElement",
- },
- "loc": Object {
- "end": Object {
- "column": 4,
- "line": 8,
- },
- "start": Object {
- "column": 2,
- "line": 2,
- },
- },
- "range": Array [
- 23,
- 91,
- ],
- "type": "ReturnStatement",
- },
- ],
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 9,
- },
- "start": Object {
- "column": 19,
- "line": 1,
- },
- },
- "range": Array [
- 19,
- 93,
- ],
- "type": "BlockStatement",
- },
- "expression": false,
- "generator": false,
- "id": null,
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 9,
- },
- "start": Object {
- "column": 13,
- "line": 1,
- },
- },
- "params": Array [],
- "range": Array [
- 13,
- 93,
- ],
- "type": "ArrowFunctionExpression",
- },
- "loc": Object {
- "end": Object {
- "column": 1,
- "line": 9,
- },
- "start": Object {
- "column": 6,
- "line": 1,
- },
- },
- "range": Array [
- 6,
- 93,
- ],
- "type": "VariableDeclarator",
+ "loc": Object {
+ "end": Object {
+ "column": 43,
+ "line": 5,
},
+ "start": Object {
+ "column": 25,
+ "line": 5,
+ },
+ },
+ "range": Array [
+ 112,
+ 130,
],
- "kind": "const",
+ "type": "JSXText",
+ "value": "http://example.com",
+ },
+ Object {
"loc": Object {
"end": Object {
- "column": 1,
- "line": 9,
+ "column": 44,
+ "line": 5,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 43,
+ "line": 5,
},
},
"range": Array [
- 0,
- 93,
+ 130,
+ 131,
],
- "type": "VariableDeclaration",
- },
- ],
- "comments": Array [],
- "loc": Object {
- "end": Object {
- "column": 0,
- "line": 10,
- },
- "start": Object {
- "column": 0,
- "line": 1,
+ "type": "Punctuator",
+ "value": "<",
},
- },
- "range": Array [
- 0,
- 94,
- ],
- "sourceType": "script",
- "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 1,
+ "column": 45,
+ "line": 5,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 44,
+ "line": 5,
},
},
"range": Array [
- 0,
- 5,
+ 131,
+ 132,
],
- "type": "Keyword",
- "value": "const",
+ "type": "Punctuator",
+ "value": "/",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 1,
+ "column": 48,
+ "line": 5,
},
"start": Object {
- "column": 6,
- "line": 1,
+ "column": 45,
+ "line": 5,
},
},
"range": Array [
- 6,
- 10,
+ 132,
+ 135,
],
- "type": "Identifier",
- "value": "pure",
+ "type": "JSXIdentifier",
+ "value": "div",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 1,
+ "column": 49,
+ "line": 5,
},
"start": Object {
- "column": 11,
- "line": 1,
+ "column": 48,
+ "line": 5,
},
},
"range": Array [
- 11,
- 12,
+ 135,
+ 136,
],
"type": "Punctuator",
- "value": "=",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 1,
+ "column": 50,
+ "line": 5,
},
"start": Object {
- "column": 13,
- "line": 1,
+ "column": 49,
+ "line": 5,
},
},
"range": Array [
- 13,
- 14,
+ 136,
+ 137,
],
"type": "Punctuator",
- "value": "(",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 1,
+ "column": 5,
+ "line": 7,
},
"start": Object {
- "column": 14,
- "line": 1,
+ "column": 0,
+ "line": 7,
},
},
"range": Array [
- 14,
- 15,
+ 139,
+ 144,
],
- "type": "Punctuator",
- "value": ")",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 18,
- "line": 1,
+ "column": 12,
+ "line": 7,
},
"start": Object {
- "column": 16,
- "line": 1,
+ "column": 6,
+ "line": 7,
},
},
"range": Array [
- 16,
- 18,
+ 145,
+ 151,
],
- "type": "Punctuator",
- "value": "=>",
+ "type": "Identifier",
+ "value": "fourth",
},
Object {
"loc": Object {
"end": Object {
- "column": 20,
- "line": 1,
+ "column": 14,
+ "line": 7,
},
"start": Object {
- "column": 19,
- "line": 1,
+ "column": 13,
+ "line": 7,
},
},
"range": Array [
- 19,
- 20,
+ 152,
+ 153,
],
"type": "Punctuator",
- "value": "{",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 8,
- "line": 2,
+ "column": 16,
+ "line": 7,
},
"start": Object {
- "column": 2,
- "line": 2,
+ "column": 15,
+ "line": 7,
},
},
"range": Array [
- 23,
- 29,
+ 154,
+ 155,
],
- "type": "Keyword",
- "value": "return",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 2,
+ "column": 19,
+ "line": 7,
},
"start": Object {
- "column": 9,
- "line": 2,
+ "column": 16,
+ "line": 7,
},
},
"range": Array [
- 30,
- 31,
+ 155,
+ 158,
],
- "type": "Punctuator",
- "value": "(",
+ "type": "JSXIdentifier",
+ "value": "div",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 3,
+ "column": 20,
+ "line": 7,
},
"start": Object {
- "column": 4,
- "line": 3,
+ "column": 19,
+ "line": 7,
},
},
"range": Array [
- 36,
- 37,
+ 158,
+ 159,
],
"type": "Punctuator",
- "value": "<",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 8,
- "line": 3,
+ "column": 21,
+ "line": 7,
},
"start": Object {
- "column": 5,
- "line": 3,
+ "column": 20,
+ "line": 7,
},
},
"range": Array [
- 37,
- 40,
+ 159,
+ 160,
],
- "type": "JSXIdentifier",
- "value": "Foo",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 9,
- "line": 3,
+ "column": 25,
+ "line": 7,
},
"start": Object {
- "column": 8,
- "line": 3,
+ "column": 21,
+ "line": 7,
},
},
"range": Array [
- 40,
- 41,
+ 160,
+ 164,
],
- "type": "Punctuator",
- "value": ">",
+ "type": "JSXIdentifier",
+ "value": "span",
},
Object {
"loc": Object {
"end": Object {
- "column": 4,
+ "column": 26,
"line": 7,
},
"start": Object {
- "column": 9,
- "line": 3,
+ "column": 25,
+ "line": 7,
},
},
"range": Array [
- 41,
- 80,
+ 164,
+ 165,
],
- "type": "JSXText",
- "value": "
- /**
- * test
- */
- ",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 5,
+ "column": 27,
"line": 7,
},
"start": Object {
- "column": 4,
+ "column": 26,
"line": 7,
},
},
"range": Array [
- 80,
- 81,
+ 165,
+ 166,
],
"type": "Punctuator",
"value": "<",
@@ -7890,17 +10407,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 6,
+ "column": 28,
"line": 7,
},
"start": Object {
- "column": 5,
+ "column": 27,
"line": 7,
},
},
"range": Array [
- 81,
- 82,
+ 166,
+ 167,
],
"type": "Punctuator",
"value": "/",
@@ -7908,35 +10425,35 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 9,
+ "column": 32,
"line": 7,
},
"start": Object {
- "column": 6,
+ "column": 28,
"line": 7,
},
},
"range": Array [
- 82,
- 85,
+ 167,
+ 171,
],
"type": "JSXIdentifier",
- "value": "Foo",
+ "value": "span",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
+ "column": 33,
"line": 7,
},
"start": Object {
- "column": 9,
+ "column": 32,
"line": 7,
},
},
"range": Array [
- 85,
- 86,
+ 171,
+ 172,
],
"type": "Punctuator",
"value": ">",
@@ -7944,497 +10461,269 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 3,
- "line": 8,
+ "column": 51,
+ "line": 7,
},
"start": Object {
- "column": 2,
- "line": 8,
+ "column": 33,
+ "line": 7,
},
},
"range": Array [
- 89,
- 90,
+ 172,
+ 190,
],
- "type": "Punctuator",
- "value": ")",
+ "type": "JSXText",
+ "value": "http://example.com",
},
Object {
"loc": Object {
"end": Object {
- "column": 4,
- "line": 8,
+ "column": 52,
+ "line": 7,
},
"start": Object {
- "column": 3,
- "line": 8,
+ "column": 51,
+ "line": 7,
},
},
"range": Array [
- 90,
- 91,
+ 190,
+ 191,
],
"type": "Punctuator",
- "value": ";",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 1,
- "line": 9,
+ "column": 53,
+ "line": 7,
},
"start": Object {
- "column": 0,
- "line": 9,
+ "column": 52,
+ "line": 7,
},
},
"range": Array [
- 92,
- 93,
+ 191,
+ 192,
],
"type": "Punctuator",
- "value": "}",
+ "value": "/",
},
- ],
- "type": "Program",
-}
-`;
-
-exports[`Comments fixtures/jsx-text-with-url.src 1`] = `
-Object {
- "body": Array [
Object {
- "declarations": Array [
- Object {
- "id": Object {
- "loc": Object {
- "end": Object {
- "column": 10,
- "line": 1,
- },
- "start": Object {
- "column": 6,
- "line": 1,
- },
- },
- "name": "link",
- "range": Array [
- 6,
- 10,
- ],
- "type": "Identifier",
- },
- "init": Object {
- "children": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 61,
- "line": 1,
- },
- "start": Object {
- "column": 43,
- "line": 1,
- },
- },
- "range": Array [
- 43,
- 61,
- ],
- "raw": "http://example.com",
- "type": "Literal",
- "value": "http://example.com",
- },
- ],
- "closingElement": Object {
- "loc": Object {
- "end": Object {
- "column": 65,
- "line": 1,
- },
- "start": Object {
- "column": 61,
- "line": 1,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 64,
- "line": 1,
- },
- "start": Object {
- "column": 63,
- "line": 1,
- },
- },
- "name": "a",
- "range": Array [
- 63,
- 64,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 61,
- 65,
- ],
- "type": "JSXClosingElement",
- },
- "loc": Object {
- "end": Object {
- "column": 65,
- "line": 1,
- },
- "start": Object {
- "column": 14,
- "line": 1,
- },
- },
- "openingElement": Object {
- "attributes": Array [
- Object {
- "loc": Object {
- "end": Object {
- "column": 42,
- "line": 1,
- },
- "start": Object {
- "column": 17,
- "line": 1,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 21,
- "line": 1,
- },
- "start": Object {
- "column": 17,
- "line": 1,
- },
- },
- "name": "href",
- "range": Array [
- 17,
- 21,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 17,
- 42,
- ],
- "type": "JSXAttribute",
- "value": Object {
- "loc": Object {
- "end": Object {
- "column": 42,
- "line": 1,
- },
- "start": Object {
- "column": 22,
- "line": 1,
- },
- },
- "range": Array [
- 22,
- 42,
- ],
- "raw": "\\"http://example.com\\"",
- "type": "Literal",
- "value": "http://example.com",
- },
- },
- ],
- "loc": Object {
- "end": Object {
- "column": 43,
- "line": 1,
- },
- "start": Object {
- "column": 14,
- "line": 1,
- },
- },
- "name": Object {
- "loc": Object {
- "end": Object {
- "column": 16,
- "line": 1,
- },
- "start": Object {
- "column": 15,
- "line": 1,
- },
- },
- "name": "a",
- "range": Array [
- 15,
- 16,
- ],
- "type": "JSXIdentifier",
- },
- "range": Array [
- 14,
- 43,
- ],
- "selfClosing": false,
- "type": "JSXOpeningElement",
- },
- "range": Array [
- 14,
- 65,
- ],
- "type": "JSXElement",
- },
- "loc": Object {
- "end": Object {
- "column": 66,
- "line": 1,
- },
- "start": Object {
- "column": 6,
- "line": 1,
- },
- },
- "range": Array [
- 6,
- 66,
- ],
- "type": "VariableDeclarator",
- },
- ],
- "kind": "const",
"loc": Object {
"end": Object {
- "column": 67,
- "line": 1,
+ "column": 56,
+ "line": 7,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 53,
+ "line": 7,
},
},
"range": Array [
- 0,
- 67,
+ 192,
+ 195,
],
- "type": "VariableDeclaration",
- },
- ],
- "comments": Array [],
- "loc": Object {
- "end": Object {
- "column": 0,
- "line": 2,
- },
- "start": Object {
- "column": 0,
- "line": 1,
+ "type": "JSXIdentifier",
+ "value": "div",
},
- },
- "range": Array [
- 0,
- 68,
- ],
- "sourceType": "script",
- "tokens": Array [
Object {
"loc": Object {
"end": Object {
- "column": 5,
- "line": 1,
+ "column": 57,
+ "line": 7,
},
"start": Object {
- "column": 0,
- "line": 1,
+ "column": 56,
+ "line": 7,
},
},
"range": Array [
- 0,
- 5,
+ 195,
+ 196,
],
- "type": "Keyword",
- "value": "const",
+ "type": "Punctuator",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 10,
- "line": 1,
+ "column": 58,
+ "line": 7,
},
"start": Object {
- "column": 6,
- "line": 1,
+ "column": 57,
+ "line": 7,
},
},
"range": Array [
- 6,
- 10,
+ 196,
+ 197,
],
- "type": "Identifier",
- "value": "link",
+ "type": "Punctuator",
+ "value": ";",
},
Object {
"loc": Object {
"end": Object {
- "column": 12,
- "line": 1,
+ "column": 5,
+ "line": 9,
},
"start": Object {
- "column": 11,
- "line": 1,
+ "column": 0,
+ "line": 9,
},
},
"range": Array [
- 11,
- 12,
+ 199,
+ 204,
],
- "type": "Punctuator",
- "value": "=",
+ "type": "Keyword",
+ "value": "const",
},
Object {
"loc": Object {
"end": Object {
- "column": 14,
- "line": 1,
+ "column": 11,
+ "line": 9,
},
"start": Object {
- "column": 13,
- "line": 1,
+ "column": 6,
+ "line": 9,
},
},
"range": Array [
- 13,
- 14,
+ 205,
+ 210,
],
- "type": "Punctuator",
- "value": "(",
+ "type": "Identifier",
+ "value": "fifth",
},
Object {
"loc": Object {
"end": Object {
- "column": 15,
- "line": 1,
+ "column": 13,
+ "line": 9,
},
"start": Object {
- "column": 14,
- "line": 1,
+ "column": 12,
+ "line": 9,
},
},
"range": Array [
- 14,
- 15,
+ 211,
+ 212,
],
"type": "Punctuator",
- "value": "<",
+ "value": "=",
},
Object {
"loc": Object {
"end": Object {
- "column": 16,
- "line": 1,
+ "column": 15,
+ "line": 9,
},
"start": Object {
- "column": 15,
- "line": 1,
+ "column": 14,
+ "line": 9,
},
},
"range": Array [
- 15,
- 16,
+ 213,
+ 214,
],
- "type": "JSXIdentifier",
- "value": "a",
+ "type": "Punctuator",
+ "value": "<",
},
Object {
"loc": Object {
"end": Object {
- "column": 21,
- "line": 1,
+ "column": 18,
+ "line": 9,
},
"start": Object {
- "column": 17,
- "line": 1,
+ "column": 15,
+ "line": 9,
},
},
"range": Array [
- 17,
- 21,
+ 214,
+ 217,
],
"type": "JSXIdentifier",
- "value": "href",
+ "value": "div",
},
Object {
"loc": Object {
"end": Object {
- "column": 22,
- "line": 1,
+ "column": 19,
+ "line": 9,
},
"start": Object {
- "column": 21,
- "line": 1,
+ "column": 18,
+ "line": 9,
},
},
"range": Array [
- 21,
- 22,
+ 217,
+ 218,
],
"type": "Punctuator",
- "value": "=",
+ "value": ">",
},
Object {
"loc": Object {
"end": Object {
- "column": 42,
- "line": 1,
+ "column": 20,
+ "line": 9,
},
"start": Object {
- "column": 22,
- "line": 1,
+ "column": 19,
+ "line": 9,
},
},
"range": Array [
- 22,
- 42,
+ 218,
+ 219,
],
- "type": "JSXText",
- "value": "\\"http://example.com\\"",
+ "type": "Punctuator",
+ "value": "{",
},
Object {
"loc": Object {
"end": Object {
- "column": 43,
- "line": 1,
+ "column": 21,
+ "line": 9,
},
"start": Object {
- "column": 42,
- "line": 1,
+ "column": 20,
+ "line": 9,
},
},
"range": Array [
- 42,
- 43,
+ 219,
+ 220,
],
"type": "Punctuator",
- "value": ">",
+ "value": "}",
},
Object {
"loc": Object {
"end": Object {
- "column": 61,
- "line": 1,
+ "column": 39,
+ "line": 9,
},
"start": Object {
- "column": 43,
- "line": 1,
+ "column": 21,
+ "line": 9,
},
},
"range": Array [
- 43,
- 61,
+ 220,
+ 238,
],
"type": "JSXText",
"value": "http://example.com",
@@ -8442,17 +10731,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 62,
- "line": 1,
+ "column": 40,
+ "line": 9,
},
"start": Object {
- "column": 61,
- "line": 1,
+ "column": 39,
+ "line": 9,
},
},
"range": Array [
- 61,
- 62,
+ 238,
+ 239,
],
"type": "Punctuator",
"value": "<",
@@ -8460,17 +10749,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 63,
- "line": 1,
+ "column": 41,
+ "line": 9,
},
"start": Object {
- "column": 62,
- "line": 1,
+ "column": 40,
+ "line": 9,
},
},
"range": Array [
- 62,
- 63,
+ 239,
+ 240,
],
"type": "Punctuator",
"value": "/",
@@ -8478,35 +10767,35 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 64,
- "line": 1,
+ "column": 44,
+ "line": 9,
},
"start": Object {
- "column": 63,
- "line": 1,
+ "column": 41,
+ "line": 9,
},
},
"range": Array [
- 63,
- 64,
+ 240,
+ 243,
],
"type": "JSXIdentifier",
- "value": "a",
+ "value": "div",
},
Object {
"loc": Object {
"end": Object {
- "column": 65,
- "line": 1,
+ "column": 45,
+ "line": 9,
},
"start": Object {
- "column": 64,
- "line": 1,
+ "column": 44,
+ "line": 9,
},
},
"range": Array [
- 64,
- 65,
+ 243,
+ 244,
],
"type": "Punctuator",
"value": ">",
@@ -8514,35 +10803,17 @@ Object {
Object {
"loc": Object {
"end": Object {
- "column": 66,
- "line": 1,
- },
- "start": Object {
- "column": 65,
- "line": 1,
- },
- },
- "range": Array [
- 65,
- 66,
- ],
- "type": "Punctuator",
- "value": ")",
- },
- Object {
- "loc": Object {
- "end": Object {
- "column": 67,
- "line": 1,
+ "column": 46,
+ "line": 9,
},
"start": Object {
- "column": 66,
- "line": 1,
+ "column": 45,
+ "line": 9,
},
},
"range": Array [
- 66,
- 67,
+ 244,
+ 245,
],
"type": "Punctuator",
"value": ";",
diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap
index de734d08383..227932cd936 100644
--- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap
+++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap
@@ -8,6 +8,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e
exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsdoc-comment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`;
+exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-attr-and-text-with-url.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`;
+
exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-block-comment.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`;
exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/comments/jsx-comment-after-jsx.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`;