jsx_tag_auto_close: Fix <Foo.Bar>
component auto-close (#27374)
- **support alternate tag name node names to fix autoclosing of `<Foo.Bar>` style tags in TSX** - **remove checks against close tag name while checking if tag is closed** - **move jsx tag auto close tests into jsx_tag_auto_close.rs** Closes #27335 Release Notes: - Fixed an issue with JSX tag auto-close where components containing a `.` access like `<Foo.Bar>` would be auto-closed as `</>` instead of `</Foo.Bar>`
This commit is contained in:
parent
43712285bf
commit
f2be201495
4 changed files with 271 additions and 257 deletions
|
@ -727,6 +727,11 @@ pub struct JsxTagAutoCloseConfig {
|
|||
/// The name of the node found within both opening and closing
|
||||
/// tags that describes the tag name
|
||||
pub tag_name_node_name: String,
|
||||
/// Alternate Node names for tag names.
|
||||
/// Specifically needed as TSX represents the name in `<Foo.Bar>`
|
||||
/// as `member_expression` rather than `identifier` as usual
|
||||
#[serde(default)]
|
||||
pub tag_name_node_name_alternates: Vec<String>,
|
||||
/// Some grammars are smart enough to detect a closing tag
|
||||
/// that is not valid i.e. doesn't match it's corresponding
|
||||
/// opening tag or does not have a corresponding opening tag
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue