hermes-estree 0.15.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -28,6 +28,7 @@ import type {
|
|
|
28
28
|
ArrayPattern,
|
|
29
29
|
ArrayTypeAnnotation,
|
|
30
30
|
ArrowFunctionExpression,
|
|
31
|
+
AsExpression,
|
|
31
32
|
AssignmentExpression,
|
|
32
33
|
AssignmentPattern,
|
|
33
34
|
AwaitExpression,
|
|
@@ -175,6 +176,7 @@ import type {
|
|
|
175
176
|
TypeAnnotation,
|
|
176
177
|
TypeCastExpression,
|
|
177
178
|
TypeofTypeAnnotation,
|
|
179
|
+
TypeOperator,
|
|
178
180
|
TypeParameter,
|
|
179
181
|
TypeParameterDeclaration,
|
|
180
182
|
TypeParameterInstantiation,
|
|
@@ -235,6 +237,12 @@ interface ArrowFunctionExpression_With_expression
|
|
|
235
237
|
interface ArrowFunctionExpression_With_async extends ArrowFunctionExpression {
|
|
236
238
|
+async: $NonMaybeType<ArrowFunctionExpression['async']>;
|
|
237
239
|
}
|
|
240
|
+
interface AsExpression_With_expression extends AsExpression {
|
|
241
|
+
+expression: $NonMaybeType<AsExpression['expression']>;
|
|
242
|
+
}
|
|
243
|
+
interface AsExpression_With_typeAnnotation extends AsExpression {
|
|
244
|
+
+typeAnnotation: $NonMaybeType<AsExpression['typeAnnotation']>;
|
|
245
|
+
}
|
|
238
246
|
interface AssignmentExpression_With_operator extends AssignmentExpression {
|
|
239
247
|
+operator: $NonMaybeType<AssignmentExpression['operator']>;
|
|
240
248
|
}
|
|
@@ -1312,6 +1320,12 @@ interface TypeCastExpression_With_typeAnnotation extends TypeCastExpression {
|
|
|
1312
1320
|
interface TypeofTypeAnnotation_With_argument extends TypeofTypeAnnotation {
|
|
1313
1321
|
+argument: $NonMaybeType<TypeofTypeAnnotation['argument']>;
|
|
1314
1322
|
}
|
|
1323
|
+
interface TypeOperator_With_operator extends TypeOperator {
|
|
1324
|
+
+operator: $NonMaybeType<TypeOperator['operator']>;
|
|
1325
|
+
}
|
|
1326
|
+
interface TypeOperator_With_typeAnnotation extends TypeOperator {
|
|
1327
|
+
+typeAnnotation: $NonMaybeType<TypeOperator['typeAnnotation']>;
|
|
1328
|
+
}
|
|
1315
1329
|
interface TypeParameter_With_name extends TypeParameter {
|
|
1316
1330
|
+name: $NonMaybeType<TypeParameter['name']>;
|
|
1317
1331
|
}
|
|
@@ -1438,6 +1452,7 @@ type ExpressionSpecialSelector =
|
|
|
1438
1452
|
| MetaProperty
|
|
1439
1453
|
| ArrayExpression
|
|
1440
1454
|
| ArrowFunctionExpression
|
|
1455
|
+
| AsExpression
|
|
1441
1456
|
| AssignmentExpression
|
|
1442
1457
|
| AwaitExpression
|
|
1443
1458
|
| BinaryExpression
|
|
@@ -1507,6 +1522,11 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
1507
1522
|
+'ArrowFunctionExpression[async]'?: (
|
|
1508
1523
|
node: ArrowFunctionExpression_With_async,
|
|
1509
1524
|
) => void,
|
|
1525
|
+
+AsExpression?: (node: AsExpression) => void,
|
|
1526
|
+
+'AsExpression[expression]'?: (node: AsExpression_With_expression) => void,
|
|
1527
|
+
+'AsExpression[typeAnnotation]'?: (
|
|
1528
|
+
node: AsExpression_With_typeAnnotation,
|
|
1529
|
+
) => void,
|
|
1510
1530
|
+AssignmentExpression?: (node: AssignmentExpression) => void,
|
|
1511
1531
|
+'AssignmentExpression[operator]'?: (
|
|
1512
1532
|
node: AssignmentExpression_With_operator,
|
|
@@ -2375,6 +2395,11 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2375
2395
|
+'TypeofTypeAnnotation[argument]'?: (
|
|
2376
2396
|
node: TypeofTypeAnnotation_With_argument,
|
|
2377
2397
|
) => void,
|
|
2398
|
+
+TypeOperator?: (node: TypeOperator) => void,
|
|
2399
|
+
+'TypeOperator[operator]'?: (node: TypeOperator_With_operator) => void,
|
|
2400
|
+
+'TypeOperator[typeAnnotation]'?: (
|
|
2401
|
+
node: TypeOperator_With_typeAnnotation,
|
|
2402
|
+
) => void,
|
|
2378
2403
|
+TypeParameter?: (node: TypeParameter) => void,
|
|
2379
2404
|
+'TypeParameter[name]'?: (node: TypeParameter_With_name) => void,
|
|
2380
2405
|
+'TypeParameter[bound]'?: (node: TypeParameter_With_bound) => void,
|
|
@@ -2484,6 +2509,13 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
2484
2509
|
+'ArrowFunctionExpression[async]:exit'?: (
|
|
2485
2510
|
node: ArrowFunctionExpression_With_async,
|
|
2486
2511
|
) => void,
|
|
2512
|
+
+'AsExpression:exit'?: (node: AsExpression) => void,
|
|
2513
|
+
+'AsExpression[expression]:exit'?: (
|
|
2514
|
+
node: AsExpression_With_expression,
|
|
2515
|
+
) => void,
|
|
2516
|
+
+'AsExpression[typeAnnotation]:exit'?: (
|
|
2517
|
+
node: AsExpression_With_typeAnnotation,
|
|
2518
|
+
) => void,
|
|
2487
2519
|
+'AssignmentExpression:exit'?: (node: AssignmentExpression) => void,
|
|
2488
2520
|
+'AssignmentExpression[operator]:exit'?: (
|
|
2489
2521
|
node: AssignmentExpression_With_operator,
|
|
@@ -3436,6 +3468,11 @@ export type ESQueryNodeSelectorsWithoutFallback = {
|
|
|
3436
3468
|
+'TypeofTypeAnnotation[argument]:exit'?: (
|
|
3437
3469
|
node: TypeofTypeAnnotation_With_argument,
|
|
3438
3470
|
) => void,
|
|
3471
|
+
+'TypeOperator:exit'?: (node: TypeOperator) => void,
|
|
3472
|
+
+'TypeOperator[operator]:exit'?: (node: TypeOperator_With_operator) => void,
|
|
3473
|
+
+'TypeOperator[typeAnnotation]:exit'?: (
|
|
3474
|
+
node: TypeOperator_With_typeAnnotation,
|
|
3475
|
+
) => void,
|
|
3439
3476
|
+'TypeParameter:exit'?: (node: TypeParameter) => void,
|
|
3440
3477
|
+'TypeParameter[name]:exit'?: (node: TypeParameter_With_name) => void,
|
|
3441
3478
|
+'TypeParameter[bound]:exit'?: (node: TypeParameter_With_bound) => void,
|
|
@@ -29,6 +29,7 @@ exports.isArrayExpression = isArrayExpression;
|
|
|
29
29
|
exports.isArrayPattern = isArrayPattern;
|
|
30
30
|
exports.isArrayTypeAnnotation = isArrayTypeAnnotation;
|
|
31
31
|
exports.isArrowFunctionExpression = isArrowFunctionExpression;
|
|
32
|
+
exports.isAsExpression = isAsExpression;
|
|
32
33
|
exports.isAsKeyword = isAsKeyword;
|
|
33
34
|
exports.isAssignmentExpression = isAssignmentExpression;
|
|
34
35
|
exports.isAssignmentPattern = isAssignmentPattern;
|
|
@@ -276,6 +277,7 @@ exports.isTypeAnnotation = isTypeAnnotation;
|
|
|
276
277
|
exports.isTypeCastExpression = isTypeCastExpression;
|
|
277
278
|
exports.isTypeKeyword = isTypeKeyword;
|
|
278
279
|
exports.isTypeOfToken = isTypeOfToken;
|
|
280
|
+
exports.isTypeOperator = isTypeOperator;
|
|
279
281
|
exports.isTypeParameter = isTypeParameter;
|
|
280
282
|
exports.isTypeParameterDeclaration = isTypeParameterDeclaration;
|
|
281
283
|
exports.isTypeParameterInstantiation = isTypeParameterInstantiation;
|
|
@@ -319,6 +321,10 @@ function isArrowFunctionExpression(node) {
|
|
|
319
321
|
return node.type === 'ArrowFunctionExpression';
|
|
320
322
|
}
|
|
321
323
|
|
|
324
|
+
function isAsExpression(node) {
|
|
325
|
+
return node.type === 'AsExpression';
|
|
326
|
+
}
|
|
327
|
+
|
|
322
328
|
function isAssignmentExpression(node) {
|
|
323
329
|
return node.type === 'AssignmentExpression';
|
|
324
330
|
}
|
|
@@ -903,6 +909,10 @@ function isTypeofTypeAnnotation(node) {
|
|
|
903
909
|
return node.type === 'TypeofTypeAnnotation';
|
|
904
910
|
}
|
|
905
911
|
|
|
912
|
+
function isTypeOperator(node) {
|
|
913
|
+
return node.type === 'TypeOperator';
|
|
914
|
+
}
|
|
915
|
+
|
|
906
916
|
function isTypeParameter(node) {
|
|
907
917
|
return node.type === 'TypeParameter';
|
|
908
918
|
}
|
|
@@ -45,6 +45,10 @@ export function isArrowFunctionExpression(
|
|
|
45
45
|
return node.type === 'ArrowFunctionExpression';
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
export function isAsExpression(node: ESNode | Token): boolean %checks {
|
|
49
|
+
return node.type === 'AsExpression';
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
export function isAssignmentExpression(node: ESNode | Token): boolean %checks {
|
|
49
53
|
return node.type === 'AssignmentExpression';
|
|
50
54
|
}
|
|
@@ -687,6 +691,10 @@ export function isTypeofTypeAnnotation(node: ESNode | Token): boolean %checks {
|
|
|
687
691
|
return node.type === 'TypeofTypeAnnotation';
|
|
688
692
|
}
|
|
689
693
|
|
|
694
|
+
export function isTypeOperator(node: ESNode | Token): boolean %checks {
|
|
695
|
+
return node.type === 'TypeOperator';
|
|
696
|
+
}
|
|
697
|
+
|
|
690
698
|
export function isTypeParameter(node: ESNode | Token): boolean %checks {
|
|
691
699
|
return node.type === 'TypeParameter';
|
|
692
700
|
}
|
package/dist/types.js.flow
CHANGED
|
@@ -398,7 +398,7 @@ export interface ComponentDeclaration extends BaseNode {
|
|
|
398
398
|
+body: BlockStatement;
|
|
399
399
|
+id: Identifier;
|
|
400
400
|
+params: $ReadOnlyArray<ComponentParameterAndRestElement>;
|
|
401
|
-
+rendersType: null |
|
|
401
|
+
+rendersType: null | TypeOperator;
|
|
402
402
|
+typeParameters: null | TypeParameterDeclaration;
|
|
403
403
|
}
|
|
404
404
|
|
|
@@ -451,6 +451,7 @@ export type Expression =
|
|
|
451
451
|
| ImportExpression
|
|
452
452
|
| ChainExpression
|
|
453
453
|
| TypeCastExpression
|
|
454
|
+
| AsExpression
|
|
454
455
|
| JSXFragment
|
|
455
456
|
| JSXElement;
|
|
456
457
|
|
|
@@ -544,8 +545,8 @@ export interface DestructuringObjectPropertyWithShorthandStaticName
|
|
|
544
545
|
+computed: false;
|
|
545
546
|
// shorthand keys *must* be identifiers
|
|
546
547
|
+key: Identifier;
|
|
547
|
-
// shorthand values *must* be identifiers (that look the same as the key)
|
|
548
|
-
+value: Identifier;
|
|
548
|
+
// shorthand values *must* be identifiers or assignments (that look the same as the key)
|
|
549
|
+
+value: Identifier | AssignmentPattern;
|
|
549
550
|
+shorthand: true;
|
|
550
551
|
}
|
|
551
552
|
export interface DestructuringObjectPropertyWithComputedName
|
|
@@ -700,7 +701,7 @@ export type Literal =
|
|
|
700
701
|
|
|
701
702
|
export interface BigIntLiteral extends BaseNode {
|
|
702
703
|
+type: 'Literal';
|
|
703
|
-
+value:
|
|
704
|
+
+value: bigint;
|
|
704
705
|
+bigint: string;
|
|
705
706
|
+raw: string;
|
|
706
707
|
+literalType: 'bigint';
|
|
@@ -1067,7 +1068,7 @@ export interface ExportNamedDeclarationWithSpecifiers
|
|
|
1067
1068
|
extends ExportNamedDeclarationBase {
|
|
1068
1069
|
+type: 'ExportNamedDeclaration';
|
|
1069
1070
|
+declaration: null;
|
|
1070
|
-
+source
|
|
1071
|
+
+source?: StringLiteral | null;
|
|
1071
1072
|
+specifiers: $ReadOnlyArray<ExportSpecifier>;
|
|
1072
1073
|
}
|
|
1073
1074
|
export interface ExportNamedDeclarationWithDeclaration
|
|
@@ -1140,6 +1141,7 @@ export type TypeAnnotationType =
|
|
|
1140
1141
|
| UnionTypeAnnotation
|
|
1141
1142
|
| IntersectionTypeAnnotation
|
|
1142
1143
|
| ConditionalTypeAnnotation
|
|
1144
|
+
| TypeOperator
|
|
1143
1145
|
| TypePredicate
|
|
1144
1146
|
| FunctionTypeAnnotation
|
|
1145
1147
|
| ComponentTypeAnnotation
|
|
@@ -1223,7 +1225,7 @@ export interface NumberLiteralTypeAnnotation extends BaseNode {
|
|
|
1223
1225
|
export interface BigIntLiteralTypeAnnotation extends BaseNode {
|
|
1224
1226
|
+type: 'BigIntLiteralTypeAnnotation';
|
|
1225
1227
|
+bigint: string;
|
|
1226
|
-
+value:
|
|
1228
|
+
+value: bigint;
|
|
1227
1229
|
+raw: string;
|
|
1228
1230
|
}
|
|
1229
1231
|
export interface BooleanLiteralTypeAnnotation extends BaseNode {
|
|
@@ -1320,6 +1322,13 @@ export interface ConditionalTypeAnnotation extends BaseNode {
|
|
|
1320
1322
|
+falseType: TypeAnnotationType;
|
|
1321
1323
|
}
|
|
1322
1324
|
|
|
1325
|
+
export interface TypeOperator extends BaseNode {
|
|
1326
|
+
+type: 'TypeOperator';
|
|
1327
|
+
// Supported type operators, currently only "renders".
|
|
1328
|
+
+operator: 'renders';
|
|
1329
|
+
+typeAnnotation: TypeAnnotationType;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1323
1332
|
export interface TypePredicate extends BaseNode {
|
|
1324
1333
|
+type: 'TypePredicate';
|
|
1325
1334
|
+parameterName: Identifier;
|
|
@@ -1349,7 +1358,7 @@ export interface ComponentTypeAnnotation extends BaseNode {
|
|
|
1349
1358
|
+params: $ReadOnlyArray<ComponentTypeParameter>;
|
|
1350
1359
|
+rest: null | ComponentTypeParameter;
|
|
1351
1360
|
+typeParameters: null | TypeParameterDeclaration;
|
|
1352
|
-
+rendersType: null |
|
|
1361
|
+
+rendersType: null | TypeOperator;
|
|
1353
1362
|
}
|
|
1354
1363
|
export interface ComponentTypeParameter extends BaseNode {
|
|
1355
1364
|
+type: 'ComponentTypeParameter';
|
|
@@ -1368,7 +1377,7 @@ export interface InferredPredicate extends BaseNode {
|
|
|
1368
1377
|
|
|
1369
1378
|
export interface ObjectTypeAnnotation extends BaseNode {
|
|
1370
1379
|
+type: 'ObjectTypeAnnotation';
|
|
1371
|
-
+inexact:
|
|
1380
|
+
+inexact: boolean;
|
|
1372
1381
|
+exact: boolean;
|
|
1373
1382
|
+properties: $ReadOnlyArray<
|
|
1374
1383
|
| ObjectTypeProperty
|
|
@@ -1479,6 +1488,11 @@ export interface TypeCastExpression extends BaseNode {
|
|
|
1479
1488
|
+expression: Expression;
|
|
1480
1489
|
+typeAnnotation: TypeAnnotation;
|
|
1481
1490
|
}
|
|
1491
|
+
export interface AsExpression extends BaseNode {
|
|
1492
|
+
+type: 'AsExpression';
|
|
1493
|
+
+expression: Expression;
|
|
1494
|
+
+typeAnnotation: TypeAnnotation;
|
|
1495
|
+
}
|
|
1482
1496
|
|
|
1483
1497
|
interface BaseInterfaceNode extends BaseNode {
|
|
1484
1498
|
+body: ObjectTypeAnnotation;
|
|
@@ -1647,7 +1661,7 @@ export interface DeclareComponent extends BaseNode {
|
|
|
1647
1661
|
+params: Array<ComponentTypeParameter>;
|
|
1648
1662
|
+rest: null | ComponentTypeParameter;
|
|
1649
1663
|
+typeParameters: null | TypeParameterDeclaration;
|
|
1650
|
-
+rendersType: null |
|
|
1664
|
+
+rendersType: null | TypeOperator;
|
|
1651
1665
|
}
|
|
1652
1666
|
|
|
1653
1667
|
export interface DeclareVariable extends BaseNode {
|
|
@@ -1707,7 +1721,11 @@ interface DeclareExportDeclarationBase extends BaseNode {
|
|
|
1707
1721
|
export interface DeclareExportDefaultDeclaration
|
|
1708
1722
|
extends DeclareExportDeclarationBase {
|
|
1709
1723
|
+type: 'DeclareExportDeclaration';
|
|
1710
|
-
+declaration:
|
|
1724
|
+
+declaration:
|
|
1725
|
+
| DeclareClass
|
|
1726
|
+
| DeclareFunction
|
|
1727
|
+
| DeclareComponent
|
|
1728
|
+
| TypeAnnotationType;
|
|
1711
1729
|
+default: true;
|
|
1712
1730
|
// default cannot have a source
|
|
1713
1731
|
+source: null;
|
|
@@ -1720,6 +1738,7 @@ export interface DeclareExportDeclarationNamedWithDeclaration
|
|
|
1720
1738
|
+declaration:
|
|
1721
1739
|
| DeclareClass
|
|
1722
1740
|
| DeclareFunction
|
|
1741
|
+
| DeclareComponent
|
|
1723
1742
|
| DeclareInterface
|
|
1724
1743
|
| DeclareOpaqueType
|
|
1725
1744
|
| DeclareVariable
|