Skip to content

Commit

Permalink
Merge pull request #4747 from iclanton/stricter-types
Browse files Browse the repository at this point in the history
Enable some stricter compiler options and eliminate remaining const enums.
  • Loading branch information
iclanton committed May 29, 2024
2 parents 6d2cb95 + 84a779b commit 44b7912
Show file tree
Hide file tree
Showing 82 changed files with 576 additions and 244 deletions.
2 changes: 1 addition & 1 deletion apps/api-documenter/src/documenters/YamlDocumenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ interface IYamlReferences {
uidTypeReferenceCounters: Map<string, number>;
}

const enum FlattenMode {
enum FlattenMode {
/** Include entries for nested namespaces and non-namespace children. */
NestedNamespacesAndChildren,
/** Include entries for nested namespaces only. */
Expand Down
6 changes: 3 additions & 3 deletions apps/api-documenter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* @packageDocumentation
*/

export { IFeatureDefinition, IApiDocumenterPluginManifest } from './plugin/IApiDocumenterPluginManifest';
export type { IFeatureDefinition, IApiDocumenterPluginManifest } from './plugin/IApiDocumenterPluginManifest';
export { MarkdownDocumenterAccessor } from './plugin/MarkdownDocumenterAccessor';
export {
MarkdownDocumenterFeatureContext,
IMarkdownDocumenterFeatureOnBeforeWritePageArgs,
IMarkdownDocumenterFeatureOnFinishedArgs,
type IMarkdownDocumenterFeatureOnBeforeWritePageArgs,
type IMarkdownDocumenterFeatureOnFinishedArgs,
MarkdownDocumenterFeature
} from './plugin/MarkdownDocumenterFeature';
export { PluginFeature, PluginFeatureContext, PluginFeatureInitialization } from './plugin/PluginFeature';
2 changes: 1 addition & 1 deletion apps/api-documenter/src/nodes/CustomDocNodeKind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { DocTableRow } from './DocTableRow';
/**
* Identifies custom subclasses of {@link DocNode}.
*/
export const enum CustomDocNodeKind {
export enum CustomDocNodeKind {
EmphasisSpan = 'EmphasisSpan',
Heading = 'Heading',
NoteBox = 'NoteBox',
Expand Down
14 changes: 7 additions & 7 deletions apps/api-extractor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@

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

export { CompilerState, ICompilerStateCreateOptions } from './api/CompilerState';
export { CompilerState, type ICompilerStateCreateOptions } from './api/CompilerState';

export { Extractor, IExtractorInvokeOptions, ExtractorResult } from './api/Extractor';
export { Extractor, type IExtractorInvokeOptions, ExtractorResult } from './api/Extractor';

export {
IExtractorConfigApiReport,
IExtractorConfigPrepareOptions,
IExtractorConfigLoadForFolderOptions,
type IExtractorConfigApiReport,
type IExtractorConfigPrepareOptions,
type IExtractorConfigLoadForFolderOptions,
ExtractorConfig
} from './api/ExtractorConfig';

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

export {
ExtractorMessage,
IExtractorMessageProperties,
type IExtractorMessageProperties,
ExtractorMessageCategory
} from './api/ExtractorMessage';

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

export {
export type {
ApiReportVariant,
IConfigCompiler,
IConfigApiReport,
Expand Down
1 change: 1 addition & 0 deletions apps/api-extractor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",

"compilerOptions": {
"isolatedModules": true,
"types": ["heft-jest", "node"],
"resolveJsonModule": true
}
Expand Down
1 change: 1 addition & 0 deletions apps/heft/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",

"compilerOptions": {
"isolatedModules": true,
"types": ["heft-jest", "node"],
"lib": ["ES2020"],
"resolveJsonModule": true
Expand Down
2 changes: 1 addition & 1 deletion apps/rundown/src/LauncherTypes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

export const enum LauncherAction {
export enum LauncherAction {
Snapshot = 'snapshot',
Inspect = 'inspect'
}
Expand Down
1 change: 1 addition & 0 deletions build-tests-samples/heft-node-rig-tutorial/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./node_modules/@rushstack/heft-node-rig/profiles/default/tsconfig-base.json",
"compilerOptions": {
"isolatedModules": true,
"types": ["heft-jest", "node"]
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

export { default as renamed_Options } from './Options';
export type { default as renamed_Options } from './Options';
export { default as Item } from './Item';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

export { default as SubOptions } from './SubOptions';
export type { default as SubOptions } from './SubOptions';
5 changes: 4 additions & 1 deletion build-tests/api-extractor-scenarios/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json",
"compilerOptions": {
"strictPropertyInitialization": false,
"noImplicitAny": false
"noImplicitAny": false,
// Intentionally turn this off for this project to test a combination of `export` and `export type`
// with type-only exports
"isolatedModules": false
},
"include": ["src/**/*.ts", "typings/tsd.d.ts"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/api-documenter",
"comment": "Include missing `type` modifiers on type-only exports.",
"type": "patch"
}
],
"packageName": "@microsoft/api-documenter"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/api-extractor-model",
"comment": "Include missing `type` modifiers on type-only exports.",
"type": "patch"
}
],
"packageName": "@microsoft/api-extractor-model"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/api-extractor",
"comment": "Include missing `type` modifiers on type-only exports.",
"type": "patch"
}
],
"packageName": "@microsoft/api-extractor"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Include missing `type` modifiers on type-only exports.",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/debug-certificate-manager",
"comment": "Include missing `type` modifiers on type-only exports.",
"type": "patch"
}
],
"packageName": "@rushstack/debug-certificate-manager"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/eslint-patch",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/eslint-patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/eslint-plugin-packlets",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/eslint-plugin-packlets"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/eslint-plugin-security",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/eslint-plugin-security"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/eslint-plugin",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/eslint-plugin"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft-api-extractor-plugin",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/heft-api-extractor-plugin"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft-config-file",
"comment": "Include missing `type` modifiers on type-only exports.",
"type": "patch"
}
],
"packageName": "@rushstack/heft-config-file"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft-jest-plugin",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/heft-jest-plugin"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft-lint-plugin",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/heft-lint-plugin"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft-typescript-plugin",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/heft-typescript-plugin"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/heft"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/localization-utilities",
"comment": "Include missing `type` modifiers on type-only exports.",
"type": "patch"
}
],
"packageName": "@rushstack/localization-utilities"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/node-core-library",
"comment": "Include missing `type` modifiers on type-only exports.",
"type": "patch"
}
],
"packageName": "@rushstack/node-core-library"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/operation-graph",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/operation-graph"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/package-deps-hash",
"comment": "Include missing `type` modifiers on type-only exports.",
"type": "patch"
}
],
"packageName": "@rushstack/package-deps-hash"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/rig-package",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/rig-package"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/rundown",
"comment": "",
"type": "none"
}
],
"packageName": "@rushstack/rundown"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/set-webpack-public-path-plugin",
"comment": "Include missing `type` modifiers on type-only exports.",
"type": "patch"
}
],
"packageName": "@rushstack/set-webpack-public-path-plugin"
}
Loading

0 comments on commit 44b7912

Please sign in to comment.