Skip to content

Commit 44b7912

Browse files
authored
Merge pull request #4747 from iclanton/stricter-types
Enable some stricter compiler options and eliminate remaining const enums.
2 parents 6d2cb95 + 84a779b commit 44b7912

File tree

82 files changed

+576
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+576
-244
lines changed

apps/api-documenter/src/documenters/YamlDocumenter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ interface IYamlReferences {
7373
uidTypeReferenceCounters: Map<string, number>;
7474
}
7575

76-
const enum FlattenMode {
76+
enum FlattenMode {
7777
/** Include entries for nested namespaces and non-namespace children. */
7878
NestedNamespacesAndChildren,
7979
/** Include entries for nested namespaces only. */

apps/api-documenter/src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
* @packageDocumentation
1010
*/
1111

12-
export { IFeatureDefinition, IApiDocumenterPluginManifest } from './plugin/IApiDocumenterPluginManifest';
12+
export type { IFeatureDefinition, IApiDocumenterPluginManifest } from './plugin/IApiDocumenterPluginManifest';
1313
export { MarkdownDocumenterAccessor } from './plugin/MarkdownDocumenterAccessor';
1414
export {
1515
MarkdownDocumenterFeatureContext,
16-
IMarkdownDocumenterFeatureOnBeforeWritePageArgs,
17-
IMarkdownDocumenterFeatureOnFinishedArgs,
16+
type IMarkdownDocumenterFeatureOnBeforeWritePageArgs,
17+
type IMarkdownDocumenterFeatureOnFinishedArgs,
1818
MarkdownDocumenterFeature
1919
} from './plugin/MarkdownDocumenterFeature';
2020
export { PluginFeature, PluginFeatureContext, PluginFeatureInitialization } from './plugin/PluginFeature';

apps/api-documenter/src/nodes/CustomDocNodeKind.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { DocTableRow } from './DocTableRow';
1212
/**
1313
* Identifies custom subclasses of {@link DocNode}.
1414
*/
15-
export const enum CustomDocNodeKind {
15+
export enum CustomDocNodeKind {
1616
EmphasisSpan = 'EmphasisSpan',
1717
Heading = 'Heading',
1818
NoteBox = 'NoteBox',

apps/api-extractor/src/index.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@
1111

1212
export { ConsoleMessageId } from './api/ConsoleMessageId';
1313

14-
export { CompilerState, ICompilerStateCreateOptions } from './api/CompilerState';
14+
export { CompilerState, type ICompilerStateCreateOptions } from './api/CompilerState';
1515

16-
export { Extractor, IExtractorInvokeOptions, ExtractorResult } from './api/Extractor';
16+
export { Extractor, type IExtractorInvokeOptions, ExtractorResult } from './api/Extractor';
1717

1818
export {
19-
IExtractorConfigApiReport,
20-
IExtractorConfigPrepareOptions,
21-
IExtractorConfigLoadForFolderOptions,
19+
type IExtractorConfigApiReport,
20+
type IExtractorConfigPrepareOptions,
21+
type IExtractorConfigLoadForFolderOptions,
2222
ExtractorConfig
2323
} from './api/ExtractorConfig';
2424

2525
export { ExtractorLogLevel } from './api/ExtractorLogLevel';
2626

2727
export {
2828
ExtractorMessage,
29-
IExtractorMessageProperties,
29+
type IExtractorMessageProperties,
3030
ExtractorMessageCategory
3131
} from './api/ExtractorMessage';
3232

3333
export { ExtractorMessageId } from './api/ExtractorMessageId';
3434

35-
export {
35+
export type {
3636
ApiReportVariant,
3737
IConfigCompiler,
3838
IConfigApiReport,

apps/api-extractor/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
33

44
"compilerOptions": {
5+
"isolatedModules": true,
56
"types": ["heft-jest", "node"],
67
"resolveJsonModule": true
78
}

apps/heft/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
33

44
"compilerOptions": {
5+
"isolatedModules": true,
56
"types": ["heft-jest", "node"],
67
"lib": ["ES2020"],
78
"resolveJsonModule": true

apps/rundown/src/LauncherTypes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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 const enum LauncherAction {
4+
export enum LauncherAction {
55
Snapshot = 'snapshot',
66
Inspect = 'inspect'
77
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
33
"compilerOptions": {
4+
"isolatedModules": true,
45
"types": ["heft-jest", "node"]
56
}
67
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +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-
export { default as renamed_Options } from './Options';
4+
export type { default as renamed_Options } from './Options';
55
export { default as Item } from './Item';
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 { default as SubOptions } from './SubOptions';
4+
export type { default as SubOptions } from './SubOptions';

build-tests/api-extractor-scenarios/tsconfig.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json",
33
"compilerOptions": {
44
"strictPropertyInitialization": false,
5-
"noImplicitAny": false
5+
"noImplicitAny": false,
6+
// Intentionally turn this off for this project to test a combination of `export` and `export type`
7+
// with type-only exports
8+
"isolatedModules": false
69
},
710
"include": ["src/**/*.ts", "typings/tsd.d.ts"]
811
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/api-documenter",
5+
"comment": "Include missing `type` modifiers on type-only exports.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/api-documenter"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/api-extractor-model",
5+
"comment": "Include missing `type` modifiers on type-only exports.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/api-extractor-model"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/api-extractor",
5+
"comment": "Include missing `type` modifiers on type-only exports.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@microsoft/api-extractor"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "Include missing `type` modifiers on type-only exports.",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/debug-certificate-manager",
5+
"comment": "Include missing `type` modifiers on type-only exports.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@rushstack/debug-certificate-manager"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-patch",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-patch"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-plugin-packlets",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-plugin-packlets"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-plugin-security",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-plugin-security"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-plugin"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-api-extractor-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/heft-api-extractor-plugin"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-config-file",
5+
"comment": "Include missing `type` modifiers on type-only exports.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@rushstack/heft-config-file"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-jest-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/heft-jest-plugin"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-lint-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/heft-lint-plugin"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-typescript-plugin",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/heft-typescript-plugin"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/heft"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/localization-utilities",
5+
"comment": "Include missing `type` modifiers on type-only exports.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@rushstack/localization-utilities"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/node-core-library",
5+
"comment": "Include missing `type` modifiers on type-only exports.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@rushstack/node-core-library"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/operation-graph",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/operation-graph"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/package-deps-hash",
5+
"comment": "Include missing `type` modifiers on type-only exports.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@rushstack/package-deps-hash"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rig-package",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/rig-package"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/rundown",
5+
"comment": "",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@rushstack/rundown"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/set-webpack-public-path-plugin",
5+
"comment": "Include missing `type` modifiers on type-only exports.",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@rushstack/set-webpack-public-path-plugin"
10+
}

0 commit comments

Comments
 (0)