Skip to content

Commit 16ffa47

Browse files
authored
docs(eslint-plugin): missing info how to use sections, cjson -> jsonc (typescript-eslint#2578)
1 parent 39c45f3 commit 16ffa47

11 files changed

+43
-11
lines changed

packages/eslint-plugin/docs/rules/consistent-type-definitions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ This rule accepts one string option:
2525

2626
For example:
2727

28-
```CJSON
28+
```jsonc
2929
{
30-
// Use type for object definitions
31-
"@typescript-eslint/consistent-type-definitions": ["error", "type"]
30+
// Use type for object definitions
31+
"@typescript-eslint/consistent-type-definitions": ["error", "type"]
3232
}
3333
```
3434

packages/eslint-plugin/docs/rules/dot-notation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It adds support for optionally ignoring computed `private` member access.
77

88
## How to use
99

10-
```cjson
10+
```jsonc
1111
{
1212
// note you must disable the base rule as it can report incorrect errors
1313
"dot-notation": "off",

packages/eslint-plugin/docs/rules/init-declarations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It adds support for TypeScript's `declare` variables.
77

88
## How to use
99

10-
```cjson
10+
```jsonc
1111
{
1212
// note you must disable the base rule as it can report incorrect errors
1313
"init-declarations": "off",

packages/eslint-plugin/docs/rules/keyword-spacing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This version adds support for generic type parameters on function calls.
77

88
## How to use
99

10-
```cjson
10+
```jsonc
1111
{
1212
// note you must disable the base rule as it can report incorrect errors
1313
"keyword-spacing": "off",

packages/eslint-plugin/docs/rules/lines-between-class-members.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ See the [ESLint documentation](https://eslint.org/docs/rules/lines-between-class
1111

1212
## Rule Changes
1313

14-
```cjson
14+
```jsonc
1515
{
1616
// note you must disable the base rule as it can report incorrect errors
1717
"lines-between-class-members": "off",

packages/eslint-plugin/docs/rules/no-empty-function.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,16 @@ class Foo {
7575
}
7676
```
7777

78+
## How to use
79+
80+
```jsonc
81+
{
82+
// note you must disable the base rule as it can report incorrect errors
83+
"no-empty-function": "off",
84+
"@typescript-eslint/no-empty-function": ["error"]
85+
}
86+
```
87+
88+
---
89+
7890
<sup>Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-empty-function.md)</sup>

packages/eslint-plugin/docs/rules/no-implied-eval.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ class Foo {
8888
setTimeout(Foo.fn, 100);
8989
```
9090

91+
## How to use
92+
93+
```jsonc
94+
{
95+
// note you must disable the base rule as it can report incorrect errors
96+
"no-implied-eval": "off",
97+
"@typescript-eslint/no-implied-eval": ["error"]
98+
}
99+
```
100+
91101
## When Not To Use It
92102

93103
If you want to allow `new Function()` or `setTimeout()`, `setInterval()`, `setImmediate()` and `execScript()` with string arguments, then you can safely disable this rule.

packages/eslint-plugin/docs/rules/no-invalid-this.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It adds support for TypeScript's `this` parameters.
77

88
## How to use
99

10-
```cjson
10+
```jsonc
1111
{
1212
// note you must disable the base rule as it can report incorrect errors
1313
"no-invalid-this": "off",

packages/eslint-plugin/docs/rules/no-loop-func.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It adds support for TypeScript types.
77

88
## How to use
99

10-
```cjson
10+
```jsonc
1111
{
1212
// note you must disable the base rule as it can report incorrect errors
1313
"no-loop-func": "off",

packages/eslint-plugin/docs/rules/no-throw-literal.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ class CustomError extends Error {
7979
throw new CustomError();
8080
```
8181

82+
## How to use
83+
84+
```jsonc
85+
{
86+
// note you must disable the base rule as it can report incorrect errors
87+
"no-throw-literal": "off",
88+
"@typescript-eslint/no-throw-literal": ["error"]
89+
}
90+
```
91+
8292
---
8393

8494
<sup>Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-throw-literal.md)</sup>

packages/eslint-plugin/src/configs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The `eslint-recommended` ruleset is meant to be used after extending `eslint:rec
88

99
This config is automatically included if you use either the `recommended` or `recommended-requiring-type-checking` configs.
1010

11-
```cjson
11+
```jsonc
1212
{
1313
"extends": [
1414
"eslint:recommended",
@@ -40,7 +40,7 @@ We will not add new rules to the `recommended` set unless we release a major pac
4040

4141
If you disagree with a rule (or it disagrees with your codebase), consider using your local config to change the rule config so it works for your project.
4242

43-
```cjson
43+
```jsonc
4444
{
4545
"extends": ["plugin:@typescript-eslint/recommended"],
4646
"rules": {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy