Skip to content

Commit fb3f154

Browse files
chenxsanJounQin
andauthored
fix: incorrect jsx attribute name AST (#425)
Co-authored-by: JounQin <[email protected]>
1 parent c8d38ee commit fb3f154

File tree

3 files changed

+226
-236
lines changed

3 files changed

+226
-236
lines changed

.changeset/light-crabs-obey.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'eslint-mdx': patch
3+
---
4+
5+
fix: incorrect jsx attribute `name` AST

packages/eslint-mdx/src/worker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ runAsWorker(
443443

444444
if (attrValue == null) {
445445
return {
446-
...attrNamePos,
446+
...normalizeNode(attrStart, lastAttrOffset + 1),
447447
type: 'JSXAttribute',
448448
name: {
449449
...attrNamePos,
@@ -499,7 +499,7 @@ runAsWorker(
499499
...attrNamePos,
500500
type: 'JSXAttribute',
501501
name: {
502-
...normalizeNode(attrStart, lastAttrOffset + 1),
502+
...attrNamePos,
503503
type: 'JSXIdentifier',
504504
name: attrName,
505505
},

0 commit comments

Comments
 (0)