Skip to content

Commit d0e35d9

Browse files
authored
feat(eslint-plugin): [consistent-type-exports] check export * exports to see if all exported members are types (typescript-eslint#10006)
* feat(eslint-plugin): [consistent-type-exports] check "export *" exports to see if all exported members are types * filter + length === some * lint --fix
1 parent dc1c6d3 commit d0e35d9

File tree

28 files changed

+457
-264
lines changed

28 files changed

+457
-264
lines changed
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
export * from './ClassDeclaration/spec';
2-
export * from './ExportAllDeclaration/spec';
3-
export * from './ExportDefaultDeclaration/spec';
4-
export * from './ExportNamedDeclaration/spec';
5-
export * from './FunctionDeclaration/spec';
6-
export * from './ImportDeclaration/spec';
7-
export * from './TSDeclareFunction/spec';
8-
export * from './TSEnumDeclaration/spec';
9-
export * from './TSImportEqualsDeclaration/spec';
10-
export * from './TSInterfaceDeclaration/spec';
11-
export * from './TSModuleDeclaration/spec';
12-
export * from './TSNamespaceExportDeclaration/spec';
13-
export * from './TSTypeAliasDeclaration/spec';
14-
export * from './VariableDeclaration/spec';
1+
export type * from './ClassDeclaration/spec';
2+
export type * from './ExportAllDeclaration/spec';
3+
export type * from './ExportDefaultDeclaration/spec';
4+
export type * from './ExportNamedDeclaration/spec';
5+
export type * from './FunctionDeclaration/spec';
6+
export type * from './ImportDeclaration/spec';
7+
export type * from './TSDeclareFunction/spec';
8+
export type * from './TSEnumDeclaration/spec';
9+
export type * from './TSImportEqualsDeclaration/spec';
10+
export type * from './TSInterfaceDeclaration/spec';
11+
export type * from './TSModuleDeclaration/spec';
12+
export type * from './TSNamespaceExportDeclaration/spec';
13+
export type * from './TSTypeAliasDeclaration/spec';
14+
export type * from './VariableDeclaration/spec';

packages/ast-spec/src/element/spec.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
export * from './AccessorProperty/spec';
2-
export * from './MethodDefinition/spec';
3-
export * from './Property/spec';
4-
export * from './PropertyDefinition/spec';
5-
export * from './SpreadElement/spec';
6-
export * from './StaticBlock/spec';
7-
export * from './TSAbstractAccessorProperty/spec';
8-
export * from './TSAbstractMethodDefinition/spec';
9-
export * from './TSAbstractPropertyDefinition/spec';
10-
export * from './TSCallSignatureDeclaration/spec';
11-
export * from './TSConstructSignatureDeclaration/spec';
12-
export * from './TSEnumMember/spec';
13-
export * from './TSIndexSignature/spec';
14-
export * from './TSMethodSignature/spec';
15-
export * from './TSPropertySignature/spec';
1+
export type * from './AccessorProperty/spec';
2+
export type * from './MethodDefinition/spec';
3+
export type * from './Property/spec';
4+
export type * from './PropertyDefinition/spec';
5+
export type * from './SpreadElement/spec';
6+
export type * from './StaticBlock/spec';
7+
export type * from './TSAbstractAccessorProperty/spec';
8+
export type * from './TSAbstractMethodDefinition/spec';
9+
export type * from './TSAbstractPropertyDefinition/spec';
10+
export type * from './TSCallSignatureDeclaration/spec';
11+
export type * from './TSConstructSignatureDeclaration/spec';
12+
export type * from './TSEnumMember/spec';
13+
export type * from './TSIndexSignature/spec';
14+
export type * from './TSMethodSignature/spec';
15+
export type * from './TSPropertySignature/spec';

packages/ast-spec/src/expression/AssignmentExpression/spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Expression } from '../../unions/Expression';
44
import type { ValueOf } from '../../utils';
55
import type { AssignmentOperatorToText } from './AssignmentOperatorToText';
66

7-
export * from './AssignmentOperatorToText';
7+
export type * from './AssignmentOperatorToText';
88

99
export interface AssignmentExpression extends BaseNode {
1010
left: Expression;

packages/ast-spec/src/expression/BinaryExpression/spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { Expression } from '../../unions/Expression';
55
import type { ValueOf } from '../../utils';
66
import type { BinaryOperatorToText } from './BinaryOperatorToText';
77

8-
export * from './BinaryOperatorToText';
8+
export type * from './BinaryOperatorToText';
99

1010
export interface BinaryExpression extends BaseNode {
1111
left: Expression | PrivateIdentifier;
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export * from './BigIntLiteral/spec';
2-
export * from './BooleanLiteral/spec';
3-
export * from './NullLiteral/spec';
4-
export * from './NumberLiteral/spec';
5-
export * from './RegExpLiteral/spec';
6-
export * from './StringLiteral/spec';
1+
export type * from './BigIntLiteral/spec';
2+
export type * from './BooleanLiteral/spec';
3+
export type * from './NullLiteral/spec';
4+
export type * from './NumberLiteral/spec';
5+
export type * from './RegExpLiteral/spec';
6+
export type * from './StringLiteral/spec';
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
export * from './ArrayExpression/spec';
2-
export * from './ArrowFunctionExpression/spec';
3-
export * from './AssignmentExpression/spec';
4-
export * from './AwaitExpression/spec';
5-
export * from './BinaryExpression/spec';
6-
export * from './CallExpression/spec';
7-
export * from './ChainExpression/spec';
8-
export * from './ClassExpression/spec';
9-
export * from './ConditionalExpression/spec';
10-
export * from './FunctionExpression/spec';
11-
export * from './Identifier/spec';
12-
export * from './ImportExpression/spec';
13-
export * from './JSXElement/spec';
14-
export * from './JSXFragment/spec';
15-
export * from './literal/spec';
16-
export * from './LogicalExpression/spec';
17-
export * from './MemberExpression/spec';
18-
export * from './MetaProperty/spec';
19-
export * from './NewExpression/spec';
20-
export * from './ObjectExpression/spec';
21-
export * from './SequenceExpression/spec';
22-
export * from './Super/spec';
23-
export * from './TaggedTemplateExpression/spec';
24-
export * from './TemplateLiteral/spec';
25-
export * from './ThisExpression/spec';
26-
export * from './TSAsExpression/spec';
27-
export * from './TSEmptyBodyFunctionExpression/spec';
28-
export * from './TSInstantiationExpression/spec';
29-
export * from './TSNonNullExpression/spec';
30-
export * from './TSSatisfiesExpression/spec';
31-
export * from './TSTypeAssertion/spec';
32-
export * from './UnaryExpression/spec';
33-
export * from './UpdateExpression/spec';
34-
export * from './YieldExpression/spec';
1+
export type * from './ArrayExpression/spec';
2+
export type * from './ArrowFunctionExpression/spec';
3+
export type * from './AssignmentExpression/spec';
4+
export type * from './AwaitExpression/spec';
5+
export type * from './BinaryExpression/spec';
6+
export type * from './CallExpression/spec';
7+
export type * from './ChainExpression/spec';
8+
export type * from './ClassExpression/spec';
9+
export type * from './ConditionalExpression/spec';
10+
export type * from './FunctionExpression/spec';
11+
export type * from './Identifier/spec';
12+
export type * from './ImportExpression/spec';
13+
export type * from './JSXElement/spec';
14+
export type * from './JSXFragment/spec';
15+
export type * from './literal/spec';
16+
export type * from './LogicalExpression/spec';
17+
export type * from './MemberExpression/spec';
18+
export type * from './MetaProperty/spec';
19+
export type * from './NewExpression/spec';
20+
export type * from './ObjectExpression/spec';
21+
export type * from './SequenceExpression/spec';
22+
export type * from './Super/spec';
23+
export type * from './TaggedTemplateExpression/spec';
24+
export type * from './TemplateLiteral/spec';
25+
export type * from './ThisExpression/spec';
26+
export type * from './TSAsExpression/spec';
27+
export type * from './TSEmptyBodyFunctionExpression/spec';
28+
export type * from './TSInstantiationExpression/spec';
29+
export type * from './TSNonNullExpression/spec';
30+
export type * from './TSSatisfiesExpression/spec';
31+
export type * from './TSTypeAssertion/spec';
32+
export type * from './UnaryExpression/spec';
33+
export type * from './UpdateExpression/spec';
34+
export type * from './YieldExpression/spec';

packages/ast-spec/src/index.ts

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
export * from './ast-node-types';
22
export * from './ast-token-types';
3-
export * from './base/Accessibility';
4-
export * from './base/BaseNode'; // this is exported so that the `types` package can merge the decl and add the `parent` property
5-
export * from './base/NodeOrTokenData';
6-
export * from './base/OptionalRangeAndLoc';
7-
export * from './base/Position';
8-
export * from './base/Range';
9-
export * from './base/SourceLocation';
10-
export * from './declaration/spec';
11-
export * from './element/spec';
12-
export * from './expression/spec';
13-
export * from './jsx/spec';
14-
export * from './parameter/spec';
15-
export * from './special/spec';
16-
export * from './statement/spec';
17-
export * from './token/spec';
18-
export * from './type/spec';
19-
export * from './unions/BindingName';
20-
export * from './unions/BindingPattern';
21-
export * from './unions/CallExpressionArgument';
22-
export * from './unions/ChainElement';
23-
export * from './unions/ClassElement';
24-
export * from './unions/Comment';
25-
export * from './unions/DeclarationStatement';
26-
export * from './unions/DestructuringPattern';
27-
export * from './unions/EntityName';
28-
export * from './unions/ExportDeclaration';
29-
export * from './unions/Expression';
30-
export * from './unions/ForInitialiser';
31-
export * from './unions/FunctionLike';
32-
export * from './unions/ImportClause';
33-
export * from './unions/IterationStatement';
34-
export * from './unions/JSXChild';
35-
export * from './unions/JSXExpression';
36-
export * from './unions/JSXTagNameExpression';
37-
export * from './unions/LeftHandSideExpression';
38-
export * from './unions/Literal';
39-
export * from './unions/LiteralExpression';
40-
export * from './unions/Node';
41-
export * from './unions/ObjectLiteralElement';
42-
export * from './unions/Parameter';
43-
export * from './unions/PrimaryExpression';
44-
export * from './unions/PropertyName';
45-
export * from './unions/Statement';
46-
export * from './unions/Token';
47-
export * from './unions/TSUnaryExpression';
48-
export * from './unions/TypeElement';
49-
export * from './unions/TypeNode';
3+
export type * from './base/Accessibility';
4+
export type * from './base/BaseNode'; // this is exported so that the `types` package can merge the decl and add the `parent` property
5+
export type * from './base/NodeOrTokenData';
6+
export type * from './base/OptionalRangeAndLoc';
7+
export type * from './base/Position';
8+
export type * from './base/Range';
9+
export type * from './base/SourceLocation';
10+
export type * from './declaration/spec';
11+
export type * from './element/spec';
12+
export type * from './expression/spec';
13+
export type * from './jsx/spec';
14+
export type * from './parameter/spec';
15+
export type * from './special/spec';
16+
export type * from './statement/spec';
17+
export type * from './token/spec';
18+
export type * from './type/spec';
19+
export type * from './unions/BindingName';
20+
export type * from './unions/BindingPattern';
21+
export type * from './unions/CallExpressionArgument';
22+
export type * from './unions/ChainElement';
23+
export type * from './unions/ClassElement';
24+
export type * from './unions/Comment';
25+
export type * from './unions/DeclarationStatement';
26+
export type * from './unions/DestructuringPattern';
27+
export type * from './unions/EntityName';
28+
export type * from './unions/ExportDeclaration';
29+
export type * from './unions/Expression';
30+
export type * from './unions/ForInitialiser';
31+
export type * from './unions/FunctionLike';
32+
export type * from './unions/ImportClause';
33+
export type * from './unions/IterationStatement';
34+
export type * from './unions/JSXChild';
35+
export type * from './unions/JSXExpression';
36+
export type * from './unions/JSXTagNameExpression';
37+
export type * from './unions/LeftHandSideExpression';
38+
export type * from './unions/Literal';
39+
export type * from './unions/LiteralExpression';
40+
export type * from './unions/Node';
41+
export type * from './unions/ObjectLiteralElement';
42+
export type * from './unions/Parameter';
43+
export type * from './unions/PrimaryExpression';
44+
export type * from './unions/PropertyName';
45+
export type * from './unions/Statement';
46+
export type * from './unions/Token';
47+
export type * from './unions/TSUnaryExpression';
48+
export type * from './unions/TypeElement';
49+
export type * from './unions/TypeNode';

packages/ast-spec/src/jsx/spec.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
export * from './JSXAttribute/spec';
2-
export * from './JSXClosingElement/spec';
3-
export * from './JSXClosingFragment/spec';
4-
export * from './JSXEmptyExpression/spec';
5-
export * from './JSXExpressionContainer/spec';
6-
export * from './JSXIdentifier/spec';
7-
export * from './JSXMemberExpression/spec';
8-
export * from './JSXNamespacedName/spec';
9-
export * from './JSXOpeningElement/spec';
10-
export * from './JSXOpeningFragment/spec';
11-
export * from './JSXSpreadAttribute/spec';
12-
export * from './JSXSpreadChild/spec';
13-
export * from './JSXText/spec';
1+
export type * from './JSXAttribute/spec';
2+
export type * from './JSXClosingElement/spec';
3+
export type * from './JSXClosingFragment/spec';
4+
export type * from './JSXEmptyExpression/spec';
5+
export type * from './JSXExpressionContainer/spec';
6+
export type * from './JSXIdentifier/spec';
7+
export type * from './JSXMemberExpression/spec';
8+
export type * from './JSXNamespacedName/spec';
9+
export type * from './JSXOpeningElement/spec';
10+
export type * from './JSXOpeningFragment/spec';
11+
export type * from './JSXSpreadAttribute/spec';
12+
export type * from './JSXSpreadChild/spec';
13+
export type * from './JSXText/spec';
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export * from './ArrayPattern/spec';
2-
export * from './AssignmentPattern/spec';
3-
export * from './ObjectPattern/spec';
4-
export * from './RestElement/spec';
5-
export * from './TSParameterProperty/spec';
1+
export type * from './ArrayPattern/spec';
2+
export type * from './AssignmentPattern/spec';
3+
export type * from './ObjectPattern/spec';
4+
export type * from './RestElement/spec';
5+
export type * from './TSParameterProperty/spec';

packages/ast-spec/src/special/spec.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
export * from './CatchClause/spec';
2-
export * from './ClassBody/spec';
3-
export * from './Decorator/spec';
4-
export * from './EmptyStatement/spec';
5-
export * from './ExportSpecifier/spec';
6-
export * from './ImportAttribute/spec';
7-
export * from './ImportDefaultSpecifier/spec';
8-
export * from './ImportNamespaceSpecifier/spec';
9-
export * from './ImportSpecifier/spec';
10-
export * from './PrivateIdentifier/spec';
11-
export * from './Program/spec';
12-
export * from './SwitchCase/spec';
13-
export * from './TemplateElement/spec';
14-
export * from './TSClassImplements/spec';
15-
export * from './TSEnumBody/spec';
16-
export * from './TSExternalModuleReference/spec';
17-
export * from './TSInterfaceBody/spec';
18-
export * from './TSInterfaceHeritage/spec';
19-
export * from './TSModuleBlock/spec';
20-
export * from './TSTypeAnnotation/spec';
21-
export * from './TSTypeParameter/spec';
22-
export * from './TSTypeParameterDeclaration/spec';
23-
export * from './TSTypeParameterInstantiation/spec';
24-
export * from './VariableDeclarator/spec';
1+
export type * from './CatchClause/spec';
2+
export type * from './ClassBody/spec';
3+
export type * from './Decorator/spec';
4+
export type * from './EmptyStatement/spec';
5+
export type * from './ExportSpecifier/spec';
6+
export type * from './ImportAttribute/spec';
7+
export type * from './ImportDefaultSpecifier/spec';
8+
export type * from './ImportNamespaceSpecifier/spec';
9+
export type * from './ImportSpecifier/spec';
10+
export type * from './PrivateIdentifier/spec';
11+
export type * from './Program/spec';
12+
export type * from './SwitchCase/spec';
13+
export type * from './TemplateElement/spec';
14+
export type * from './TSClassImplements/spec';
15+
export type * from './TSEnumBody/spec';
16+
export type * from './TSExternalModuleReference/spec';
17+
export type * from './TSInterfaceBody/spec';
18+
export type * from './TSInterfaceHeritage/spec';
19+
export type * from './TSModuleBlock/spec';
20+
export type * from './TSTypeAnnotation/spec';
21+
export type * from './TSTypeParameter/spec';
22+
export type * from './TSTypeParameterDeclaration/spec';
23+
export type * from './TSTypeParameterInstantiation/spec';
24+
export type * from './VariableDeclarator/spec';

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy