-
-
Notifications
You must be signed in to change notification settings - Fork 75
New: Create option to enable JSXText node type (fixes #266) #272
Conversation
LGTM |
tests/lib/jsx.js
Outdated
"jsx/namespaced-attribute-and-value-inserted", // https://github.com/Microsoft/TypeScript/issues/7411 | ||
"jsx/namespaced-name-and-attribute", // https://github.com/Microsoft/TypeScript/issues/7411 | ||
"jsx/invalid-namespace-value-with-dots", // https://github.com/Microsoft/TypeScript/issues/7411 | ||
"jsx/multiple-blank-spaces" // Fixed by #271 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was fixed, why has it been re-added as one to skip?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once I rebase this change I can remove it.
lib/convert.js
Outdated
@@ -1613,9 +1613,12 @@ module.exports = function convert(config) { | |||
|
|||
} | |||
|
|||
case SyntaxKind.JsxText: | |||
case SyntaxKind.JsxText: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please can you document inline why we are doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. It is only temporary until eslint v5, will make a note.
9be81da
to
852eafc
Compare
LGTM |
@JamesHenry Changes made. Thanks for the review |
Ah, I just merged the other JSXText PR, so this will need rebasing. Once that's done this is good to go, and I can see it has already been verified in prettier. |
852eafc
to
76bef55
Compare
LGTM |
@JamesHenry Rebased. Should be good to go in. |
…strings inside JSXElement eslint/typescript-eslint-parser#272 was merged, so this fixes prettier#1558 See here for more info about the new TSQualifiedName node type: eslint/typescript-eslint-parser@3491b4b
* Run `yarn` to update yarn.lock * Upgrade typescript-eslint-parser, use JSXText instead of Literal for strings inside JSXElement eslint/typescript-eslint-parser#272 was merged, so this fixes #1558 See here for more info about the new TSQualifiedName node type: eslint/typescript-eslint-parser@3491b4b * Run AST comparison tests on Travis
This commit creates a new parser config option
useJSXTextNode
that enablesJSXText
node type instead ofLiteral
for strings inside ofJSXElement
nodes. The default is false as currently many eslint rules depend on theLiteral
node type.I have moved the JSX tests into its own directory and created a new test runner that can run tests for JSX files with and without the
useJSXTextNode
flag enabled.