mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
feat(check): turn on noImplicitOverride (#25695)
Closes https://github.com/denoland/deno/issues/11836 Ref https://github.com/denoland/deno/issues/25162
This commit is contained in:
parent
7533492a78
commit
48ea4e3c92
9 changed files with 25 additions and 6 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1375,9 +1375,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deno_config"
|
||||
version = "0.34.2"
|
||||
version = "0.34.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "764368ba1424ea74f9a28d8e2e7633f57d008e73f76b12bc272f6d5903ca1e08"
|
||||
checksum = "187d7dd888a49bfda396632371139e940c5cf47b15bfcaeeb2ba50f82f6940ec"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"deno_package_json",
|
||||
|
|
|
@ -65,7 +65,7 @@ winres.workspace = true
|
|||
[dependencies]
|
||||
deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] }
|
||||
deno_cache_dir = { workspace = true }
|
||||
deno_config = { version = "=0.34.2", features = ["workspace", "sync"] }
|
||||
deno_config = { version = "=0.34.3", features = ["workspace", "sync"] }
|
||||
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
|
||||
deno_doc = { version = "0.148.0", features = ["html", "syntect"] }
|
||||
deno_graph = { version = "=0.82.1" }
|
||||
|
|
|
@ -1129,6 +1129,7 @@ impl Default for LspTsConfig {
|
|||
"module": "esnext",
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"noImplicitOverride": true,
|
||||
"resolveJsonModule": true,
|
||||
"strict": true,
|
||||
"target": "esnext",
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
"noImplicitOverride": {
|
||||
"description": "Ensure overriding members in derived classes are marked with an override modifier.",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"default": true,
|
||||
"markdownDescription": "Ensure overriding members in derived classes are marked with an override modifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitOverride"
|
||||
},
|
||||
"noImplicitReturns": {
|
||||
|
|
|
@ -1154,6 +1154,7 @@ delete Object.prototype.__proto__;
|
|||
"moduleResolution": "NodeNext",
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"noImplicitOverride": true,
|
||||
"resolveJsonModule": true,
|
||||
"strict": true,
|
||||
"target": "esnext",
|
||||
|
|
5
tests/specs/check/no_implicit_override/__test__.jsonc
Normal file
5
tests/specs/check/no_implicit_override/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "check main.ts",
|
||||
"output": "main.out",
|
||||
"exitCode": 1
|
||||
}
|
5
tests/specs/check/no_implicit_override/main.out
Normal file
5
tests/specs/check/no_implicit_override/main.out
Normal file
|
@ -0,0 +1,5 @@
|
|||
Check file:///[WILDCARD]/main.ts
|
||||
error: TS4114 [ERROR]: This member must have an 'override' modifier because it overrides a member in the base class 'Greet'.
|
||||
greet() {}
|
||||
~~~~~
|
||||
at file:///[WILDCARD]/no_implicit_override/main.ts:6:3
|
7
tests/specs/check/no_implicit_override/main.ts
Normal file
7
tests/specs/check/no_implicit_override/main.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
class Greet {
|
||||
greet() {}
|
||||
}
|
||||
|
||||
class Welcome extends Greet {
|
||||
greet() {}
|
||||
}
|
|
@ -330,7 +330,7 @@ Deno.test(
|
|||
function urlSearchParamsOverridingAppendNotChangeConstructorAndSet() {
|
||||
let overriddenAppendCalled = 0;
|
||||
class CustomSearchParams extends URLSearchParams {
|
||||
append(name: string, value: string) {
|
||||
override append(name: string, value: string) {
|
||||
++overriddenAppendCalled;
|
||||
super.append(name, value);
|
||||
}
|
||||
|
@ -345,7 +345,7 @@ Deno.test(
|
|||
|
||||
Deno.test(function urlSearchParamsOverridingEntriesNotChangeForEach() {
|
||||
class CustomSearchParams extends URLSearchParams {
|
||||
*entries(): IterableIterator<[string, string]> {
|
||||
override *entries(): IterableIterator<[string, string]> {
|
||||
yield* [];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue