Skip to content

Commit 3c97b34

Browse files
authored
Forbid export * from '...' syntax in local projects. (microsoft#5513)
* Introduce a rule that forbids 'export * from ...' syntax in local projects. * Fix exports.
1 parent 3e35f5a commit 3c97b34

18 files changed

Lines changed: 160 additions & 34 deletions

File tree

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
export * from './IAppContext';
5-
export * from './IJsonLfxGraph';
6-
export * from './IJsonLfxWorkspace';
7-
export * from './LfxGraph';
4+
export type { IAppContext } from './IAppContext';
5+
export {
6+
LfxGraphEntryKind,
7+
LfxDependencyKind,
8+
type IJsonPeerDependencyMeta,
9+
type IJsonLfxDependency,
10+
type IJsonLfxEntry,
11+
type IJsonLfxGraph
12+
} from './IJsonLfxGraph';
13+
export type { IJsonLfxWorkspaceRushConfig, IJsonLfxWorkspace } from './IJsonLfxWorkspace';
14+
export {
15+
LfxGraph,
16+
LfxGraphDependency,
17+
LfxGraphEntry,
18+
type ILfxGraphDependencyOptions,
19+
type ILfxGraphEntryOptions
20+
} from './LfxGraph';
821
export * as lfxGraphSerializer from './lfxGraphSerializer';

apps/rush-mcp-server/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @packageDocumentation
77
*/
88

9-
export * from './pluginFramework/IRushMcpPlugin';
10-
export * from './pluginFramework/IRushMcpTool';
9+
export { type IRushMcpPlugin, type RushMcpPluginFactory } from './pluginFramework/IRushMcpPlugin';
10+
export type { IRushMcpTool } from './pluginFramework/IRushMcpTool';
1111
export { type IRegisterToolOptions, RushMcpPluginSession } from './pluginFramework/RushMcpPluginSession';
12-
export * from './pluginFramework/zodTypes';
12+
export { CallToolResultSchema, type CallToolResult, type zodModule } from './pluginFramework/zodTypes';
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4-
export * from './base.tool';
5-
export * from './migrate-project.tool';
6-
export * from './project-details.tool';
7-
export * from './rush-command-validator.tool';
8-
export * from './workspace-details';
9-
export * from './conflict-resolver.tool';
4+
export { BaseTool, type IBaseToolOptions, type CallToolResult } from './base.tool';
5+
export { RushMigrateProjectTool } from './migrate-project.tool';
6+
export { RushProjectDetailsTool } from './project-details.tool';
7+
export { RushCommandValidatorTool } from './rush-command-validator.tool';
8+
export { RushWorkspaceDetailsTool } from './workspace-details';
9+
export { RushConflictResolverTool } from './conflict-resolver.tool';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.
33

4+
// eslint-disable-next-line no-restricted-syntax
45
export * from './ToggleSwitch';

build-tests/api-documenter-test/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
* @packageDocumentation
1111
*/
1212

13+
// eslint-disable-next-line no-restricted-syntax
1314
export * from './DocClass1';
15+
// eslint-disable-next-line no-restricted-syntax
1416
export * from './DocEnums';
1517
import type { IDocInterface1, IDocInterface3, SystemEvent } from './DocClass1';
1618

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"type": "none",
6+
"packageName": "@rushstack/mcp-server"
7+
}
8+
],
9+
"packageName": "@rushstack/mcp-server",
10+
"email": "iclanton@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"type": "none",
6+
"packageName": "@rushstack/stream-collator"
7+
}
8+
],
9+
"packageName": "@rushstack/stream-collator",
10+
"email": "iclanton@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"type": "none",
6+
"packageName": "@rushstack/tree-pattern"
7+
}
8+
],
9+
"packageName": "@rushstack/tree-pattern",
10+
"email": "iclanton@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"type": "none",
6+
"packageName": "@rushstack/webpack-embedded-dependencies-plugin"
7+
}
8+
],
9+
"packageName": "@rushstack/webpack-embedded-dependencies-plugin",
10+
"email": "iclanton@users.noreply.github.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "",
5+
"type": "none",
6+
"packageName": "@rushstack/webpack4-module-minifier-plugin"
7+
}
8+
],
9+
"packageName": "@rushstack/webpack4-module-minifier-plugin",
10+
"email": "iclanton@users.noreply.github.com"
11+
}

0 commit comments

Comments
 (0)