Skip to content

Commit a610e85

Browse files
bmiddhaCopilot
andauthored
Target ES2022 for Node.js packages (#5931)
* build!: target ES2022 for Node packages Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14 * fix: handle ES2022 compiler semantics Keep Webpack 4 fixtures on ES2019 because its parser cannot consume nullish coalescing emitted by ES2022 targets. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14 * fix: declare inherited scenario property Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8ebd5bf2-c44b-42d5-be25-e7936d4b0a14
1 parent 6b71db8 commit a610e85

31 files changed

Lines changed: 129 additions & 58 deletions

File tree

apps/api-documenter/src/plugin/MarkdownDocumenterFeature.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const uuidMarkdownDocumenterFeature: string = '34196154-9eb3-4de0-a8c8-7e9539dfe
7575
*/
7676
export class MarkdownDocumenterFeature extends PluginFeature {
7777
/** {@inheritdoc PluginFeature.context} */
78-
public override context!: MarkdownDocumenterFeatureContext;
78+
public declare context: MarkdownDocumenterFeatureContext;
7979

8080
/**
8181
* This event occurs before each markdown file is written. It provides an opportunity to customize the

build-tests/api-documenter-scenarios/src/inheritedMembers/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class Class2<T> extends Namespace1.Class3 {
4848
export class Class1 extends Class2<number> {
4949
/** A second prop. Overrides `Class2.secondProp`. */
5050
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility
51-
override secondProp: boolean;
51+
declare secondProp: boolean;
5252

5353
/** A fourth prop */
5454
// eslint-disable-next-line @typescript-eslint/explicit-member-accessibility

build-tests/localization-plugin-test-01/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json",
33
"compilerOptions": {
4+
"target": "ES2019",
45
"moduleResolution": "node",
56
"rootDirs": ["src", "temp/loc-json-ts"]
67
}

build-tests/localization-plugin-test-02/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json",
33
"compilerOptions": {
4+
"target": "ES2019",
45
"moduleResolution": "node",
56
"rootDirs": ["src", "temp/loc-json-ts"]
67
}

build-tests/localization-plugin-test-03/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "./node_modules/local-node-rig/profiles/default/tsconfig-base.json",
33
"compilerOptions": {
4+
"target": "ES2019",
45
"module": "esnext",
56
"outDir": "lib-esm",
67
"declarationDir": "lib-dts",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "Update class field declarations for ES2022 emit semantics.",
6+
"type": "none"
7+
}
8+
]
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-plugin",
5+
"comment": "Compile package output for ES2022.",
6+
"type": "patch"
7+
}
8+
]
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-jest-plugin",
5+
"comment": "Compile package output for ES2022.",
6+
"type": "patch"
7+
}
8+
]
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/heft-typescript-plugin",
5+
"comment": "Use ES2022 library definitions during TypeScript compilation.",
6+
"type": "patch"
7+
}
8+
]
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/localization-utilities",
5+
"comment": "Compile package output for ES2022.",
6+
"type": "patch"
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)