diff --git a/docs/src/_includes/layouts/doc.html b/docs/src/_includes/layouts/doc.html index 4050a901063..58d8986a5dc 100644 --- a/docs/src/_includes/layouts/doc.html +++ b/docs/src/_includes/layouts/doc.html @@ -19,6 +19,22 @@ {% set added_version = rule_versions.added[title] %} {% set removed_version = rule_versions.removed[title] %} + {% if handled_by_typescript %} + {% set handled_by_typescript_content %} +

Handled by TypeScript

+

+ It is safe to disable this rule when using TypeScript because TypeScript's compiler enforces this check. +

+ {% if extra_typescript_info %} +

+ {{ extra_typescript_info | markdown | safe }} +

+ {% endif %} + {% endset %} + + {% set all_content = [all_content, handled_by_typescript_content] | join %} + {% endif %} + {% if related_rules %} {% set related_rules_content %} @@ -48,7 +64,7 @@

Further Reading

{% set all_content = [all_content, further_reading_content] | join %} {% endif %} - + {% if rule_meta %} {% set resources_content %}

Resources

@@ -76,7 +92,7 @@

{{ title }}

{% endif %} {% include 'components/docs-toc.html' %} - + {{ all_content | safe }} @@ -102,6 +118,7 @@

{{ title }}

