Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 8406209

Browse files
authored
Fix: Remove start and end values from JSX tokens (fixes #341) (#351)
1 parent 046727a commit 8406209

File tree

6 files changed

+83
-153
lines changed

6 files changed

+83
-153
lines changed

lib/node-utils.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,6 @@ function convertToken(token, ast) {
627627
newToken = {
628628
type: getTokenType(token),
629629
value,
630-
start,
631-
end,
632630
range: [start, end],
633631
loc: getLocFor(start, end, ast)
634632
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"license": "BSD-2-Clause",
2020
"devDependencies": {
2121
"babel-code-frame": "^6.22.0",
22-
"babylon": "^7.0.0-beta.16",
22+
"babylon": "^7.0.0-beta.19",
2323
"eslint": "3.19.0",
2424
"eslint-config-eslint": "4.0.0",
2525
"eslint-plugin-node": "4.2.2",

tests/ast-alignment/parse.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ function parseWithTypeScriptESLintParser(text) { // eslint-disable-line
4646
range: true,
4747
tokens: false,
4848
comment: false,
49+
useJSXTextNode: true,
50+
errorOnUnknownASTType: true,
4951
ecmaFeatures: {
5052
jsx: true
5153
}

tests/ast-alignment/spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ const fixturePatternsToTest = [
1111
"basics/instanceof.src.js",
1212
"basics/update-expression.src.js",
1313
"basics/new-without-parens.src.js",
14-
"ecma-features/arrowFunctions/**/as*.src.js"
14+
"ecma-features/arrowFunctions/**/as*.src.js",
15+
"jsx/attributes.src.js"
1516
];
1617

1718
const fixturesToTest = [];

tests/fixtures/jsx/attributes.src.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<foo bar="baz" qux={quz} spread={...rest}>test</foo>
1+
<foo bar="baz" qux={quz} {...rest}>test</foo>

0 commit comments

Comments
 (0)