Skip to content

docs(eslint-plugin): missing info how to use sections, cjson -> jsonc #2578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ This rule accepts one string option:

For example:

```CJSON
```jsonc
{
// Use type for object definitions
"@typescript-eslint/consistent-type-definitions": ["error", "type"]
// Use type for object definitions
"@typescript-eslint/consistent-type-definitions": ["error", "type"]
}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/dot-notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It adds support for optionally ignoring computed `private` member access.

## How to use

```cjson
```jsonc
{
// note you must disable the base rule as it can report incorrect errors
"dot-notation": "off",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/init-declarations.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It adds support for TypeScript's `declare` variables.

## How to use

```cjson
```jsonc
{
// note you must disable the base rule as it can report incorrect errors
"init-declarations": "off",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/keyword-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This version adds support for generic type parameters on function calls.

## How to use

```cjson
```jsonc
{
// note you must disable the base rule as it can report incorrect errors
"keyword-spacing": "off",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See the [ESLint documentation](https://eslint.org/docs/rules/lines-between-class

## Rule Changes

```cjson
```jsonc
{
// note you must disable the base rule as it can report incorrect errors
"lines-between-class-members": "off",
Expand Down
12 changes: 12 additions & 0 deletions packages/eslint-plugin/docs/rules/no-empty-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,16 @@ class Foo {
}
```

## How to use

```jsonc
{
// note you must disable the base rule as it can report incorrect errors
"no-empty-function": "off",
"@typescript-eslint/no-empty-function": ["error"]
}
```

---

<sup>Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-empty-function.md)</sup>
10 changes: 10 additions & 0 deletions packages/eslint-plugin/docs/rules/no-implied-eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ class Foo {
setTimeout(Foo.fn, 100);
```

## How to use

```jsonc
{
// note you must disable the base rule as it can report incorrect errors
"no-implied-eval": "off",
"@typescript-eslint/no-implied-eval": ["error"]
}
```

## When Not To Use It

If you want to allow `new Function()` or `setTimeout()`, `setInterval()`, `setImmediate()` and `execScript()` with string arguments, then you can safely disable this rule.
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-invalid-this.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It adds support for TypeScript's `this` parameters.

## How to use

```cjson
```jsonc
{
// note you must disable the base rule as it can report incorrect errors
"no-invalid-this": "off",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/docs/rules/no-loop-func.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It adds support for TypeScript types.

## How to use

```cjson
```jsonc
{
// note you must disable the base rule as it can report incorrect errors
"no-loop-func": "off",
Expand Down
10 changes: 10 additions & 0 deletions packages/eslint-plugin/docs/rules/no-throw-literal.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ class CustomError extends Error {
throw new CustomError();
```

## How to use

```jsonc
{
// note you must disable the base rule as it can report incorrect errors
"no-throw-literal": "off",
"@typescript-eslint/no-throw-literal": ["error"]
}
```

---

<sup>Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-throw-literal.md)</sup>
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/configs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `eslint-recommended` ruleset is meant to be used after extending `eslint:rec

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

```cjson
```jsonc
{
"extends": [
"eslint:recommended",
Expand Down Expand Up @@ -40,7 +40,7 @@ We will not add new rules to the `recommended` set unless we release a major pac

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.

```cjson
```jsonc
{
"extends": ["plugin:@typescript-eslint/recommended"],
"rules": {
Expand Down