Skip to content

Commit

Permalink
fix: remove export type * in d.ts to support TS<5.0 (#10070)
Browse files Browse the repository at this point in the history
  • Loading branch information
auvred committed Sep 30, 2024
1 parent a916ff2 commit 6ce66b5
Show file tree
Hide file tree
Showing 23 changed files with 255 additions and 253 deletions.
4 changes: 3 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ export default tseslint.config(
minimumDescriptionLength: 5,
},
],
// TODO: enable it once we drop support for TS<5.0
// https://github.com/typescript-eslint/typescript-eslint/issues/10065
'@typescript-eslint/consistent-type-exports': [
'error',
'off', // 'error',
{ fixMixedExportsWithInlineTypeSpecifier: true },
],
'@typescript-eslint/consistent-type-imports': [
Expand Down
28 changes: 14 additions & 14 deletions packages/ast-spec/src/declaration/spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export type * from './ClassDeclaration/spec';
export type * from './ExportAllDeclaration/spec';
export type * from './ExportDefaultDeclaration/spec';
export type * from './ExportNamedDeclaration/spec';
export type * from './FunctionDeclaration/spec';
export type * from './ImportDeclaration/spec';
export type * from './TSDeclareFunction/spec';
export type * from './TSEnumDeclaration/spec';
export type * from './TSImportEqualsDeclaration/spec';
export type * from './TSInterfaceDeclaration/spec';
export type * from './TSModuleDeclaration/spec';
export type * from './TSNamespaceExportDeclaration/spec';
export type * from './TSTypeAliasDeclaration/spec';
export type * from './VariableDeclaration/spec';
export * from './ClassDeclaration/spec';
export * from './ExportAllDeclaration/spec';
export * from './ExportDefaultDeclaration/spec';
export * from './ExportNamedDeclaration/spec';
export * from './FunctionDeclaration/spec';
export * from './ImportDeclaration/spec';
export * from './TSDeclareFunction/spec';
export * from './TSEnumDeclaration/spec';
export * from './TSImportEqualsDeclaration/spec';
export * from './TSInterfaceDeclaration/spec';
export * from './TSModuleDeclaration/spec';
export * from './TSNamespaceExportDeclaration/spec';
export * from './TSTypeAliasDeclaration/spec';
export * from './VariableDeclaration/spec';
30 changes: 15 additions & 15 deletions packages/ast-spec/src/element/spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export type * from './AccessorProperty/spec';
export type * from './MethodDefinition/spec';
export type * from './Property/spec';
export type * from './PropertyDefinition/spec';
export type * from './SpreadElement/spec';
export type * from './StaticBlock/spec';
export type * from './TSAbstractAccessorProperty/spec';
export type * from './TSAbstractMethodDefinition/spec';
export type * from './TSAbstractPropertyDefinition/spec';
export type * from './TSCallSignatureDeclaration/spec';
export type * from './TSConstructSignatureDeclaration/spec';
export type * from './TSEnumMember/spec';
export type * from './TSIndexSignature/spec';
export type * from './TSMethodSignature/spec';
export type * from './TSPropertySignature/spec';
export * from './AccessorProperty/spec';
export * from './MethodDefinition/spec';
export * from './Property/spec';
export * from './PropertyDefinition/spec';
export * from './SpreadElement/spec';
export * from './StaticBlock/spec';
export * from './TSAbstractAccessorProperty/spec';
export * from './TSAbstractMethodDefinition/spec';
export * from './TSAbstractPropertyDefinition/spec';
export * from './TSCallSignatureDeclaration/spec';
export * from './TSConstructSignatureDeclaration/spec';
export * from './TSEnumMember/spec';
export * from './TSIndexSignature/spec';
export * from './TSMethodSignature/spec';
export * from './TSPropertySignature/spec';
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Expression } from '../../unions/Expression';
import type { ValueOf } from '../../utils';
import type { AssignmentOperatorToText } from './AssignmentOperatorToText';

export type * from './AssignmentOperatorToText';
export * from './AssignmentOperatorToText';

export interface AssignmentExpression extends BaseNode {
left: Expression;
Expand Down
2 changes: 1 addition & 1 deletion packages/ast-spec/src/expression/BinaryExpression/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Expression } from '../../unions/Expression';
import type { ValueOf } from '../../utils';
import type { BinaryOperatorToText } from './BinaryOperatorToText';

