Skip to content

Switch tsconfig settings for all packages in the repo#4101

Open
JasonVMo wants to merge 4 commits intomainfrom
user/jasonvmo/configs-part-1
Open

Switch tsconfig settings for all packages in the repo#4101
JasonVMo wants to merge 4 commits intomainfrom
user/jasonvmo/configs-part-1

Conversation

@JasonVMo
Copy link
Copy Markdown
Contributor

@JasonVMo JasonVMo commented May 7, 2026

Platforms Impacted

-- all

Description of changes

This change has two parts, the config level and package level.

At the config level:

  • add two new tsconfig.json files to scripts, a general one and a strict one
  • adds an exports map to scripts, and exposes those two files via the map
  • module/moduleResolution changed to "nodenext" this allows for requiring ESM which is supported in all versions of node we are using.
  • add erasableSyntaxOnly and noDefaultOverrides to the looser config

At the package level:

  • update tsconfig.json files to refer to the right source location
  • ensure we have a rootDir set if noEmit is not true. This is required to move forward with newer versions of tsgo/tsc.
  • standardize the outDir setting if it wasn't already set
  • ensure noEmit is declared at the package level when appropriate.

For packages the type errors fixed fall into several buckets:

  • add explicit overrides on class elements that are overridden.
  • get rid of const enums, generally replacing them with constant records. const enums are a typescript only thing.
  • get rid of some older forms to type assertions.

import { FluentTesterApp } from '@fluentui-react-native/tester-core';
AppRegistry.registerComponent('FluentTester', () => FluentTesterApp);
export default FluentTesterApp;
//# sourceMappingURL=index.js.map No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Comment thread apps/win32/src/index.js
const tester_core_1 = require("@fluentui-react-native/tester-core");
react_native_1.AppRegistry.registerComponent('FluentTester', () => tester_core_1.FluentTesterApp);
exports.default = tester_core_1.FluentTesterApp;
//# sourceMappingURL=index.js.map No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?

Comment on lines -70 to +75
export enum AndroidMenuStates {
Hidden,
Animating,
Shown,
}
export const AndroidMenuStates = {
Hidden: 0,
Animating: 1,
Shown: 2,
} as const;
export type AndroidMenuStates = (typeof AndroidMenuStates)[keyof typeof AndroidMenuStates];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably out of scope for this PR, but all of these would be better served as string unions right?

"compilerOptions": {
"outDir": "lib",
"lib": ["es2022", "dom"]
"lib": ["es2022", "dom"],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THis one is special?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants