diff --git a/lib/ast-converter.js b/lib/ast-converter.js index 0ee75f6..066dc47 100644 --- a/lib/ast-converter.js +++ b/lib/ast-converter.js @@ -56,7 +56,8 @@ module.exports = (ast, extra) => { parent: null, ast, additionalOptions: { - errorOnUnknownASTType: extra.errorOnUnknownASTType || false + errorOnUnknownASTType: extra.errorOnUnknownASTType || false, + useJSXTextNode: extra.useJSXTextNode || false } }); diff --git a/lib/convert.js b/lib/convert.js index 24f16fa..f867763 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -1613,16 +1613,25 @@ module.exports = function convert(config) { } + /** + * The JSX AST changed the node type for string literals + * inside a JSX Element from `Literal` to `JSXText`. We + * provide a flag to support both types until `Literal` + * node type is deprecated in ESLint v5. + */ case SyntaxKind.JsxText: { - Object.assign(result, { - type: AST_NODE_TYPES.Literal, - value: ast.text.slice(node.pos, node.end), - raw: ast.text.slice(node.pos, node.end) - }); - const start = node.getFullStart(); const end = node.getEnd(); + const type = (additionalOptions.useJSXTextNode) + ? AST_NODE_TYPES.JSXText : AST_NODE_TYPES.Literal; + + Object.assign(result, { + type, + value: ast.text.slice(start, end), + raw: ast.text.slice(start, end) + }); + result.loc = nodeUtils.getLocFor(start, end, ast); result.range = [start, end]; diff --git a/parser.js b/parser.js index 455333f..0c38df5 100644 --- a/parser.js +++ b/parser.js @@ -48,7 +48,8 @@ function resetExtra() { tolerant: false, errors: [], strict: false, - ecmaFeatures: {} + ecmaFeatures: {}, + useJSXTextNode: false }; } @@ -104,6 +105,10 @@ function parse(code, options) { extra.errorOnUnknownASTType = true; } + if (typeof options.useJSXTextNode === "boolean" && options.useJSXTextNode) { + extra.useJSXTextNode = true; + } + } // Even if jsx option is set in typescript compiler, filename still has to diff --git a/tests/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.result.js b/tests/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.result.js new file mode 100644 index 0000000..50f3a52 --- /dev/null +++ b/tests/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.result.js @@ -0,0 +1,458 @@ +module.exports = { + "type": "Program", + "range": [ + 0, + 24 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "range": [ + 0, + 24 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "expression": { + "type": "JSXElement", + "range": [ + 0, + 24 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "range": [ + 0, + 5 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "selfClosing": false, + "name": { + "type": "JSXIdentifier", + "range": [ + 1, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "div" + }, + "attributes": [] + }, + "closingElement": { + "type": "JSXClosingElement", + "range": [ + 18, + 24 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "name": { + "type": "JSXIdentifier", + "range": [ + 20, + 23 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "range": [ + 5, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "value": "\n ", + "raw": "\n " + }, + { + "type": "JSXElement", + "range": [ + 10, + 17 + ], + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "range": [ + 10, + 17 + ], + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "selfClosing": true, + "name": { + "type": "JSXIdentifier", + "range": [ + 11, + 14 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "name": "foo" + }, + "attributes": [] + }, + "closingElement": null, + "children": [] + }, + { + "type": "JSXText", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 3, + "column": 0 + } + }, + "value": "\n", + "raw": "\n" + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "range": [ + 0, + 1 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "JSXIdentifier", + "value": "div", + "range": [ + 1, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 4, + 5 + ], + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + } + }, + { + "type": "JSXText", + "value": "\n ", + "range": [ + 5, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 2, + "column": 4 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 10, + 11 + ], + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + } + }, + { + "type": "JSXIdentifier", + "value": "foo", + "range": [ + 11, + 14 + ], + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 8 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 15, + 16 + ], + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 16, + 17 + ], + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + { + "type": "JSXText", + "value": "\n", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 3, + "column": 0 + } + } + }, + { + "type": "Punctuator", + "value": "<", + "range": [ + 18, + 19 + ], + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + } + }, + { + "type": "Punctuator", + "value": "/", + "range": [ + 19, + 20 + ], + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + } + }, + { + "type": "JSXIdentifier", + "value": "div", + "range": [ + 20, + 23 + ], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + } + }, + { + "type": "Punctuator", + "value": ">", + "range": [ + 23, + 24 + ], + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 6 + } + } + } + ] +}; diff --git a/tests/fixtures/ecma-features/jsx/self-closing-tag-inside-tag.src.js b/tests/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/self-closing-tag-inside-tag.src.js rename to tests/fixtures/jsx-useJSXTextNode/self-closing-tag-inside-tag.src.js diff --git a/tests/fixtures/jsx-useJSXTextNode/test-content.result.js b/tests/fixtures/jsx-useJSXTextNode/test-content.result.js new file mode 100644 index 0000000..d3dc1df --- /dev/null +++ b/tests/fixtures/jsx-useJSXTextNode/test-content.result.js @@ -0,0 +1,311 @@ +module.exports = { + "type": "Program", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 0, + 25 + ], + "expression": { + "type": "JSXElement", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 0, + 24 + ], + "openingElement": { + "type": "JSXOpeningElement", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ], + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 18, + 24 + ], + "name": { + "type": "JSXIdentifier", + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 20, + 23 + ], + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 5, + 18 + ], + "value": "@test content", + "raw": "@test content" + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Punctuator", + "value": "<", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ] + }, + { + "type": "JSXIdentifier", + "value": "div", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "range": [ + 1, + 4 + ] + }, + { + "type": "Punctuator", + "value": ">", + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 4, + 5 + ] + }, + { + "type": "JSXText", + "value": "@test content", + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "range": [ + 5, + 18 + ] + }, + { + "type": "Punctuator", + "value": "<", + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 18, + 19 + ] + }, + { + "type": "Punctuator", + "value": "/", + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ] + }, + { + "type": "JSXIdentifier", + "value": "div", + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 20, + 23 + ] + }, + { + "type": "Punctuator", + "value": ">", + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "range": [ + 23, + 24 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "range": [ + 24, + 25 + ] + } + ] +}; diff --git a/tests/fixtures/ecma-features/jsx/test-content.src.js b/tests/fixtures/jsx-useJSXTextNode/test-content.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/test-content.src.js rename to tests/fixtures/jsx-useJSXTextNode/test-content.src.js diff --git a/tests/fixtures/ecma-features/jsx/attributes.result.js b/tests/fixtures/jsx/attributes.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/attributes.result.js rename to tests/fixtures/jsx/attributes.result.js diff --git a/tests/fixtures/ecma-features/jsx/attributes.src.js b/tests/fixtures/jsx/attributes.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/attributes.src.js rename to tests/fixtures/jsx/attributes.src.js diff --git a/tests/fixtures/ecma-features/jsx/embedded-comment.result.js b/tests/fixtures/jsx/embedded-comment.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/embedded-comment.result.js rename to tests/fixtures/jsx/embedded-comment.result.js diff --git a/tests/fixtures/ecma-features/jsx/embedded-comment.src.js b/tests/fixtures/jsx/embedded-comment.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/embedded-comment.src.js rename to tests/fixtures/jsx/embedded-comment.src.js diff --git a/tests/fixtures/ecma-features/jsx/embedded-conditional.result.js b/tests/fixtures/jsx/embedded-conditional.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/embedded-conditional.result.js rename to tests/fixtures/jsx/embedded-conditional.result.js diff --git a/tests/fixtures/ecma-features/jsx/embedded-conditional.src.js b/tests/fixtures/jsx/embedded-conditional.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/embedded-conditional.src.js rename to tests/fixtures/jsx/embedded-conditional.src.js diff --git a/tests/fixtures/ecma-features/jsx/embedded-invalid-js-identifier.result.js b/tests/fixtures/jsx/embedded-invalid-js-identifier.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/embedded-invalid-js-identifier.result.js rename to tests/fixtures/jsx/embedded-invalid-js-identifier.result.js diff --git a/tests/fixtures/ecma-features/jsx/embedded-invalid-js-identifier.src.js b/tests/fixtures/jsx/embedded-invalid-js-identifier.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/embedded-invalid-js-identifier.src.js rename to tests/fixtures/jsx/embedded-invalid-js-identifier.src.js diff --git a/tests/fixtures/ecma-features/jsx/embedded-tags.result.js b/tests/fixtures/jsx/embedded-tags.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/embedded-tags.result.js rename to tests/fixtures/jsx/embedded-tags.result.js diff --git a/tests/fixtures/ecma-features/jsx/embedded-tags.src.js b/tests/fixtures/jsx/embedded-tags.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/embedded-tags.src.js rename to tests/fixtures/jsx/embedded-tags.src.js diff --git a/tests/fixtures/ecma-features/jsx/empty-placeholder.result.js b/tests/fixtures/jsx/empty-placeholder.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/empty-placeholder.result.js rename to tests/fixtures/jsx/empty-placeholder.result.js diff --git a/tests/fixtures/ecma-features/jsx/empty-placeholder.src.js b/tests/fixtures/jsx/empty-placeholder.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/empty-placeholder.src.js rename to tests/fixtures/jsx/empty-placeholder.src.js diff --git a/tests/fixtures/ecma-features/jsx/escape-patterns.result.js b/tests/fixtures/jsx/escape-patterns.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/escape-patterns.result.js rename to tests/fixtures/jsx/escape-patterns.result.js diff --git a/tests/fixtures/ecma-features/jsx/escape-patterns.src.js b/tests/fixtures/jsx/escape-patterns.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/escape-patterns.src.js rename to tests/fixtures/jsx/escape-patterns.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-attribute-missing-equals.result.js b/tests/fixtures/jsx/invalid-attribute-missing-equals.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-attribute-missing-equals.result.js rename to tests/fixtures/jsx/invalid-attribute-missing-equals.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-attribute-missing-equals.src.js b/tests/fixtures/jsx/invalid-attribute-missing-equals.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-attribute-missing-equals.src.js rename to tests/fixtures/jsx/invalid-attribute-missing-equals.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-attribute.result.js b/tests/fixtures/jsx/invalid-attribute.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-attribute.result.js rename to tests/fixtures/jsx/invalid-attribute.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-attribute.src.js b/tests/fixtures/jsx/invalid-attribute.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-attribute.src.js rename to tests/fixtures/jsx/invalid-attribute.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-broken-tag.result.js b/tests/fixtures/jsx/invalid-broken-tag.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-broken-tag.result.js rename to tests/fixtures/jsx/invalid-broken-tag.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-broken-tag.src.js b/tests/fixtures/jsx/invalid-broken-tag.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-broken-tag.src.js rename to tests/fixtures/jsx/invalid-broken-tag.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-computed-end-tag-name.result.js b/tests/fixtures/jsx/invalid-computed-end-tag-name.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-computed-end-tag-name.result.js rename to tests/fixtures/jsx/invalid-computed-end-tag-name.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-computed-end-tag-name.src.js b/tests/fixtures/jsx/invalid-computed-end-tag-name.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-computed-end-tag-name.src.js rename to tests/fixtures/jsx/invalid-computed-end-tag-name.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-computed-string-end-tag-name.result.js b/tests/fixtures/jsx/invalid-computed-string-end-tag-name.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-computed-string-end-tag-name.result.js rename to tests/fixtures/jsx/invalid-computed-string-end-tag-name.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-computed-string-end-tag-name.src.js b/tests/fixtures/jsx/invalid-computed-string-end-tag-name.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-computed-string-end-tag-name.src.js rename to tests/fixtures/jsx/invalid-computed-string-end-tag-name.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-embedded-expression.result.js b/tests/fixtures/jsx/invalid-embedded-expression.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-embedded-expression.result.js rename to tests/fixtures/jsx/invalid-embedded-expression.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-embedded-expression.src.js b/tests/fixtures/jsx/invalid-embedded-expression.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-embedded-expression.src.js rename to tests/fixtures/jsx/invalid-embedded-expression.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-leading-dot-tag-name.result.js b/tests/fixtures/jsx/invalid-leading-dot-tag-name.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-leading-dot-tag-name.result.js rename to tests/fixtures/jsx/invalid-leading-dot-tag-name.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-leading-dot-tag-name.src.js b/tests/fixtures/jsx/invalid-leading-dot-tag-name.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-leading-dot-tag-name.src.js rename to tests/fixtures/jsx/invalid-leading-dot-tag-name.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-matching-placeholder-in-closing-tag.result.js b/tests/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-matching-placeholder-in-closing-tag.result.js rename to tests/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-matching-placeholder-in-closing-tag.src.js b/tests/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-matching-placeholder-in-closing-tag.src.js rename to tests/fixtures/jsx/invalid-matching-placeholder-in-closing-tag.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-mismatched-closing-tag.result.js b/tests/fixtures/jsx/invalid-mismatched-closing-tag.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-mismatched-closing-tag.result.js rename to tests/fixtures/jsx/invalid-mismatched-closing-tag.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-mismatched-closing-tag.src.js b/tests/fixtures/jsx/invalid-mismatched-closing-tag.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-mismatched-closing-tag.src.js rename to tests/fixtures/jsx/invalid-mismatched-closing-tag.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-mismatched-closing-tags.result.js b/tests/fixtures/jsx/invalid-mismatched-closing-tags.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-mismatched-closing-tags.result.js rename to tests/fixtures/jsx/invalid-mismatched-closing-tags.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-mismatched-closing-tags.src.js b/tests/fixtures/jsx/invalid-mismatched-closing-tags.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-mismatched-closing-tags.src.js rename to tests/fixtures/jsx/invalid-mismatched-closing-tags.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-mismatched-dot-tag-name.result.js b/tests/fixtures/jsx/invalid-mismatched-dot-tag-name.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-mismatched-dot-tag-name.result.js rename to tests/fixtures/jsx/invalid-mismatched-dot-tag-name.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-mismatched-dot-tag-name.src.js b/tests/fixtures/jsx/invalid-mismatched-dot-tag-name.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-mismatched-dot-tag-name.src.js rename to tests/fixtures/jsx/invalid-mismatched-dot-tag-name.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-mismatched-namespace-tag.result.js b/tests/fixtures/jsx/invalid-mismatched-namespace-tag.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-mismatched-namespace-tag.result.js rename to tests/fixtures/jsx/invalid-mismatched-namespace-tag.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-mismatched-namespace-tag.src.js b/tests/fixtures/jsx/invalid-mismatched-namespace-tag.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-mismatched-namespace-tag.src.js rename to tests/fixtures/jsx/invalid-mismatched-namespace-tag.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-missing-closing-tag-attribute-placeholder.result.js b/tests/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-missing-closing-tag-attribute-placeholder.result.js rename to tests/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js b/tests/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js rename to tests/fixtures/jsx/invalid-missing-closing-tag-attribute-placeholder.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-missing-closing-tag.result.js b/tests/fixtures/jsx/invalid-missing-closing-tag.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-missing-closing-tag.result.js rename to tests/fixtures/jsx/invalid-missing-closing-tag.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-missing-closing-tag.src.js b/tests/fixtures/jsx/invalid-missing-closing-tag.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-missing-closing-tag.src.js rename to tests/fixtures/jsx/invalid-missing-closing-tag.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-missing-namespace-name.result.js b/tests/fixtures/jsx/invalid-missing-namespace-name.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-missing-namespace-name.result.js rename to tests/fixtures/jsx/invalid-missing-namespace-name.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-missing-namespace-name.src.js b/tests/fixtures/jsx/invalid-missing-namespace-name.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-missing-namespace-name.src.js rename to tests/fixtures/jsx/invalid-missing-namespace-name.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-missing-namespace-value.result.js b/tests/fixtures/jsx/invalid-missing-namespace-value.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-missing-namespace-value.result.js rename to tests/fixtures/jsx/invalid-missing-namespace-value.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-missing-namespace-value.src.js b/tests/fixtures/jsx/invalid-missing-namespace-value.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-missing-namespace-value.src.js rename to tests/fixtures/jsx/invalid-missing-namespace-value.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-missing-spread-operator.result.js b/tests/fixtures/jsx/invalid-missing-spread-operator.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-missing-spread-operator.result.js rename to tests/fixtures/jsx/invalid-missing-spread-operator.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-missing-spread-operator.src.js b/tests/fixtures/jsx/invalid-missing-spread-operator.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-missing-spread-operator.src.js rename to tests/fixtures/jsx/invalid-missing-spread-operator.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-namespace-name-with-docts.result.js b/tests/fixtures/jsx/invalid-namespace-name-with-docts.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-namespace-name-with-docts.result.js rename to tests/fixtures/jsx/invalid-namespace-name-with-docts.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-namespace-name-with-docts.src.js b/tests/fixtures/jsx/invalid-namespace-name-with-docts.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-namespace-name-with-docts.src.js rename to tests/fixtures/jsx/invalid-namespace-name-with-docts.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-namespace-value-with-dots.result.js b/tests/fixtures/jsx/invalid-namespace-value-with-dots.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-namespace-value-with-dots.result.js rename to tests/fixtures/jsx/invalid-namespace-value-with-dots.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-namespace-value-with-dots.src.js b/tests/fixtures/jsx/invalid-namespace-value-with-dots.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-namespace-value-with-dots.src.js rename to tests/fixtures/jsx/invalid-namespace-value-with-dots.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-no-common-parent-with-comment.result.js b/tests/fixtures/jsx/invalid-no-common-parent-with-comment.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-no-common-parent-with-comment.result.js rename to tests/fixtures/jsx/invalid-no-common-parent-with-comment.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-no-common-parent-with-comment.src.js b/tests/fixtures/jsx/invalid-no-common-parent-with-comment.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-no-common-parent-with-comment.src.js rename to tests/fixtures/jsx/invalid-no-common-parent-with-comment.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-no-common-parent.result.js b/tests/fixtures/jsx/invalid-no-common-parent.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-no-common-parent.result.js rename to tests/fixtures/jsx/invalid-no-common-parent.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-no-common-parent.src.js b/tests/fixtures/jsx/invalid-no-common-parent.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-no-common-parent.src.js rename to tests/fixtures/jsx/invalid-no-common-parent.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-no-tag-name.result.js b/tests/fixtures/jsx/invalid-no-tag-name.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-no-tag-name.result.js rename to tests/fixtures/jsx/invalid-no-tag-name.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-no-tag-name.src.js b/tests/fixtures/jsx/invalid-no-tag-name.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-no-tag-name.src.js rename to tests/fixtures/jsx/invalid-no-tag-name.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-placeholder-in-closing-tag.result.js b/tests/fixtures/jsx/invalid-placeholder-in-closing-tag.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-placeholder-in-closing-tag.result.js rename to tests/fixtures/jsx/invalid-placeholder-in-closing-tag.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-placeholder-in-closing-tag.src.js b/tests/fixtures/jsx/invalid-placeholder-in-closing-tag.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-placeholder-in-closing-tag.src.js rename to tests/fixtures/jsx/invalid-placeholder-in-closing-tag.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-trailing-dot-tag-name.result.js b/tests/fixtures/jsx/invalid-trailing-dot-tag-name.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-trailing-dot-tag-name.result.js rename to tests/fixtures/jsx/invalid-trailing-dot-tag-name.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-trailing-dot-tag-name.src.js b/tests/fixtures/jsx/invalid-trailing-dot-tag-name.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-trailing-dot-tag-name.src.js rename to tests/fixtures/jsx/invalid-trailing-dot-tag-name.src.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-unexpected-comma.result.js b/tests/fixtures/jsx/invalid-unexpected-comma.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-unexpected-comma.result.js rename to tests/fixtures/jsx/invalid-unexpected-comma.result.js diff --git a/tests/fixtures/ecma-features/jsx/invalid-unexpected-comma.src.js b/tests/fixtures/jsx/invalid-unexpected-comma.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/invalid-unexpected-comma.src.js rename to tests/fixtures/jsx/invalid-unexpected-comma.src.js diff --git a/tests/fixtures/ecma-features/jsx/japanese-characters.result.js b/tests/fixtures/jsx/japanese-characters.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/japanese-characters.result.js rename to tests/fixtures/jsx/japanese-characters.result.js diff --git a/tests/fixtures/ecma-features/jsx/japanese-characters.src.js b/tests/fixtures/jsx/japanese-characters.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/japanese-characters.src.js rename to tests/fixtures/jsx/japanese-characters.src.js diff --git a/tests/fixtures/ecma-features/jsx/less-than-operator.result.js b/tests/fixtures/jsx/less-than-operator.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/less-than-operator.result.js rename to tests/fixtures/jsx/less-than-operator.result.js diff --git a/tests/fixtures/ecma-features/jsx/less-than-operator.src.js b/tests/fixtures/jsx/less-than-operator.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/less-than-operator.src.js rename to tests/fixtures/jsx/less-than-operator.src.js diff --git a/tests/fixtures/ecma-features/jsx/multiple-blank-spaces.result.js b/tests/fixtures/jsx/multiple-blank-spaces.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/multiple-blank-spaces.result.js rename to tests/fixtures/jsx/multiple-blank-spaces.result.js diff --git a/tests/fixtures/ecma-features/jsx/multiple-blank-spaces.src.js b/tests/fixtures/jsx/multiple-blank-spaces.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/multiple-blank-spaces.src.js rename to tests/fixtures/jsx/multiple-blank-spaces.src.js diff --git a/tests/fixtures/ecma-features/jsx/namespaced-attribute-and-value-inserted.result.js b/tests/fixtures/jsx/namespaced-attribute-and-value-inserted.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/namespaced-attribute-and-value-inserted.result.js rename to tests/fixtures/jsx/namespaced-attribute-and-value-inserted.result.js diff --git a/tests/fixtures/ecma-features/jsx/namespaced-attribute-and-value-inserted.src.js b/tests/fixtures/jsx/namespaced-attribute-and-value-inserted.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/namespaced-attribute-and-value-inserted.src.js rename to tests/fixtures/jsx/namespaced-attribute-and-value-inserted.src.js diff --git a/tests/fixtures/ecma-features/jsx/namespaced-name-and-attribute.result.js b/tests/fixtures/jsx/namespaced-name-and-attribute.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/namespaced-name-and-attribute.result.js rename to tests/fixtures/jsx/namespaced-name-and-attribute.result.js diff --git a/tests/fixtures/ecma-features/jsx/namespaced-name-and-attribute.src.js b/tests/fixtures/jsx/namespaced-name-and-attribute.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/namespaced-name-and-attribute.src.js rename to tests/fixtures/jsx/namespaced-name-and-attribute.src.js diff --git a/tests/fixtures/ecma-features/jsx/newslines-and-entities.result.js b/tests/fixtures/jsx/newslines-and-entities.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/newslines-and-entities.result.js rename to tests/fixtures/jsx/newslines-and-entities.result.js diff --git a/tests/fixtures/ecma-features/jsx/newslines-and-entities.src.js b/tests/fixtures/jsx/newslines-and-entities.src.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/newslines-and-entities.src.js rename to tests/fixtures/jsx/newslines-and-entities.src.js diff --git a/tests/fixtures/ecma-features/jsx/self-closing-tag-inside-tag.result.js b/tests/fixtures/jsx/self-closing-tag-inside-tag.result.js similarity index 100% rename from tests/fixtures/ecma-features/jsx/self-closing-tag-inside-tag.result.js rename to tests/fixtures/jsx/self-closing-tag-inside-tag.result.js diff --git a/tests/fixtures/jsx/self-closing-tag-inside-tag.src.js b/tests/fixtures/jsx/self-closing-tag-inside-tag.src.js new file mode 100644 index 0000000..b1b2540 --- /dev/null +++ b/tests/fixtures/jsx/self-closing-tag-inside-tag.src.js @@ -0,0 +1,3 @@ +