mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 02:15:10 -05:00
Error if --checkJs is used without --allowJs
This commit is contained in:
@@ -1685,6 +1685,10 @@ namespace ts {
|
||||
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration"));
|
||||
}
|
||||
|
||||
if (options.checkJs && !options.allowJs) {
|
||||
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "checkJs", "allowJs"));
|
||||
}
|
||||
|
||||
if (options.emitDecoratorMetadata &&
|
||||
!options.experimentalDecorators) {
|
||||
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators"));
|
||||
|
||||
9
tests/baselines/reference/checkJsFiles6.errors.txt
Normal file
9
tests/baselines/reference/checkJsFiles6.errors.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
error TS5052: Option 'checkJs' cannot be specified without specifying option 'allowJs'.
|
||||
error TS6054: File 'tests/cases/compiler/a.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'.
|
||||
|
||||
|
||||
!!! error TS5052: Option 'checkJs' cannot be specified without specifying option 'allowJs'.
|
||||
!!! error TS6054: File 'tests/cases/compiler/a.js' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'.
|
||||
==== tests/cases/compiler/a.js (0 errors) ====
|
||||
|
||||
var x;
|
||||
6
tests/cases/compiler/checkJsFiles6.ts
Normal file
6
tests/cases/compiler/checkJsFiles6.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
// @allowJs: false
|
||||
// @checkJs: true
|
||||
// @noEmit: true
|
||||
|
||||
// @fileName: a.js
|
||||
var x;
|
||||
Reference in New Issue
Block a user