mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
fix(cli): allow for specifying noErrorTruncation
compiler option (#17127)
Fixes https://github.com/denoland/deno/issues/16568
This commit is contained in:
parent
54d40e008a
commit
199144daf0
6 changed files with 41 additions and 1 deletions
|
@ -130,7 +130,6 @@ pub const IGNORED_COMPILER_OPTIONS: &[&str] = &[
|
|||
"noEmit",
|
||||
"noEmitHelpers",
|
||||
"noEmitOnError",
|
||||
"noErrorTruncation",
|
||||
"noLib",
|
||||
"noResolve",
|
||||
"out",
|
||||
|
|
|
@ -87,6 +87,12 @@
|
|||
},
|
||||
"markdownDescription": "Specify a set of bundled library declaration files that describe the target runtime environment.\n\nSee more: https://www.typescriptlang.org/tsconfig#lib"
|
||||
},
|
||||
"noErrorTruncation": {
|
||||
"description": "Do not truncate error messages.",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"markdownDescription": "Do not truncate error messages.\n\nSee more: https://www.typescriptlang.org/tsconfig#noErrorTruncation"
|
||||
},
|
||||
"noFallthroughCasesInSwitch": {
|
||||
"description": "Enable error reporting for fallthrough cases in switch statements.",
|
||||
"type": "boolean",
|
||||
|
|
|
@ -68,6 +68,13 @@ mod check {
|
|||
exit_code: 0,
|
||||
});
|
||||
|
||||
itest!(check_no_error_truncation {
|
||||
args: "check --quiet check/no_error_truncation/main.ts --config check/no_error_truncation/deno.json",
|
||||
output: "check/no_error_truncation/main.out",
|
||||
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
||||
exit_code: 1,
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn cache_switching_config_then_no_config() {
|
||||
let deno_dir = util::new_deno_dir();
|
||||
|
|
5
cli/tests/testdata/check/no_error_truncation/deno.json
vendored
Normal file
5
cli/tests/testdata/check/no_error_truncation/deno.json
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"noErrorTruncation": true
|
||||
}
|
||||
}
|
11
cli/tests/testdata/check/no_error_truncation/main.out
vendored
Normal file
11
cli/tests/testdata/check/no_error_truncation/main.out
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
error: TS2322 [ERROR]: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propertyWithAnExceedinglyLongName3: string; propertyWithAnExceedinglyLongName4: string; propertyWithAnExceedinglyLongName5: string; propertyWithAnExceedinglyLongName6: string; propertyWithAnExceedinglyLongName7: string; propertyWithAnExceedinglyLongName8: string; }' is not assignable to type 'string'.
|
||||
const _s: string = x;
|
||||
~~
|
||||
at file:///[WILDCARD]/no_error_truncation/main.ts:12:7
|
||||
|
||||
TS2454 [ERROR]: Variable 'x' is used before being assigned.
|
||||
const _s: string = x;
|
||||
^
|
||||
at file:///[WILDCARD]/no_error_truncation/main.ts:12:20
|
||||
|
||||
Found 2 errors.
|
12
cli/tests/testdata/check/no_error_truncation/main.ts
vendored
Normal file
12
cli/tests/testdata/check/no_error_truncation/main.ts
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
let x: {
|
||||
propertyWithAnExceedinglyLongName1: string;
|
||||
propertyWithAnExceedinglyLongName2: string;
|
||||
propertyWithAnExceedinglyLongName3: string;
|
||||
propertyWithAnExceedinglyLongName4: string;
|
||||
propertyWithAnExceedinglyLongName5: string;
|
||||
propertyWithAnExceedinglyLongName6: string;
|
||||
propertyWithAnExceedinglyLongName7: string;
|
||||
propertyWithAnExceedinglyLongName8: string;
|
||||
};
|
||||
|
||||
const _s: string = x;
|
Loading…
Reference in a new issue