-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow ellipses to occur in jsx elements
- Loading branch information
1 parent
dc31834
commit 9406cae
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
lang/semgrep-grammars/src/semgrep-typescript/tsx/corpus/semgrep-ext.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
================================== | ||
JSX with ellipsis | ||
================================== | ||
|
||
<Switch .../> | ||
|
||
--- | ||
|
||
(program | ||
(expression_statement | ||
(jsx_self_closing_element | ||
(identifier) | ||
(semgrep_ellipsis)))) | ||
|
||
================================== | ||
JSX with ellipsis and other props | ||
================================== | ||
|
||
<Switch a="b" ... foo={bar}/> | ||
|
||
--- | ||
|
||
(program | ||
(expression_statement | ||
(jsx_self_closing_element | ||
(identifier) | ||
(jsx_attribute | ||
(property_identifier) | ||
(string | ||
(string_fragment))) | ||
(semgrep_ellipsis) | ||
(jsx_attribute | ||
(property_identifier) | ||
(jsx_expression | ||
(identifier)))))) | ||
|
||
================================== | ||
JSX with metavariable ellipsis | ||
================================== | ||
|
||
<Switch $...PROPS/> | ||
|
||
--- | ||
|
||
(program | ||
(expression_statement | ||
(jsx_self_closing_element | ||
(identifier) | ||
(semgrep_metavar_ellipsis)))) |