{% include "partials/docs-footer.html" %} + diff --git a/docs/src/rules/constructor-super.md b/docs/src/rules/constructor-super.md index c172b0a7c27..7c19df77dba 100644 --- a/docs/src/rules/constructor-super.md +++ b/docs/src/rules/constructor-super.md @@ -1,6 +1,7 @@ --- title: constructor-super rule_type: problem +handled_by_typescript: true --- Constructors of derived classes must call `super()`. @@ -69,5 +70,3 @@ class A extends B { ## When Not To Use It If you don't want to be notified about invalid/missing `super()` callings in constructors, you can safely disable this rule. - -It is safe to disable this rule when using TypeScript because TypeScript's compiler enforces this check (`ts(2335) & ts(2377)`). diff --git a/docs/src/rules/getter-return.md b/docs/src/rules/getter-return.md index 0c8937d14cc..9d316303d02 100644 --- a/docs/src/rules/getter-return.md +++ b/docs/src/rules/getter-return.md @@ -1,6 +1,7 @@ --- title: getter-return rule_type: problem +handled_by_typescript: true further_reading: - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get - https://leanpub.com/understandinges6/read/#leanpub-auto-accessor-properties diff --git a/docs/src/rules/no-const-assign.md b/docs/src/rules/no-const-assign.md index f9f0ed172bb..ca62132a757 100644 --- a/docs/src/rules/no-const-assign.md +++ b/docs/src/rules/no-const-assign.md @@ -1,6 +1,7 @@ --- title: no-const-assign rule_type: problem +handled_by_typescript: true --- diff --git a/docs/src/rules/no-dupe-args.md b/docs/src/rules/no-dupe-args.md index 79f791c4666..3cb9133c83f 100644 --- a/docs/src/rules/no-dupe-args.md +++ b/docs/src/rules/no-dupe-args.md @@ -1,6 +1,7 @@ --- title: no-dupe-args rule_type: problem +handled_by_typescript: true --- diff --git a/docs/src/rules/no-dupe-class-members.md b/docs/src/rules/no-dupe-class-members.md index d50a7fe74e1..216f3c9fecd 100644 --- a/docs/src/rules/no-dupe-class-members.md +++ b/docs/src/rules/no-dupe-class-members.md @@ -1,6 +1,7 @@ --- title: no-dupe-class-members rule_type: problem +handled_by_typescript: true --- @@ -101,5 +102,3 @@ class Foo { This rule should not be used in ES3/5 environments. In ES2015 (ES6) or later, if you don't want to be notified about duplicate names in class members, you can safely disable this rule. - -It is safe to disable this rule when using TypeScript because TypeScript's compiler enforces this check (`ts(2300) & ts(2393)`). diff --git a/docs/src/rules/no-dupe-keys.md b/docs/src/rules/no-dupe-keys.md index 75fc9491fb6..1527bf8f1ec 100644 --- a/docs/src/rules/no-dupe-keys.md +++ b/docs/src/rules/no-dupe-keys.md @@ -1,6 +1,7 @@ --- title: no-dupe-keys rule_type: problem +handled_by_typescript: true --- diff --git a/docs/src/rules/no-func-assign.md b/docs/src/rules/no-func-assign.md index ffbcb46c6b8..a0f14620374 100644 --- a/docs/src/rules/no-func-assign.md +++ b/docs/src/rules/no-func-assign.md @@ -1,6 +1,7 @@ --- title: no-func-assign rule_type: problem +handled_by_typescript: true --- diff --git a/docs/src/rules/no-import-assign.md b/docs/src/rules/no-import-assign.md index ca4b912de81..b0a7432bb80 100644 --- a/docs/src/rules/no-import-assign.md +++ b/docs/src/rules/no-import-assign.md @@ -1,6 +1,8 @@ --- title: no-import-assign rule_type: problem +handled_by_typescript: true +extra_typescript_info: Note that the compiler will not catch the `Object.assign()` case. Thus, if you use `Object.assign()` in your codebase, this rule will still provide some value. --- diff --git a/docs/src/rules/no-invalid-this.md b/docs/src/rules/no-invalid-this.md index f3aa6ed763e..9e4a2aedffa 100644 --- a/docs/src/rules/no-invalid-this.md +++ b/docs/src/rules/no-invalid-this.md @@ -1,6 +1,8 @@ --- title: no-invalid-this rule_type: suggestion +handled_by_typescript: true +extra_typescript_info: Note that, technically, TypeScript will only catch this if you have the `strict` or `noImplicitThis` flags enabled. These are enabled in most TypeScript projects, since they are considered to be best practice. --- diff --git a/docs/src/rules/no-new-symbol.md b/docs/src/rules/no-new-symbol.md index 44c34a4eef0..d557811f30c 100644 --- a/docs/src/rules/no-new-symbol.md +++ b/docs/src/rules/no-new-symbol.md @@ -1,6 +1,7 @@ --- title: no-new-symbol rule_type: problem +handled_by_typescript: true further_reading: - https://www.ecma-international.org/ecma-262/6.0/#sec-symbol-objects --- diff --git a/docs/src/rules/no-obj-calls.md b/docs/src/rules/no-obj-calls.md index 8d72e4ce277..2fde92e5cbf 100644 --- a/docs/src/rules/no-obj-calls.md +++ b/docs/src/rules/no-obj-calls.md @@ -1,6 +1,7 @@ --- title: no-obj-calls rule_type: problem +handled_by_typescript: true further_reading: - https://es5.github.io/#x15.8 --- diff --git a/docs/src/rules/no-redeclare.md b/docs/src/rules/no-redeclare.md index e66f0570fc6..009ba889fcc 100644 --- a/docs/src/rules/no-redeclare.md +++ b/docs/src/rules/no-redeclare.md @@ -1,6 +1,8 @@ --- title: no-redeclare rule_type: suggestion +handled_by_typescript: true +extra_typescript_info: Note that while TypeScript will catch `let` redeclares and `const` redeclares, it will not catch `var` redeclares. Thus, if you use the legacy `var` keyword in your TypeScript codebase, this rule will still provide some value. related_rules: - no-shadow --- diff --git a/docs/src/rules/no-setter-return.md b/docs/src/rules/no-setter-return.md index ceb4558c15a..50353c754da 100644 --- a/docs/src/rules/no-setter-return.md +++ b/docs/src/rules/no-setter-return.md @@ -1,6 +1,7 @@ --- title: no-setter-return rule_type: problem +handled_by_typescript: true related_rules: - getter-return further_reading: diff --git a/docs/src/rules/no-this-before-super.md b/docs/src/rules/no-this-before-super.md index f1425b5ed35..c1a654796cb 100644 --- a/docs/src/rules/no-this-before-super.md +++ b/docs/src/rules/no-this-before-super.md @@ -1,6 +1,7 @@ --- title: no-this-before-super rule_type: problem +handled_by_typescript: true --- diff --git a/docs/src/rules/no-undef.md b/docs/src/rules/no-undef.md index 0bc7a28279f..72ea516f966 100644 --- a/docs/src/rules/no-undef.md +++ b/docs/src/rules/no-undef.md @@ -1,6 +1,7 @@ --- title: no-undef rule_type: problem +handled_by_typescript: true related_rules: - no-global-assign - no-redeclare diff --git a/docs/src/rules/no-unreachable.md b/docs/src/rules/no-unreachable.md index 4f762084b41..15f77f8173e 100644 --- a/docs/src/rules/no-unreachable.md +++ b/docs/src/rules/no-unreachable.md @@ -1,6 +1,7 @@ --- title: no-unreachable rule_type: problem +handled_by_typescript: true --- diff --git a/docs/src/rules/no-unsafe-negation.md b/docs/src/rules/no-unsafe-negation.md index 522e4ab4d1a..f3b49522316 100644 --- a/docs/src/rules/no-unsafe-negation.md +++ b/docs/src/rules/no-unsafe-negation.md @@ -1,6 +1,7 @@ --- title: no-unsafe-negation rule_type: problem +handled_by_typescript: true ---