Skip to content

Commit 6427921

Browse files
authored
fix: disable experimental decorator flag (#1828)
The `experimentalDecorators` flag is legacy from TypeScript 3.9. Since then, decorators have gone through a large change and their new syntax, which is enabled by default in TypeScript 5+, looks very different. Keeping this old flag enabled locks users into old decorator typings which are deprecated, plus because of the way our defaults are applied these flags are not overridable. Instead, don't set `experimentalDecorators` at all, and have users opt in to legacy syntax if they must. This is technically breaking, but I'm pretty sure this will affect such a negligible fraction of users that I think it's worth it. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
1 parent 3fcfdeb commit 6427921

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

src/tsconfig/compiler-options.ts

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import * as Case from '../case';
44
export const BASE_COMPILER_OPTIONS: ts.CompilerOptions = {
55
alwaysStrict: true,
66
declaration: true,
7-
experimentalDecorators: true,
87
incremental: true,
98
lib: ['lib.es2020.d.ts'],
109
module: ts.ModuleKind.CommonJS,

test/compiler.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ function expectedTypeScriptConfig() {
484484
alwaysStrict: true,
485485
composite: false,
486486
declaration: true,
487-
experimentalDecorators: true,
488487
incremental: true,
489488
inlineSourceMap: true,
490489
inlineSources: true,

0 commit comments

Comments
 (0)