Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add action for enabling experimentalDescorators option in user config… (
#30484) * add action for enabling experimentalDescorators option in user config file, change error message for this case #29035 * add missing changes in tests * Add "experimental decorators" tests for jsconfig file
- Loading branch information
1 parent
b8e3c41
commit 5b79b94
Showing
14 changed files
with
96 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/cases/fourslash/codefixEnableExperimentalDecorators_blankCompilerOptionsInJsconfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// @Filename: /dir/a.ts | ||
////declare const decorator: any; | ||
////class A { | ||
//// @decorator method() {}; | ||
////}; | ||
|
||
// @Filename: /dir/jsconfig.json | ||
////{ | ||
//// "compilerOptions": { | ||
//// } | ||
////} | ||
|
||
goTo.file("/dir/a.ts"); | ||
verify.codeFix({ | ||
description: "Enable the 'experimentalDecorators' option in your configuration file", | ||
newFileContent: { | ||
"/dir/jsconfig.json": | ||
`{ | ||
"compilerOptions": { | ||
"experimentalDecorators": true, | ||
} | ||
}`, | ||
}, | ||
}); |
File renamed without changes.
27 changes: 27 additions & 0 deletions
27
...ases/fourslash/codefixEnableExperimentalDecorators_disabledInCompilerOptionsInJsconfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// @Filename: /dir/a.ts | ||
////declare const decorator: any; | ||
////class A { | ||
//// @decorator method() {}; | ||
////}; | ||
|
||
// @Filename: /dir/jsconfig.json | ||
////{ | ||
//// "compilerOptions": { | ||
//// "experimentalDecorators": false, | ||
//// } | ||
////} | ||
|
||
goTo.file("/dir/a.ts"); | ||
verify.codeFix({ | ||
description: "Enable the 'experimentalDecorators' option in your configuration file", | ||
newFileContent: { | ||
"/dir/jsconfig.json": | ||
`{ | ||
"compilerOptions": { | ||
"experimentalDecorators": true, | ||
} | ||
}`, | ||
}, | ||
}); |
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
...s/cases/fourslash/codefixEnableExperimentalDecorators_missingCompilerOptionsInJsconfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// @Filename: /dir/a.ts | ||
////declare const decorator: any; | ||
////class A { | ||
//// @decorator method() {}; | ||
////}; | ||
|
||
// @Filename: /dir/jsconfig.json | ||
////{ | ||
////} | ||
|
||
goTo.file("/dir/a.ts"); | ||
verify.codeFix({ | ||
description: "Enable the 'experimentalDecorators' option in your configuration file", | ||
newFileContent: { | ||
"/dir/jsconfig.json": | ||
`{ | ||
"compilerOptions": { "experimentalDecorators": true }, | ||
}`, | ||
}, | ||
}); |
File renamed without changes.