Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Fix no-unused-variable "react" option to support self-closing JSX elements #776

Merged
merged 1 commit into from
Nov 13, 2015

Conversation

adidahiya
Copy link
Contributor

Also reorder some methods in NoUnusedVariableWalker.

self-closing JSX elements. Also reorder some methods
in NoUnusedVariableWalker.
public visitJsxSelfClosingElement(node: ts.JsxSelfClosingElement) {
this.hasSeenJsxElement = true;
super.visitJsxSelfClosingElement(node);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method was added. the others were reordered to be alphabetized.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - this was indeed the bug. You beat me to a PR 👍

@@ -136,6 +136,10 @@ describe("<no-unused-variable>", () => {

describeSuite("react");
describeSuite("react/addons");

it("should not fail if JSX self-closing element is used", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this like the other tests for consistency?

jkillian added a commit that referenced this pull request Nov 13, 2015
Fix no-unused-variable "react" option to support self-closing JSX elements
@jkillian jkillian merged commit 8939bf0 into master Nov 13, 2015
@jkillian
Copy link
Contributor

[Changes can be made in a follow-up commit, want to merge this to prepare for a release]

@jkillian jkillian deleted the fix-no-unused-react branch November 13, 2015 03:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants