Skip to content

Commit ffb0cea

Browse files
authored
chore(typescript): enable erasableSyntaxOnly for the whole repo; add temporary ts-expect-errors to enums (#7613)
* chore(typescript): enable erasableSyntaxOnly for the whole repo; add temporary ts-expect-errors to enums * chore: add ticket number to TODO
1 parent d1e1f8e commit ffb0cea

File tree

86 files changed

+230
-67
lines changed

Some content is hidden

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

86 files changed

+230
-67
lines changed

configs/testing-library-compass/src/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ export class MockDataService
127127
| 'instance'
128128
>
129129
{
130-
constructor(private connectionOptions: ConnectionInfo['connectionOptions']) {
130+
private connectionOptions: ConnectionInfo['connectionOptions'];
131+
constructor(connectionOptions: ConnectionInfo['connectionOptions']) {
131132
super();
133+
this.connectionOptions = connectionOptions;
132134
this.setMaxListeners(0);
133135
}
134136
getConnectionString() {

configs/tsconfig-compass/tsconfig.common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"removeComments": false,
55
"moduleResolution": "node16",
6-
"module": "node16"
6+
"module": "node16",
7+
"erasableSyntaxOnly": true
78
}
89
}

configs/tsconfig-compass/tsconfig.react.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"removeComments": false,
55
"moduleResolution": "node16",
6-
"module": "node16"
6+
"module": "node16",
7+
"erasableSyntaxOnly": true
78
}
89
}

packages/atlas-service/src/atlas-service.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,24 @@ function getAutomationAgentClusterId(
5353
}
5454

5555
export class AtlasService {
56+
private readonly authService: AtlasAuthService;
57+
private readonly preferences: PreferencesAccess;
58+
private readonly logger: Logger;
59+
private readonly options?: AtlasServiceOptions;
60+
private readonly defaultConfigOverride?: AtlasServiceConfig;
5661
constructor(
57-
private readonly authService: AtlasAuthService,
58-
private readonly preferences: PreferencesAccess,
59-
private readonly logger: Logger,
60-
private readonly options?: AtlasServiceOptions,
61-
private readonly defaultConfigOverride?: AtlasServiceConfig
62-
) {}
62+
authService: AtlasAuthService,
63+
preferences: PreferencesAccess,
64+
logger: Logger,
65+
options?: AtlasServiceOptions,
66+
defaultConfigOverride?: AtlasServiceConfig
67+
) {
68+
this.authService = authService;
69+
this.preferences = preferences;
70+
this.logger = logger;
71+
this.options = options;
72+
this.defaultConfigOverride = defaultConfigOverride;
73+
}
6374
// Config value is dynamic to make sure that process.env overrides are taken
6475
// into account in runtime
6576
get config(): AtlasServiceConfig {

packages/atlas-service/src/store/atlas-signin-reducer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export type AtlasSignInThunkAction<
3535
A extends AnyAction = AnyAction
3636
> = ThunkAction<R, AtlasSignInState, { atlasAuthService: AtlasAuthService }, A>;
3737

38+
// @ts-expect-error TODO(COMPASS-10124): replace enums with const kv objects
3839
export const enum AtlasSignInActions {
3940
RestoringStart = 'atlas-service/atlas-signin/StartRestoring',
4041
RestoringFailed = 'atlas-service/atlas-signin/RestoringFailed',

packages/compass-aggregations/src/modules/aggregation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const WriteOperation = {
4141
Overwrite: 'overwriting',
4242
} as const;
4343

44+
// @ts-expect-error TODO(COMPASS-10124): replace enums with const kv objects
4445
export enum ActionTypes {
4546
RunAggregation = 'compass-aggeregations/runAggregation',
4647
AggregationStarted = 'compass-aggregations/aggregationStarted',

packages/compass-aggregations/src/modules/auto-preview.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type { RestorePipelineAction } from './saved-pipeline';
77
import { RESTORE_PIPELINE } from './saved-pipeline';
88
import { isAction } from '../utils/is-action';
99

10+
// @ts-expect-error TODO(COMPASS-10124): replace enums with const kv objects
1011
export enum ActionTypes {
1112
AutoPreviewToggled = 'compass-aggregations/autoPreviewToggled',
1213
}

packages/compass-aggregations/src/modules/collection-stats.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function pickCollectionStats(collection: Collection): CollectionStats {
2020
};
2121
}
2222

23+
// @ts-expect-error TODO(COMPASS-10124): replace enums with const kv objects
2324
enum CollectionStatsActions {
2425
CollectionStatsFetched = 'compass-aggregations/collection-stats/CollectionStatsFetched',
2526
}

packages/compass-aggregations/src/modules/collections-fields.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type CollectionInfo = Pick<Collection, 'name' | 'type'>;
1212

1313
type CollectionType = CollectionInfo['type'];
1414

15+
// @ts-expect-error TODO(COMPASS-10124): replace enums with const kv objects
1516
export enum ActionTypes {
1617
CollectionsFetch = 'compass-aggregations/collectionsFetched',
1718
CollectionFieldsFetched = 'compass-aggregations/collectionFieldsFetched',

packages/compass-aggregations/src/modules/count-documents.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { ActionTypes as ConfirmNewPipelineActions } from './is-new-pipeline-conf
1010
import { getPipelineFromBuilderState } from './pipeline-builder/builder-helpers';
1111
import { isAction } from '../utils/is-action';
1212

13+
// @ts-expect-error TODO(COMPASS-10124): replace enums with const kv objects
1314
export enum ActionTypes {
1415
CountStarted = 'compass-aggregations/countStarted',
1516
CountFinished = 'compass-aggregations/countFinished',

0 commit comments

Comments
 (0)