Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(ast-spec): add TSQualifiedName to TypeNode union#5906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bradzacher merged 2 commits intomainfrombradzacher-patch-2022-10-31
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletionspackages/ast-spec/src/unions/TypeNode.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,6 +25,7 @@ import type { TSOptionalType } from '../type/TSOptionalType/spec';
import type { TSPrivateKeyword } from '../type/TSPrivateKeyword/spec';
import type { TSProtectedKeyword } from '../type/TSProtectedKeyword/spec';
import type { TSPublicKeyword } from '../type/TSPublicKeyword/spec';
import type { TSQualifiedName } from '../type/TSQualifiedName/spec';
import type { TSReadonlyKeyword } from '../type/TSReadonlyKeyword/spec';
import type { TSRestType } from '../type/TSRestType/spec';
import type { TSStaticKeyword } from '../type/TSStaticKeyword/spec';
Expand DownExpand Up@@ -71,6 +72,7 @@ export type TypeNode =
| TSPrivateKeyword
| TSProtectedKeyword
| TSPublicKeyword
| TSQualifiedName
| TSReadonlyKeyword
| TSRestType
| TSStaticKeyword
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,6 +60,7 @@ function getGroup(node: TSESTree.TypeNode): Group {
case AST_NODE_TYPES.TSIndexedAccessType:
case AST_NODE_TYPES.TSInferType:
case AST_NODE_TYPES.TSTypeReference:
case AST_NODE_TYPES.TSQualifiedName:
return Group.named;

case AST_NODE_TYPES.TSMappedType:
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,6 +60,7 @@ function getGroup(node: TSESTree.TypeNode): Group {
case AST_NODE_TYPES.TSIndexedAccessType:
case AST_NODE_TYPES.TSInferType:
case AST_NODE_TYPES.TSTypeReference:
case AST_NODE_TYPES.TSQualifiedName:
return Group.named;

case AST_NODE_TYPES.TSMappedType:
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,6 +45,8 @@ const valid = (operator: '|' | '&'): TSESLint.ValidTestCase<Options>[] => [
type T =
${operator} A
${operator} B
${operator} C.D
${operator} D.E
${operator} intrinsic
${operator} number[]
${operator} string[]
Expand DownExpand Up@@ -220,6 +222,8 @@ type T =
${operator} readonly number[]
${operator} string[]
${operator} number[]
${operator} D.E
${operator} C.D
${operator} B
${operator} A
${operator} undefined
Expand All@@ -229,7 +233,7 @@ type T =
`,
output: `
type T =
A ${operator} B ${operator} number[] ${operator} string[] ${operator} any ${operator} string ${operator} readonly number[] ${operator} readonly string[] ${operator} 'a' ${operator} 'b' ${operator} "a" ${operator} "b" ${operator} (() => string) ${operator} (() => void) ${operator} { a: string } ${operator} { b: string } ${operator} [1, 2, 3] ${operator} [1, 2, 4] ${operator} null ${operator} undefined;
A ${operator} B ${operator}C.D ${operator} D.E ${operator}number[] ${operator} string[] ${operator} any ${operator} string ${operator} readonly number[] ${operator} readonly string[] ${operator} 'a' ${operator} 'b' ${operator} "a" ${operator} "b" ${operator} (() => string) ${operator} (() => void) ${operator} { a: string } ${operator} { b: string } ${operator} [1, 2, 3] ${operator} [1, 2, 4] ${operator} null ${operator} undefined;
`,
errors: [
{
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -45,6 +45,8 @@ const valid = (operator: '|' | '&'): TSESLint.ValidTestCase<Options>[] => [
type T =
${operator} A
${operator} B
${operator} C.D
${operator} D.E
${operator} intrinsic
${operator} number[]
${operator} string[]
Expand DownExpand Up@@ -220,6 +222,8 @@ type T =
${operator} readonly number[]
${operator} string[]
${operator} number[]
${operator} D.E
${operator} C.D
${operator} B
${operator} A
${operator} undefined
Expand All@@ -229,7 +233,7 @@ type T =
`,
output: `
type T =
A ${operator} B ${operator} number[] ${operator} string[] ${operator} any ${operator} string ${operator} readonly number[] ${operator} readonly string[] ${operator} 'a' ${operator} 'b' ${operator} "a" ${operator} "b" ${operator} (() => string) ${operator} (() => void) ${operator} { a: string } ${operator} { b: string } ${operator} [1, 2, 3] ${operator} [1, 2, 4] ${operator} null ${operator} undefined;
A ${operator} B ${operator}C.D ${operator} D.E ${operator}number[] ${operator} string[] ${operator} any ${operator} string ${operator} readonly number[] ${operator} readonly string[] ${operator} 'a' ${operator} 'b' ${operator} "a" ${operator} "b" ${operator} (() => string) ${operator} (() => void) ${operator} { a: string } ${operator} { b: string } ${operator} [1, 2, 3] ${operator} [1, 2, 4] ${operator} null ${operator} undefined;
`,
errors: [
{
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp