From 6e350b2b7c7b027b31694875cdb423f494d1b423 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Wed, 20 Jul 2022 15:59:56 +0100 Subject: [PATCH] chore(cli): Ignore "experimentalDecorators" and "moduleDetection" options (#15202) --- cli/args/config_file.rs | 2 ++ cli/tests/integration/run_tests.rs | 3 +-- cli/tests/testdata/config.ts | 19 +++---------------- cli/tests/testdata/config.ts.out | 6 +----- cli/tests/testdata/config.tsconfig.json | 2 +- cli/tests/testdata/tsconfig.decorators.json | 5 ----- 6 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 cli/tests/testdata/tsconfig.decorators.json diff --git a/cli/args/config_file.rs b/cli/args/config_file.rs index 8e6b151a67..bead2a284e 100644 --- a/cli/args/config_file.rs +++ b/cli/args/config_file.rs @@ -105,6 +105,7 @@ pub const IGNORED_COMPILER_OPTIONS: &[&str] = &[ "emitBOM", "emitDeclarationOnly", "esModuleInterop", + "experimentalDecorators", "extendedDiagnostics", "forceConsistentCasingInFileNames", "generateCpuProfile", @@ -120,6 +121,7 @@ pub const IGNORED_COMPILER_OPTIONS: &[&str] = &[ "mapRoot", "maxNodeModuleJsDepth", "module", + "moduleDetection", "moduleResolution", "newLine", "noEmit", diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 6ed1d59648..96e4cfce50 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -659,7 +659,6 @@ itest!(async_error { itest!(config { args: "run --reload --config config.tsconfig.json --check config.ts", - exit_code: 1, output: "config.ts.out", }); @@ -1042,7 +1041,7 @@ itest!(ts_type_imports { }); itest!(ts_decorators { - args: "run --reload -c tsconfig.decorators.json --check ts_decorators.ts", + args: "run --reload --check ts_decorators.ts", output: "ts_decorators.ts.out", }); diff --git a/cli/tests/testdata/config.ts b/cli/tests/testdata/config.ts index cd7a1b33f7..51a61e447c 100644 --- a/cli/tests/testdata/config.ts +++ b/cli/tests/testdata/config.ts @@ -1,18 +1,5 @@ -// deno-lint-ignore-file - -function b() { - return function ( - _target: any, - _propertyKey: string, - _descriptor: PropertyDescriptor, - ) { - console.log("b"); - }; +function foo(bar) { + return bar; } -class A { - @b() - a() { - console.log("a"); - } -} +foo(1); diff --git a/cli/tests/testdata/config.ts.out b/cli/tests/testdata/config.ts.out index 76e357a736..44b123f976 100644 --- a/cli/tests/testdata/config.ts.out +++ b/cli/tests/testdata/config.ts.out @@ -1,8 +1,4 @@ [WILDCARD]Unsupported compiler options in "[WILDCARD]config.tsconfig.json". The following options were ignored: module, target -[WILDCARD] -error: TS1219 [ERROR]: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning. - a() { - ^ - at file:///[WILDCARD]/config.ts:[WILDCARD] +Check [WILDCARD]/config.ts diff --git a/cli/tests/testdata/config.tsconfig.json b/cli/tests/testdata/config.tsconfig.json index dcabb50a4a..0f08819203 100644 --- a/cli/tests/testdata/config.tsconfig.json +++ b/cli/tests/testdata/config.tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { - "experimentalDecorators": false, "module": "amd", + "strict": false, "target": "es5" } } diff --git a/cli/tests/testdata/tsconfig.decorators.json b/cli/tests/testdata/tsconfig.decorators.json deleted file mode 100644 index 504cd646e1..0000000000 --- a/cli/tests/testdata/tsconfig.decorators.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "experimentalDecorators": true - } -}