diff --git a/.prettierignore b/.prettierignore
index 548792bb901b..e75691bd4a2c 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -17,6 +17,10 @@ packages/ast-spec/src/element/AccessorProperty/fixtures
# prettier doesn't yet support `const` modifiers for type parameters
packages/ast-spec/src/special/TSTypeParameter/fixtures
+# prettier doesn't yet support JSX namespaced attributes
+packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx
+packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx
+
# Ignore CHANGELOG.md files to avoid issues with automated release job
CHANGELOG.md
diff --git a/docs/maintenance/Versioning.mdx b/docs/maintenance/Versioning.mdx
index 4cd92c6c8577..092606111f1b 100644
--- a/docs/maintenance/Versioning.mdx
+++ b/docs/maintenance/Versioning.mdx
@@ -52,7 +52,7 @@ Support for specific Current status releases are considered periodically.
### TypeScript
-> The version range of TypeScript currently supported is `>=3.3.1 <5.1.0`.
+> The version range of TypeScript currently supported is `>=3.3.1 <5.2.0`.
These versions are what we test against.
diff --git a/package.json b/package.json
index 3f881e0dc75c..224349ccb506 100644
--- a/package.json
+++ b/package.json
@@ -68,7 +68,6 @@
"@types/is-glob": "^4.0.2",
"@types/jest": "29.4.4",
"@types/jest-specific-snapshot": "^0.5.5",
- "@types/lodash": "^4.14.182",
"@types/marked": "^4.0.3",
"@types/ncp": "^2.0.5",
"@types/node": "^18.11.9",
@@ -112,10 +111,10 @@
"ts-node": "10.7.0",
"tslint": "^6.1.3",
"tsx": "^3.12.1",
- "typescript": ">=3.3.1 <5.1.0"
+ "typescript": ">=3.3.1 <5.2.0"
},
"resolutions": {
- "typescript": "~5.0.2",
+ "typescript": "~5.1.3",
"@types/node": "^18.11.9",
"@jest/create-cache-key-function": "^29",
"@jest/reporters": "^29",
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx
new file mode 100644
index 000000000000..04117403f023
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx
@@ -0,0 +1,10 @@
+const x = ;
+const y = ;
+
+interface NamespacePropComponentProps {
+ "a:b": string;
+}
+
+function NamespacePropComponent(props: NamespacePropComponentProps) {
+ return
{props["a:b"]}
;
+}
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..592cbb5dc1af
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,485 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - AST 1`] = `
+Program {
+ type: "Program",
+ body: [
+ VariableDeclaration {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ id: Identifier {
+ type: "Identifier",
+ name: "x",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [
+ JSXAttribute {
+ type: "JSXAttribute",
+ name: JSXNamespacedName {
+ type: "JSXNamespacedName",
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "b",
+
+ range: [36, 37],
+ loc: {
+ start: { column: 36, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ namespace: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "a",
+
+ range: [34, 35],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 35, line: 1 },
+ },
+ },
+
+ range: [34, 37],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ value: Literal {
+ type: "Literal",
+ raw: ""tight spacing"",
+ value: "tight spacing",
+
+ range: [38, 53],
+ loc: {
+ start: { column: 38, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+
+ range: [34, 53],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+ ],
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "NamespacePropComponent",
+
+ range: [11, 33],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 33, line: 1 },
+ },
+ },
+ selfClosing: true,
+
+ range: [10, 56],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+
+ range: [10, 56],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+
+ range: [6, 56],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+ ],
+ kind: "const",
+
+ range: [0, 57],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 57, line: 1 },
+ },
+ },
+ VariableDeclaration {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ id: Identifier {
+ type: "Identifier",
+ name: "y",
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [
+ JSXAttribute {
+ type: "JSXAttribute",
+ name: JSXNamespacedName {
+ type: "JSXNamespacedName",
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "b",
+
+ range: [96, 97],
+ loc: {
+ start: { column: 38, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ namespace: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "a",
+
+ range: [92, 93],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
+ },
+ },
+
+ range: [92, 97],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ value: Literal {
+ type: "Literal",
+ raw: ""loose spacing"",
+ value: "loose spacing",
+
+ range: [98, 113],
+ loc: {
+ start: { column: 40, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+
+ range: [92, 113],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+ ],
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "NamespacePropComponent",
+
+ range: [69, 91],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 33, line: 2 },
+ },
+ },
+ selfClosing: true,
+
+ range: [68, 116],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+
+ range: [68, 116],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+
+ range: [64, 116],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+ ],
+ kind: "const",
+
+ range: [58, 117],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 59, line: 2 },
+ },
+ },
+ TSInterfaceDeclaration {
+ type: "TSInterfaceDeclaration",
+ body: TSInterfaceBody {
+ type: "TSInterfaceBody",
+ body: [
+ TSPropertySignature {
+ type: "TSPropertySignature",
+ computed: false,
+ key: Literal {
+ type: "Literal",
+ raw: ""a:b"",
+ value: "a:b",
+
+ range: [163, 168],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ typeAnnotation: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSStringKeyword {
+ type: "TSStringKeyword",
+
+ range: [170, 176],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [168, 176],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [163, 177],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ ],
+
+ range: [157, 179],
+ loc: {
+ start: { column: 38, line: 4 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "NamespacePropComponentProps",
+
+ range: [129, 156],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+
+ range: [119, 179],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ FunctionDeclaration {
+ type: "FunctionDeclaration",
+ async: false,
+ body: BlockStatement {
+ type: "BlockStatement",
+ body: [
+ ReturnStatement {
+ type: "ReturnStatement",
+ argument: JSXElement {
+ type: "JSXElement",
+ children: [
+ JSXExpressionContainer {
+ type: "JSXExpressionContainer",
+ expression: MemberExpression {
+ type: "MemberExpression",
+ computed: true,
+ object: Identifier {
+ type: "Identifier",
+ name: "props",
+
+ range: [268, 273],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: "Literal",
+ raw: ""a:b"",
+ value: "a:b",
+
+ range: [274, 279],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 28, line: 9 },
+ },
+ },
+
+ range: [268, 280],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+
+ range: [267, 281],
+ loc: {
+ start: { column: 16, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ ],
+ closingElement: JSXClosingElement {
+ type: "JSXClosingElement",
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "div",
+
+ range: [283, 286],
+ loc: {
+ start: { column: 32, line: 9 },
+ end: { column: 35, line: 9 },
+ },
+ },
+
+ range: [281, 287],
+ loc: {
+ start: { column: 30, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [],
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "div",
+
+ range: [263, 266],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 15, line: 9 },
+ },
+ },
+ selfClosing: false,
+
+ range: [262, 267],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 16, line: 9 },
+ },
+ },
+
+ range: [262, 287],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+
+ range: [255, 288],
+ loc: {
+ start: { column: 4, line: 9 },
+ end: { column: 37, line: 9 },
+ },
+ },
+ ],
+
+ range: [249, 290],
+ loc: {
+ start: { column: 68, line: 8 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: "Identifier",
+ name: "NamespacePropComponent",
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ params: [
+ Identifier {
+ type: "Identifier",
+ name: "props",
+ typeAnnotation: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSTypeReference {
+ type: "TSTypeReference",
+ typeName: Identifier {
+ type: "Identifier",
+ name: "NamespacePropComponentProps",
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+
+ range: [218, 247],
+ loc: {
+ start: { column: 37, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+
+ range: [213, 247],
+ loc: {
+ start: { column: 32, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+ ],
+
+ range: [181, 290],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 291],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 11 },
+ },
+}
+`;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..9352a620aac9
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,586 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = `
+[
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "x",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "NamespacePropComponent",
+
+ range: [11, 33],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 33, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "a",
+
+ range: [34, 35],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 35, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [35, 36],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 36, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "b",
+
+ range: [36, 37],
+ loc: {
+ start: { column: 36, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [37, 38],
+ loc: {
+ start: { column: 37, line: 1 },
+ end: { column: 38, line: 1 },
+ },
+ },
+ JSXText {
+ type: "JSXText",
+ value: ""tight spacing"",
+
+ range: [38, 53],
+ loc: {
+ start: { column: 38, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [54, 55],
+ loc: {
+ start: { column: 54, line: 1 },
+ end: { column: 55, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [55, 56],
+ loc: {
+ start: { column: 55, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [56, 57],
+ loc: {
+ start: { column: 56, line: 1 },
+ end: { column: 57, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [58, 63],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "y",
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [66, 67],
+ loc: {
+ start: { column: 8, line: 2 },
+ end: { column: 9, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [68, 69],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 11, line: 2 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "NamespacePropComponent",
+
+ range: [69, 91],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 33, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "a",
+
+ range: [92, 93],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [94, 95],
+ loc: {
+ start: { column: 36, line: 2 },
+ end: { column: 37, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "b",
+
+ range: [96, 97],
+ loc: {
+ start: { column: 38, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [97, 98],
+ loc: {
+ start: { column: 39, line: 2 },
+ end: { column: 40, line: 2 },
+ },
+ },
+ JSXText {
+ type: "JSXText",
+ value: ""loose spacing"",
+
+ range: [98, 113],
+ loc: {
+ start: { column: 40, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [114, 115],
+ loc: {
+ start: { column: 56, line: 2 },
+ end: { column: 57, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [115, 116],
+ loc: {
+ start: { column: 57, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [116, 117],
+ loc: {
+ start: { column: 58, line: 2 },
+ end: { column: 59, line: 2 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "interface",
+
+ range: [119, 128],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponentProps",
+
+ range: [129, 156],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [157, 158],
+ loc: {
+ start: { column: 38, line: 4 },
+ end: { column: 39, line: 4 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""a:b"",
+
+ range: [163, 168],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [168, 169],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "string",
+
+ range: [170, 176],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [176, 177],
+ loc: {
+ start: { column: 17, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [178, 179],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "function",
+
+ range: [181, 189],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 8, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponent",
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [212, 213],
+ loc: {
+ start: { column: 31, line: 8 },
+ end: { column: 32, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "props",
+
+ range: [213, 218],
+ loc: {
+ start: { column: 32, line: 8 },
+ end: { column: 37, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [218, 219],
+ loc: {
+ start: { column: 37, line: 8 },
+ end: { column: 38, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponentProps",
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [247, 248],
+ loc: {
+ start: { column: 66, line: 8 },
+ end: { column: 67, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [249, 250],
+ loc: {
+ start: { column: 68, line: 8 },
+ end: { column: 69, line: 8 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "return",
+
+ range: [255, 261],
+ loc: {
+ start: { column: 4, line: 9 },
+ end: { column: 10, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [262, 263],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 12, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "div",
+
+ range: [263, 266],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 15, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [266, 267],
+ loc: {
+ start: { column: 15, line: 9 },
+ end: { column: 16, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [267, 268],
+ loc: {
+ start: { column: 16, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "props",
+
+ range: [268, 273],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [273, 274],
+ loc: {
+ start: { column: 22, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""a:b"",
+
+ range: [274, 279],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 28, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [279, 280],
+ loc: {
+ start: { column: 28, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [280, 281],
+ loc: {
+ start: { column: 29, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [281, 282],
+ loc: {
+ start: { column: 30, line: 9 },
+ end: { column: 31, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [282, 283],
+ loc: {
+ start: { column: 31, line: 9 },
+ end: { column: 32, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "div",
+
+ range: [283, 286],
+ loc: {
+ start: { column: 32, line: 9 },
+ end: { column: 35, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [286, 287],
+ loc: {
+ start: { column: 35, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [287, 288],
+ loc: {
+ start: { column: 36, line: 9 },
+ end: { column: 37, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [289, 290],
+ loc: {
+ start: { column: 0, line: 10 },
+ end: { column: 1, line: 10 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..7582f7301e58
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/3-Babel-AST.shot
@@ -0,0 +1,485 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: [
+ VariableDeclaration {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ id: Identifier {
+ type: "Identifier",
+ name: "x",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [
+ JSXAttribute {
+ type: "JSXAttribute",
+ name: JSXNamespacedName {
+ type: "JSXNamespacedName",
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "b",
+
+ range: [36, 37],
+ loc: {
+ start: { column: 36, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ namespace: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "a",
+
+ range: [34, 35],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 35, line: 1 },
+ },
+ },
+
+ range: [34, 37],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ value: Literal {
+ type: "Literal",
+ raw: ""tight spacing"",
+ value: "tight spacing",
+
+ range: [38, 53],
+ loc: {
+ start: { column: 38, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+
+ range: [34, 53],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+ ],
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "NamespacePropComponent",
+
+ range: [11, 33],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 33, line: 1 },
+ },
+ },
+ selfClosing: true,
+
+ range: [10, 56],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+
+ range: [10, 56],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+
+ range: [6, 56],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+ ],
+ kind: "const",
+
+ range: [0, 57],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 57, line: 1 },
+ },
+ },
+ VariableDeclaration {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ id: Identifier {
+ type: "Identifier",
+ name: "y",
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [
+ JSXAttribute {
+ type: "JSXAttribute",
+ name: JSXNamespacedName {
+ type: "JSXNamespacedName",
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "b",
+
+ range: [96, 97],
+ loc: {
+ start: { column: 38, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ namespace: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "a",
+
+ range: [92, 93],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
+ },
+ },
+
+ range: [92, 97],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ value: Literal {
+ type: "Literal",
+ raw: ""loose spacing"",
+ value: "loose spacing",
+
+ range: [98, 113],
+ loc: {
+ start: { column: 40, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+
+ range: [92, 113],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+ ],
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "NamespacePropComponent",
+
+ range: [69, 91],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 33, line: 2 },
+ },
+ },
+ selfClosing: true,
+
+ range: [68, 116],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+
+ range: [68, 116],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+
+ range: [64, 116],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+ ],
+ kind: "const",
+
+ range: [58, 117],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 59, line: 2 },
+ },
+ },
+ TSInterfaceDeclaration {
+ type: "TSInterfaceDeclaration",
+ body: TSInterfaceBody {
+ type: "TSInterfaceBody",
+ body: [
+ TSPropertySignature {
+ type: "TSPropertySignature",
+ computed: false,
+ key: Literal {
+ type: "Literal",
+ raw: ""a:b"",
+ value: "a:b",
+
+ range: [163, 168],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ typeAnnotation: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSStringKeyword {
+ type: "TSStringKeyword",
+
+ range: [170, 176],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [168, 176],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [163, 177],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ ],
+
+ range: [157, 179],
+ loc: {
+ start: { column: 38, line: 4 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "NamespacePropComponentProps",
+
+ range: [129, 156],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+
+ range: [119, 179],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ FunctionDeclaration {
+ type: "FunctionDeclaration",
+ async: false,
+ body: BlockStatement {
+ type: "BlockStatement",
+ body: [
+ ReturnStatement {
+ type: "ReturnStatement",
+ argument: JSXElement {
+ type: "JSXElement",
+ children: [
+ JSXExpressionContainer {
+ type: "JSXExpressionContainer",
+ expression: MemberExpression {
+ type: "MemberExpression",
+ computed: true,
+ object: Identifier {
+ type: "Identifier",
+ name: "props",
+
+ range: [268, 273],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: "Literal",
+ raw: ""a:b"",
+ value: "a:b",
+
+ range: [274, 279],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 28, line: 9 },
+ },
+ },
+
+ range: [268, 280],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+
+ range: [267, 281],
+ loc: {
+ start: { column: 16, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ ],
+ closingElement: JSXClosingElement {
+ type: "JSXClosingElement",
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "div",
+
+ range: [283, 286],
+ loc: {
+ start: { column: 32, line: 9 },
+ end: { column: 35, line: 9 },
+ },
+ },
+
+ range: [281, 287],
+ loc: {
+ start: { column: 30, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [],
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "div",
+
+ range: [263, 266],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 15, line: 9 },
+ },
+ },
+ selfClosing: false,
+
+ range: [262, 267],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 16, line: 9 },
+ },
+ },
+
+ range: [262, 287],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+
+ range: [255, 288],
+ loc: {
+ start: { column: 4, line: 9 },
+ end: { column: 37, line: 9 },
+ },
+ },
+ ],
+
+ range: [249, 290],
+ loc: {
+ start: { column: 68, line: 8 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: "Identifier",
+ name: "NamespacePropComponent",
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ params: [
+ Identifier {
+ type: "Identifier",
+ name: "props",
+ typeAnnotation: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSTypeReference {
+ type: "TSTypeReference",
+ typeName: Identifier {
+ type: "Identifier",
+ name: "NamespacePropComponentProps",
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+
+ range: [218, 247],
+ loc: {
+ start: { column: 37, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+
+ range: [213, 247],
+ loc: {
+ start: { column: 32, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+ ],
+
+ range: [181, 290],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 291],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 11 },
+ },
+}
+`;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..afdd8792c205
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,586 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = `
+[
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "x",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "NamespacePropComponent",
+
+ range: [11, 33],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 33, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "a",
+
+ range: [34, 35],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 35, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [35, 36],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 36, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "b",
+
+ range: [36, 37],
+ loc: {
+ start: { column: 36, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [37, 38],
+ loc: {
+ start: { column: 37, line: 1 },
+ end: { column: 38, line: 1 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""tight spacing"",
+
+ range: [38, 53],
+ loc: {
+ start: { column: 38, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [54, 55],
+ loc: {
+ start: { column: 54, line: 1 },
+ end: { column: 55, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [55, 56],
+ loc: {
+ start: { column: 55, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [56, 57],
+ loc: {
+ start: { column: 56, line: 1 },
+ end: { column: 57, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [58, 63],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "y",
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [66, 67],
+ loc: {
+ start: { column: 8, line: 2 },
+ end: { column: 9, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [68, 69],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 11, line: 2 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "NamespacePropComponent",
+
+ range: [69, 91],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 33, line: 2 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "a",
+
+ range: [92, 93],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [94, 95],
+ loc: {
+ start: { column: 36, line: 2 },
+ end: { column: 37, line: 2 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "b",
+
+ range: [96, 97],
+ loc: {
+ start: { column: 38, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [97, 98],
+ loc: {
+ start: { column: 39, line: 2 },
+ end: { column: 40, line: 2 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""loose spacing"",
+
+ range: [98, 113],
+ loc: {
+ start: { column: 40, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [114, 115],
+ loc: {
+ start: { column: 56, line: 2 },
+ end: { column: 57, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [115, 116],
+ loc: {
+ start: { column: 57, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [116, 117],
+ loc: {
+ start: { column: 58, line: 2 },
+ end: { column: 59, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "interface",
+
+ range: [119, 128],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponentProps",
+
+ range: [129, 156],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [157, 158],
+ loc: {
+ start: { column: 38, line: 4 },
+ end: { column: 39, line: 4 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""a:b"",
+
+ range: [163, 168],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [168, 169],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "string",
+
+ range: [170, 176],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [176, 177],
+ loc: {
+ start: { column: 17, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [178, 179],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "function",
+
+ range: [181, 189],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 8, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponent",
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [212, 213],
+ loc: {
+ start: { column: 31, line: 8 },
+ end: { column: 32, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "props",
+
+ range: [213, 218],
+ loc: {
+ start: { column: 32, line: 8 },
+ end: { column: 37, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [218, 219],
+ loc: {
+ start: { column: 37, line: 8 },
+ end: { column: 38, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponentProps",
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [247, 248],
+ loc: {
+ start: { column: 66, line: 8 },
+ end: { column: 67, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [249, 250],
+ loc: {
+ start: { column: 68, line: 8 },
+ end: { column: 69, line: 8 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "return",
+
+ range: [255, 261],
+ loc: {
+ start: { column: 4, line: 9 },
+ end: { column: 10, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [262, 263],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 12, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "div",
+
+ range: [263, 266],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 15, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [266, 267],
+ loc: {
+ start: { column: 15, line: 9 },
+ end: { column: 16, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [267, 268],
+ loc: {
+ start: { column: 16, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "props",
+
+ range: [268, 273],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [273, 274],
+ loc: {
+ start: { column: 22, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""a:b"",
+
+ range: [274, 279],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 28, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [279, 280],
+ loc: {
+ start: { column: 28, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [280, 281],
+ loc: {
+ start: { column: 29, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [281, 282],
+ loc: {
+ start: { column: 30, line: 9 },
+ end: { column: 31, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [282, 283],
+ loc: {
+ start: { column: 31, line: 9 },
+ end: { column: 32, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "div",
+
+ range: [283, 286],
+ loc: {
+ start: { column: 32, line: 9 },
+ end: { column: 35, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [286, 287],
+ loc: {
+ start: { column: 35, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [287, 288],
+ loc: {
+ start: { column: 36, line: 9 },
+ end: { column: 37, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [289, 290],
+ loc: {
+ start: { column: 0, line: 10 },
+ end: { column: 1, line: 10 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot
new file mode 100644
index 000000000000..805eaa54c240
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot
@@ -0,0 +1,6 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = `
+"Snapshot Diff:
+Compared values have no visual difference."
+`;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot
new file mode 100644
index 000000000000..2a72ccaf2fef
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot
@@ -0,0 +1,604 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] = `
+"Snapshot Diff:
+- TSESTree
++ Babel
+
+ Array [
+ Keyword {
+ type: 'Keyword',
+ value: 'const',
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'x',
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'NamespacePropComponent',
+
+ range: [11, 33],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 33, line: 1 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
++ JSXIdentifier {
++ type: 'JSXIdentifier',
+ value: 'a',
+
+ range: [34, 35],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 35, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [35, 36],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 36, line: 1 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
++ JSXIdentifier {
++ type: 'JSXIdentifier',
+ value: 'b',
+
+ range: [36, 37],
+ loc: {
+ start: { column: 36, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [37, 38],
+ loc: {
+ start: { column: 37, line: 1 },
+ end: { column: 38, line: 1 },
+ },
+ },
+- JSXText {
+- type: 'JSXText',
++ String {
++ type: 'String',
+ value: '"tight spacing"',
+
+ range: [38, 53],
+ loc: {
+ start: { column: 38, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '/',
+
+ range: [54, 55],
+ loc: {
+ start: { column: 54, line: 1 },
+ end: { column: 55, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [55, 56],
+ loc: {
+ start: { column: 55, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [56, 57],
+ loc: {
+ start: { column: 56, line: 1 },
+ end: { column: 57, line: 1 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'const',
+
+ range: [58, 63],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'y',
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [66, 67],
+ loc: {
+ start: { column: 8, line: 2 },
+ end: { column: 9, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [68, 69],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 11, line: 2 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'NamespacePropComponent',
+
+ range: [69, 91],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 33, line: 2 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
++ JSXIdentifier {
++ type: 'JSXIdentifier',
+ value: 'a',
+
+ range: [92, 93],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [94, 95],
+ loc: {
+ start: { column: 36, line: 2 },
+ end: { column: 37, line: 2 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
++ JSXIdentifier {
++ type: 'JSXIdentifier',
+ value: 'b',
+
+ range: [96, 97],
+ loc: {
+ start: { column: 38, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [97, 98],
+ loc: {
+ start: { column: 39, line: 2 },
+ end: { column: 40, line: 2 },
+ },
+ },
+- JSXText {
+- type: 'JSXText',
++ String {
++ type: 'String',
+ value: '"loose spacing"',
+
+ range: [98, 113],
+ loc: {
+ start: { column: 40, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '/',
+
+ range: [114, 115],
+ loc: {
+ start: { column: 56, line: 2 },
+ end: { column: 57, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [115, 116],
+ loc: {
+ start: { column: 57, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [116, 117],
+ loc: {
+ start: { column: 58, line: 2 },
+ end: { column: 59, line: 2 },
+ },
+ },
+- Keyword {
+- type: 'Keyword',
++ Identifier {
++ type: 'Identifier',
+ value: 'interface',
+
+ range: [119, 128],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'NamespacePropComponentProps',
+
+ range: [129, 156],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ range: [157, 158],
+ loc: {
+ start: { column: 38, line: 4 },
+ end: { column: 39, line: 4 },
+ },
+ },
+ String {
+ type: 'String',
+ value: '"a:b"',
+
+ range: [163, 168],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [168, 169],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'string',
+
+ range: [170, 176],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [176, 177],
+ loc: {
+ start: { column: 17, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [178, 179],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'function',
+
+ range: [181, 189],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 8, line: 8 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'NamespacePropComponent',
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '(',
+
+ range: [212, 213],
+ loc: {
+ start: { column: 31, line: 8 },
+ end: { column: 32, line: 8 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'props',
+
+ range: [213, 218],
+ loc: {
+ start: { column: 32, line: 8 },
+ end: { column: 37, line: 8 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [218, 219],
+ loc: {
+ start: { column: 37, line: 8 },
+ end: { column: 38, line: 8 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'NamespacePropComponentProps',
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ')',
+
+ range: [247, 248],
+ loc: {
+ start: { column: 66, line: 8 },
+ end: { column: 67, line: 8 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ range: [249, 250],
+ loc: {
+ start: { column: 68, line: 8 },
+ end: { column: 69, line: 8 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'return',
+
+ range: [255, 261],
+ loc: {
+ start: { column: 4, line: 9 },
+ end: { column: 10, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [262, 263],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 12, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'div',
+
+ range: [263, 266],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 15, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [266, 267],
+ loc: {
+ start: { column: 15, line: 9 },
+ end: { column: 16, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ range: [267, 268],
+ loc: {
+ start: { column: 16, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'props',
+
+ range: [268, 273],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '[',
+
+ range: [273, 274],
+ loc: {
+ start: { column: 22, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+ String {
+ type: 'String',
+ value: '"a:b"',
+
+ range: [274, 279],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 28, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ']',
+
+ range: [279, 280],
+ loc: {
+ start: { column: 28, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [280, 281],
+ loc: {
+ start: { column: 29, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [281, 282],
+ loc: {
+ start: { column: 30, line: 9 },
+ end: { column: 31, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '/',
+
+ range: [282, 283],
+ loc: {
+ start: { column: 31, line: 9 },
+ end: { column: 32, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'div',
+
+ range: [283, 286],
+ loc: {
+ start: { column: 32, line: 9 },
+ end: { column: 35, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [286, 287],
+ loc: {
+ start: { column: 35, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [287, 288],
+ loc: {
+ start: { column: 36, line: 9 },
+ end: { column: 37, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [289, 290],
+ loc: {
+ start: { column: 0, line: 10 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ ]"
+`;
diff --git a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot
index 5ee1a88d62e2..9f47f7fb9737 100644
--- a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot
+++ b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot
@@ -26,6 +26,7 @@ exports[`AST Fixtures List fixtures with Token differences 1`] = `
"element/AccessorProperty/fixtures/modifier-private/fixture.ts",
"element/AccessorProperty/fixtures/modifier-protected/fixture.ts",
"element/AccessorProperty/fixtures/modifier-public/fixture.ts",
+ "jsx/JSXNamespacedName/fixtures/component/fixture.tsx",
"legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts",
"legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts",
"legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture.ts",
diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json
index 4a72224bb504..8e8552cba486 100644
--- a/packages/eslint-plugin-tslint/package.json
+++ b/packages/eslint-plugin-tslint/package.json
@@ -46,7 +46,6 @@
"typescript": "*"
},
"devDependencies": {
- "@types/lodash": "*",
"@typescript-eslint/parser": "5.59.9"
}
}
diff --git a/packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx b/packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx
new file mode 100644
index 000000000000..b42f48eaefdb
--- /dev/null
+++ b/packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx
@@ -0,0 +1,13 @@
+import * as React from "react";
+
+// Both of these are equivalent:
+const x = ;
+const y = ;
+
+interface FooProps {
+ "a:b": string;
+}
+
+function Foo(props: FooProps) {
+ return {props["a:b"]}
;
+}
diff --git a/packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx.shot
new file mode 100644
index 000000000000..045b34b7964e
--- /dev/null
+++ b/packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx.shot
@@ -0,0 +1,203 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`jsx namespaced-attribute 1`] = `
+ScopeManager {
+ variables: [
+ ImplicitGlobalConstTypeVariable,
+ Variable$2 {
+ defs: [
+ ImportBindingDefinition$1 {
+ name: Identifier<"React">,
+ node: ImportNamespaceSpecifier$1,
+ },
+ ],
+ name: "React",
+ references: [
+ Reference$2 {
+ identifier: Identifier<"React">,
+ isRead: true,
+ isTypeReference: false,
+ isValueReference: true,
+ isWrite: false,
+ resolved: Variable$2,
+ },
+ ],
+ isValueVariable: true,
+ isTypeVariable: true,
+ },
+ Variable$3 {
+ defs: [
+ VariableDefinition$2 {
+ name: Identifier<"x">,
+ node: VariableDeclarator$2,
+ },
+ ],
+ name: "x",
+ references: [
+ Reference$1 {
+ identifier: Identifier<"x">,
+ init: true,
+ isRead: false,
+ isTypeReference: false,
+ isValueReference: true,
+ isWrite: true,
+ resolved: Variable$3,
+ writeExpr: JSXElement$3,
+ },
+ ],
+ isValueVariable: true,
+ isTypeVariable: false,
+ },
+ Variable$4 {
+ defs: [
+ VariableDefinition$3 {
+ name: Identifier<"y">,
+ node: VariableDeclarator$4,
+ },
+ ],
+ name: "y",
+ references: [
+ Reference$4 {
+ identifier: Identifier<"y">,
+ init: true,
+ isRead: false,
+ isTypeReference: false,
+ isValueReference: true,
+ isWrite: true,
+ resolved: Variable$4,
+ writeExpr: JSXElement$5,
+ },
+ ],
+ isValueVariable: true,
+ isTypeVariable: false,
+ },
+ Variable$5 {
+ defs: [
+ TypeDefinition$4 {
+ name: Identifier<"FooProps">,
+ node: TSInterfaceDeclaration$6,
+ },
+ ],
+ name: "FooProps",
+ references: [
+ Reference$6 {
+ identifier: Identifier<"FooProps">,
+ isRead: true,
+ isTypeReference: true,
+ isValueReference: false,
+ isWrite: false,
+ resolved: Variable$5,
+ },
+ ],
+ isValueVariable: false,
+ isTypeVariable: true,
+ },
+ Variable$6 {
+ defs: [
+ FunctionNameDefinition$5 {
+ name: Identifier<"Foo">,
+ node: FunctionDeclaration$7,
+ },
+ ],
+ name: "Foo",
+ references: [
+ Reference$3 {
+ identifier: JSXIdentifier$8,
+ isRead: true,
+ isTypeReference: false,
+ isValueReference: true,
+ isWrite: false,
+ resolved: Variable$6,
+ },
+ Reference$5 {
+ identifier: JSXIdentifier$9,
+ isRead: true,
+ isTypeReference: false,
+ isValueReference: true,
+ isWrite: false,
+ resolved: Variable$6,
+ },
+ ],
+ isValueVariable: true,
+ isTypeVariable: false,
+ },
+ Variable$7 {
+ defs: [],
+ name: "arguments",
+ references: [],
+ isValueVariable: true,
+ isTypeVariable: true,
+ },
+ Variable$8 {
+ defs: [
+ ParameterDefinition$6 {
+ name: Identifier<"props">,
+ node: FunctionDeclaration$7,
+ },
+ ],
+ name: "props",
+ references: [
+ Reference$7 {
+ identifier: Identifier<"props">,
+ isRead: true,
+ isTypeReference: false,
+ isValueReference: true,
+ isWrite: false,
+ resolved: Variable$8,
+ },
+ ],
+ isValueVariable: true,
+ isTypeVariable: false,
+ },
+ ],
+ scopes: [
+ GlobalScope$1 {
+ block: Program$10,
+ isStrict: false,
+ references: [
+ Reference$1,
+ Reference$2,
+ Reference$3,
+ Reference$4,
+ Reference$5,
+ ],
+ set: Map {
+ "const" => ImplicitGlobalConstTypeVariable,
+ "React" => Variable$2,
+ "x" => Variable$3,
+ "y" => Variable$4,
+ "FooProps" => Variable$5,
+ "Foo" => Variable$6,
+ },
+ type: "global",
+ upper: null,
+ variables: [
+ ImplicitGlobalConstTypeVariable,
+ Variable$2,
+ Variable$3,
+ Variable$4,
+ Variable$5,
+ Variable$6,
+ ],
+ },
+ FunctionScope$2 {
+ block: FunctionDeclaration$7,
+ isStrict: false,
+ references: [
+ Reference$6,
+ Reference$7,
+ ],
+ set: Map {
+ "arguments" => Variable$7,
+ "props" => Variable$8,
+ },
+ type: "function",
+ upper: GlobalScope$1,
+ variables: [
+ Variable$7,
+ Variable$8,
+ ],
+ },
+ ],
+}
+`;
diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts
index e9c3e39d7a92..71fe614abf25 100644
--- a/packages/typescript-estree/src/convert.ts
+++ b/packages/typescript-estree/src/convert.ts
@@ -564,13 +564,33 @@ export class Converter {
}
private convertJSXNamespaceOrIdentifier(
- node: ts.Identifier | ts.ThisExpression,
+ node: ts.JsxNamespacedName | ts.Identifier | ts.ThisExpression,
): TSESTree.JSXIdentifier | TSESTree.JSXNamespacedName {
+ // TypeScript@5.1 added in ts.JsxNamespacedName directly
+ // We prefer using that if it's relevant for this node type
+ if (node.kind === ts.SyntaxKind.JsxNamespacedName) {
+ const result = this.createNode(node, {
+ type: AST_NODE_TYPES.JSXNamespacedName,
+ namespace: this.createNode(node.namespace, {
+ type: AST_NODE_TYPES.JSXIdentifier,
+ name: node.namespace.text,
+ }),
+ name: this.createNode(node.name, {
+ type: AST_NODE_TYPES.JSXIdentifier,
+ name: node.name.text,
+ }),
+ });
+ this.registerTSNodeInNodeMap(node, result);
+ return result;
+ }
+
+ // TypeScript@<5.1 has to manually parse the JSX attributes
const text = node.getText();
const colonIndex = text.indexOf(':');
// this is intentional we can ignore conversion if `:` is in first character
if (colonIndex > 0) {
const range = getRange(node, this.ast);
+ // @ts-expect-error -- TypeScript@<5.1 doesn't have ts.JsxNamespacedName
const result = this.createNode(node, {
type: AST_NODE_TYPES.JSXNamespacedName,
namespace: this.createNode(node, {
diff --git a/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts b/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts
index 5d0069ed1606..a2a32a927c25 100644
--- a/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts
+++ b/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts
@@ -3,16 +3,16 @@ import * as ts from 'typescript';
import type { ParseSettings } from './index';
/**
- * This needs to be kept in sync with /docs/maintenance/Versioning.md
+ * This needs to be kept in sync with /docs/maintenance/Versioning.mdx
* in the typescript-eslint monorepo
*/
-const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <5.1.0';
+const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <5.2.0';
/*
* The semver package will ignore prerelease ranges, and we don't want to explicitly document every one
* List them all separately here, so we can automatically create the full string
*/
-const SUPPORTED_PRERELEASE_RANGES: string[] = ['5.0.1-rc'];
+const SUPPORTED_PRERELEASE_RANGES: string[] = [];
const ACTIVE_TYPESCRIPT_VERSION = ts.version;
const isRunningSupportedTypeScriptVersion = semver.satisfies(
ACTIVE_TYPESCRIPT_VERSION,
diff --git a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
index c080a83559ba..e6e07addb4a4 100644
--- a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
+++ b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts
@@ -97,7 +97,7 @@ export interface EstreeToTsNodeTypes {
[AST_NODE_TYPES.JSXSpreadAttribute]: ts.JsxSpreadAttribute;
[AST_NODE_TYPES.JSXSpreadChild]: ts.JsxExpression;
[AST_NODE_TYPES.JSXMemberExpression]: ts.PropertyAccessExpression;
- [AST_NODE_TYPES.JSXNamespacedName]: ts.Identifier | ts.ThisExpression;
+ [AST_NODE_TYPES.JSXNamespacedName]: ts.JsxNamespacedName;
[AST_NODE_TYPES.JSXText]: ts.JsxText;
[AST_NODE_TYPES.LabeledStatement]: ts.LabeledStatement;
[AST_NODE_TYPES.Literal]:
diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts
index fe1042260d8d..00beec505d3f 100644
--- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts
+++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts
@@ -131,6 +131,7 @@ export type TSNode =
| ts.JsxSpreadAttribute
| ts.JsxClosingElement
| ts.JsxExpression
+ | ts.JsxNamespacedName
| ts.JsxText
| ts.NotEmittedStatement
| ts.CommaListExpression
diff --git a/yarn.lock b/yarn.lock
index dabaa778923e..9b33bcbf2ea8 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4254,7 +4254,7 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
-"@types/lodash@*", "@types/lodash@^4.14.182":
+"@types/lodash@^4.14.182":
version "4.14.194"
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.194.tgz#b71eb6f7a0ff11bff59fc987134a093029258a76"
integrity sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==
@@ -14723,10 +14723,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
-typescript@*, "typescript@>=3 < 6", "typescript@>=3.3.1 <5.1.0", typescript@next, typescript@~4.8.4, typescript@~5.0.2:
- version "5.0.4"
- resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
- integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==
+typescript@*, "typescript@>=3 < 6", "typescript@>=3.3.1 <5.2.0", typescript@next, typescript@~4.8.4, typescript@~5.1.3:
+ version "5.1.3"
+ resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826"
+ integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==
ua-parser-js@^0.7.30:
version "0.7.31"