export type * from './BinaryOperatorToText';
export * from './BinaryOperatorToText';

export interface BinaryExpression extends BaseNode {
left: Expression | PrivateIdentifier;
Expand Down
12 changes: 6 additions & 6 deletions packages/ast-spec/src/expression/literal/spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type * from './BigIntLiteral/spec';
export type * from './BooleanLiteral/spec';
export type * from './NullLiteral/spec';
export type * from './NumberLiteral/spec';
export type * from './RegExpLiteral/spec';
export type * from './StringLiteral/spec';
export * from './BigIntLiteral/spec';
export * from './BooleanLiteral/spec';
export * from './NullLiteral/spec';
export * from './NumberLiteral/spec';
export * from './RegExpLiteral/spec';
export * from './StringLiteral/spec';
68 changes: 34 additions & 34 deletions packages/ast-spec/src/expression/spec.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
export type * from './ArrayExpression/spec';
export type * from './ArrowFunctionExpression/spec';
export type * from './AssignmentExpression/spec';
export type * from './AwaitExpression/spec';
export type * from './BinaryExpression/spec';
export type * from './CallExpression/spec';
export type * from './ChainExpression/spec';
export type * from './ClassExpression/spec';
export type * from './ConditionalExpression/spec';
export type * from './FunctionExpression/spec';
export type * from './Identifier/spec';
export type * from './ImportExpression/spec';
export type * from './JSXElement/spec';
export type * from './JSXFragment/spec';
export type * from './literal/spec';
export type * from './LogicalExpression/spec';
export type * from './MemberExpression/spec';
export type * from './MetaProperty/spec';
export type * from './NewExpression/spec';
export type * from './ObjectExpression/spec';
export type * from './SequenceExpression/spec';
export type * from './Super/spec';
export type * from './TaggedTemplateExpression/spec';
export type * from './TemplateLiteral/spec';
export type * from './ThisExpression/spec';
export type * from './TSAsExpression/spec';
export type * from './TSEmptyBodyFunctionExpression/spec';
export type * from './TSInstantiationExpression/spec';
export type * from './TSNonNullExpression/spec';
export type * from './TSSatisfiesExpression/spec';
export type * from './TSTypeAssertion/spec';
export type * from './UnaryExpression/spec';
export type * from './UpdateExpression/spec';
export type * from './YieldExpression/spec';
export * from './ArrayExpression/spec';
export * from './ArrowFunctionExpression/spec';
export * from './AssignmentExpression/spec';
export * from './AwaitExpression/spec';
export * from './BinaryExpression/spec';
export * from './CallExpression/spec';
export * from './ChainExpression/spec';
export * from './ClassExpression/spec';
export * from './ConditionalExpression/spec';
export * from './FunctionExpression/spec';
export * from './Identifier/spec';
export * from './ImportExpression/spec';
export * from './JSXElement/spec';
export * from './JSXFragment/spec';
export * from './literal/spec';
export * from './LogicalExpression/spec';
export * from './MemberExpression/spec';
export * from './MetaProperty/spec';
export * from './NewExpression/spec';
export * from './ObjectExpression/spec';
export * from './SequenceExpression/spec';
export * from './Super/spec';
export * from './TaggedTemplateExpression/spec';
export * from './TemplateLiteral/spec';
export * from './ThisExpression/spec';
export * from './TSAsExpression/spec';
export * from './TSEmptyBodyFunctionExpression/spec';
export * from './TSInstantiationExpression/spec';
export * from './TSNonNullExpression/spec';
export * from './TSSatisfiesExpression/spec';
export * from './TSTypeAssertion/spec';
export * from './UnaryExpression/spec';
export * from './UpdateExpression/spec';
export * from './YieldExpression/spec';
94 changes: 47 additions & 47 deletions packages/ast-spec/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
export * from './ast-node-types';
export * from './ast-token-types';
export type * from './base/Accessibility';
export type * from './base/BaseNode'; // this is exported so that the `types` package can merge the decl and add the `parent` property
export type * from './base/NodeOrTokenData';
export type * from './base/OptionalRangeAndLoc';
export type * from './base/Position';
export type * from './base/Range';
export type * from './base/SourceLocation';
export type * from './declaration/spec';
export type * from './element/spec';
export type * from './expression/spec';
export type * from './jsx/spec';
export type * from './parameter/spec';
export type * from './special/spec';
export type * from './statement/spec';
export type * from './token/spec';
export type * from './type/spec';
export type * from './unions/BindingName';
export type * from './unions/BindingPattern';
export type * from './unions/CallExpressionArgument';
export type * from './unions/ChainElement';
export type * from './unions/ClassElement';
export type * from './unions/Comment';
export type * from './unions/DeclarationStatement';
export type * from './unions/DestructuringPattern';
export type * from './unions/EntityName';
export type * from './unions/ExportDeclaration';
export type * from './unions/Expression';
export type * from './unions/ForInitialiser';
export type * from './unions/FunctionLike';
export type * from './unions/ImportClause';
export type * from './unions/IterationStatement';
export type * from './unions/JSXChild';
export type * from './unions/JSXExpression';
export type * from './unions/JSXTagNameExpression';
export type * from './unions/LeftHandSideExpression';
export type * from './unions/Literal';
export type * from './unions/LiteralExpression';
export type * from './unions/Node';
export type * from './unions/ObjectLiteralElement';
export type * from './unions/Parameter';
export type * from './unions/PrimaryExpression';
export type * from './unions/PropertyName';
export type * from './unions/Statement';
export type * from './unions/Token';
export type * from './unions/TSUnaryExpression';
export type * from './unions/TypeElement';
export type * from './unions/TypeNode';
export * from './base/Accessibility';
export * from './base/BaseNode'; // this is exported so that the `types` package can merge the decl and add the `parent` property
export * from './base/NodeOrTokenData';
export * from './base/OptionalRangeAndLoc';
export * from './base/Position';
export * from './base/Range';
export * from './base/SourceLocation';
export * from './declaration/spec';
export * from './element/spec';
export * from './expression/spec';
export * from './jsx/spec';
export * from './parameter/spec';
export * from './special/spec';
export * from './statement/spec';
export * from './token/spec';
export * from './type/spec';
export * from './unions/BindingName';
export * from './unions/BindingPattern';
export * from './unions/CallExpressionArgument';
export * from './unions/ChainElement';
export * from './unions/ClassElement';
export * from './unions/Comment';
export * from './unions/DeclarationStatement';
export * from './unions/DestructuringPattern';
export * from './unions/EntityName';
export * from './unions/ExportDeclaration';
export * from './unions/Expression';
export * from './unions/ForInitialiser';
export * from './unions/FunctionLike';
export * from './unions/ImportClause';
export * from './unions/IterationStatement';
export * from './unions/JSXChild';
export * from './unions/JSXExpression';
export * from './unions/JSXTagNameExpression';
export * from './unions/LeftHandSideExpression';
export * from './unions/Literal';
export * from './unions/LiteralExpression';
export * from './unions/Node';
export * from './unions/ObjectLiteralElement';
export * from './unions/Parameter';
export * from './unions/PrimaryExpression';
export * from './unions/PropertyName';
export * from './unions/Statement';
export * from './unions/Token';
export * from './unions/TSUnaryExpression';
export * from './unions/TypeElement';
export * from './unions/TypeNode';
26 changes: 13 additions & 13 deletions packages/ast-spec/src/jsx/spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export type * from './JSXAttribute/spec';
export type * from './JSXClosingElement/spec';
export type * from './JSXClosingFragment/spec';
export type * from './JSXEmptyExpression/spec';
export type * from './JSXExpressionContainer/spec';
export type * from './JSXIdentifier/spec';
export type * from './JSXMemberExpression/spec';
export type * from './JSXNamespacedName/spec';
export type * from './JSXOpeningElement/spec';
export type * from './JSXOpeningFragment/spec';
export type * from './JSXSpreadAttribute/spec';
export type * from './JSXSpreadChild/spec';
export type * from './JSXText/spec';
export * from './JSXAttribute/spec';
export * from './JSXClosingElement/spec';
export * from './JSXClosingFragment/spec';
export * from './JSXEmptyExpression/spec';
export * from './JSXExpressionContainer/spec';
export * from './JSXIdentifier/spec';
export * from './JSXMemberExpression/spec';
export * from './JSXNamespacedName/spec';
export * from './JSXOpeningElement/spec';
export * from './JSXOpeningFragment/spec';
export * from './JSXSpreadAttribute/spec';
export * from './JSXSpreadChild/spec';
export * from './JSXText/spec';
10 changes: 5 additions & 5 deletions packages/ast-spec/src/parameter/spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type * from './ArrayPattern/spec';
export type * from './AssignmentPattern/spec';
export type * from './ObjectPattern/spec';
export type * from './RestElement/spec';
export type * from './TSParameterProperty/spec';
export * from './ArrayPattern/spec';
export * from './AssignmentPattern/spec';
export * from './ObjectPattern/spec';
export * from './RestElement/spec';
export * from './TSParameterProperty/spec';
48 changes: 24 additions & 24 deletions packages/ast-spec/src/special/spec.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
export type * from './CatchClause/spec';
export type * from './ClassBody/spec';
export type * from './Decorator/spec';
export type * from './EmptyStatement/spec';
export type * from './ExportSpecifier/spec';
export type * from './ImportAttribute/spec';
export type * from './ImportDefaultSpecifier/spec';
export type * from './ImportNamespaceSpecifier/spec';
export type * from './ImportSpecifier/spec';
export type * from './PrivateIdentifier/spec';
export type * from './Program/spec';
export type * from './SwitchCase/spec';
export type * from './TemplateElement/spec';
export type * from './TSClassImplements/spec';
export type * from './TSEnumBody/spec';
export type * from './TSExternalModuleReference/spec';
export type * from './TSInterfaceBody/spec';
export type * from './TSInterfaceHeritage/spec';
export type * from './TSModuleBlock/spec';
export type * from './TSTypeAnnotation/spec';
export type * from './TSTypeParameter/spec';
export type * from './TSTypeParameterDeclaration/spec';
export type * from './TSTypeParameterInstantiation/spec';
export type * from './VariableDeclarator/spec';
export * from './CatchClause/spec';
export * from './ClassBody/spec';
export * from './Decorator/spec';
export * from './EmptyStatement/spec';
export * from './ExportSpecifier/spec';
export * from './ImportAttribute/spec';
export * from './ImportDefaultSpecifier/spec';
export * from './ImportNamespaceSpecifier/spec';
export * from './ImportSpecifier/spec';
export * from './PrivateIdentifier/spec';
export * from './Program/spec';
export * from './SwitchCase/spec';
export * from './TemplateElement/spec';
export * from './TSClassImplements/spec';
export * from './TSEnumBody/spec';
export * from './TSExternalModuleReference/spec';
export * from './TSInterfaceBody/spec';
export * from './TSInterfaceHeritage/spec';
export * from './TSModuleBlock/spec';
export * from './TSTypeAnnotation/spec';
export * from './TSTypeParameter/spec';
export * from './TSTypeParameterDeclaration/spec';
export * from './TSTypeParameterInstantiation/spec';
export * from './VariableDeclarator/spec';
36 changes: 18 additions & 18 deletions packages/ast-spec/src/statement/spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
export type * from './BlockStatement/spec';
export type * from './BreakStatement/spec';
export type * from './ContinueStatement/spec';
export type * from './DebuggerStatement/spec';
export type * from './DoWhileStatement/spec';
export type * from './ExpressionStatement/spec';
export type * from './ForInStatement/spec';
export type * from './ForOfStatement/spec';
export type * from './ForStatement/spec';
export type * from './IfStatement/spec';
export type * from './LabeledStatement/spec';
export type * from './ReturnStatement/spec';
export type * from './SwitchStatement/spec';
export type * from './ThrowStatement/spec';
export type * from './TryStatement/spec';
export type * from './TSExportAssignment/spec';
export type * from './WhileStatement/spec';
export type * from './WithStatement/spec';
export * from './BlockStatement/spec';
export * from './BreakStatement/spec';
export * from './ContinueStatement/spec';
export * from './DebuggerStatement/spec';
export * from './DoWhileStatement/spec';
export * from './ExpressionStatement/spec';
export * from './ForInStatement/spec';
export * from './ForOfStatement/spec';
export * from './ForStatement/spec';
export * from './IfStatement/spec';
export * from './LabeledStatement/spec';
export * from './ReturnStatement/spec';
export * from './SwitchStatement/spec';
export * from './ThrowStatement/spec';
export * from './TryStatement/spec';
export * from './TSExportAssignment/spec';
export * from './WhileStatement/spec';
export * from './WithStatement/spec';
Loading

0 comments on commit 6ce66b5

Please sign in to comment.