Skip to content

Update eslint-doc-generator to 0.17 #1943

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 1 commit into from
Oct 31, 2022
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
2 changes: 1 addition & 1 deletion docs/rules/better-regex.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Note: This rule uses [`regexp-tree`](https://github.com/DmitrySoshnikov/regexp-tree) and [`clean-regexp`](https://github.com/samverschueren/clean-regexp) under the hood.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/catch-error-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Applies to
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/consistent-destructuring.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Enforces the use of already destructured objects and their variables over accessing each property individually. Previous destructurings are easily missed which leads to an inconsistent code style.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/consistent-function-scoping.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

A function definition should be placed as close to the top-level scope as possible without breaking its captured values. This improves readability, [directly improves performance](https://stackoverflow.com/a/81329/207247) and allows JavaScript engines to [better optimize performance](https://ponyfoo.com/articles/javascript-performance-pitfalls-v8#optimization-limit).
Expand Down
4 changes: 3 additions & 1 deletion docs/rules/custom-error-definition.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Enforce correct `Error` subclassing

✅ This rule is _disabled_ in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Enforces the only valid way of `Error` subclassing. It works with any super class that ends in `Error`.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/empty-brace-spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

## Fail
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/error-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

This rule enforces a `message` value to be passed in when creating an instance of a built-in [`Error`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, which leads to more readable and debuggable code.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/escape-case.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Enforces defining escape sequence values with uppercase characters rather than lowercase ones. This promotes readability by making the escaped value more distinguishable from the identifier.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/expiring-todo-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

This rule makes it possible to pass arguments to TODO, FIXME and XXX comments to trigger ESLint to report.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/explicit-length-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Enforce explicitly checking the length of an object and enforce the comparison style.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/filename-case.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Enforces all linted files to have their names in a certain case style and lowercase file extension. The default is `kebabCase`.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/import-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Sometimes a module contains unrelated functions, like `util`, thus it is a good practice to enforce destructuring or named imports here. Other times, in modules like `path`, it is good to use default import as they have similar functions, all likely to be utilized.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/new-for-builtins.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

They work the same, but `new` should be preferred for consistency with other constructors.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-abusive-eslint-disable.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

This rule makes you specify the rules you want to disable when using `eslint-disable`, `eslint-disable-line` or `eslint-disable-next-line` comments.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-array-callback-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

💡 This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Suppose you have a `unicorn` module:
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-array-for-each.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Benefits of [`for…of` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) over the `forEach` method can include:
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-array-method-this-argument.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

The rule disallows using the `thisArg` argument in array methods:
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-array-push-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

[`Array#push()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push) accepts multiple arguments. Multiple calls should be combined into one.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-array-reduce.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

`Array#reduce()` and `Array#reduceRight()` usually result in [hard-to-read](https://twitter.com/jaffathecake/status/1213077702300852224) and [less performant](https://www.richsnapp.com/article/2019/06-09-reduce-spread-anti-pattern) code. In almost every case, it can be replaced by `.map`, `.filter`, or a `for-of` loop.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-await-expression-member.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

When accessing a member from an await expression, the await expression has to be parenthesized, which is not readable.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-console-spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

The [`console.log()` method](https://developer.mozilla.org/en-US/docs/Web/API/Console/log) and similar methods joins the parameters with a space, so adding a leading/trailing space to a parameter, results in two spaces being added.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-document-cookie.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

It's not recommended to use [`document.cookie`](https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie) directly as it's easy to get the string wrong. Instead, you should use the [Cookie Store API](https://developer.mozilla.org/en-US/docs/Web/API/Cookie_Store_API) or a [cookie library](https://www.npmjs.com/search?q=cookie).
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-empty-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Meaningless files clutter a codebase.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-for-loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

There's no reason to use old school for loops anymore for the common case. You can instead use for-of loop (with `.entries()` if you need to access the index).
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-hex-escape.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Enforces a convention of using [Unicode escapes](https://mathiasbynens.be/notes/javascript-escapes#unicode) instead of [hexadecimal escapes](https://mathiasbynens.be/notes/javascript-escapes#hexadecimal) for consistency and clarity.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-instanceof-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

The `instanceof Array` check doesn't work across realms/contexts, for example, frames/windows in browsers or the `vm` module in Node.js.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-invalid-remove-event-listener.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

The [`removeEventListener`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener) function must be called with a reference to the same function that was passed to [`addEventListener`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener). Calling `removeEventListener` with an inline function or the result of an inline `.bind()` call is indicative of an error, and won't actually remove the listener.
Expand Down
4 changes: 3 additions & 1 deletion docs/rules/no-keyword-prefix.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Disallow identifiers starting with `new` or `class`

<!-- end rule header -->
✅ This rule is _disabled_ in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

`new Foo` and `newFoo` look very similar. Use alternatives that do not look like keyword usage.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-lonely-if.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

This rule adds onto the built-in [`no-lonely-if`](https://eslint.org/docs/rules/no-lonely-if) rule, which only disallows `if` statements in `else`, not in `if`. It is recommended to use `unicorn/no-lonely-if` together with the core ESLint `no-lonely-if` rule.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-nested-ternary.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Improved version of the [`no-nested-ternary`](https://eslint.org/docs/rules/no-nested-ternary) ESLint rule, which allows cases where the nested ternary is only one level and wrapped in parens.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-new-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

The ESLint built-in rule [`no-array-constructor`](https://eslint.org/docs/rules/no-array-constructor) enforces using an array literal instead of the `Array` constructor, but it still allows using the `Array` constructor with **one** argument. This rule fills that gap.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-new-buffer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Enforces the use of [Buffer.from](https://nodejs.org/api/buffer.html#static-method-bufferfromarray) and [Buffer.alloc()](https://nodejs.org/api/buffer.html#static-method-bufferallocsize-fill-encoding) instead of [new Buffer()](https://nodejs.org/api/buffer.html#new-bufferarray), which has been deprecated since Node.js 4.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-null.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧💡 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Disallow the use of the `null` literal, to encourage using `undefined` instead.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-object-as-default-parameter.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

Default parameters should not be passed to a function through an object literal. The `foo = {a: false}` parameter works fine if only used with one option. As soon as additional options are added, you risk replacing the whole `foo = {a: false, b: true}` object when passing only one option: `{a: true}`. For this reason, object destructuring should be used instead.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-process-exit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

This rule is an extension to ESLint's [`no-process-exit` rule](https://eslint.org/docs/rules/no-process-exit), that allows `process.exit()` to be called in files that start with a [hashbang](https://en.wikipedia.org/wiki/Shebang_(Unix)) → `#!/usr/bin/env node`. It also allows `process.exit()` to be called in `process.on('<event>', func)` event handlers and in files that imports `worker_threads`.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-static-only-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

A class with only static members could just be an object instead.
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-thenable.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

If an object is defined as "thenable", once it's accidentally used in an await expression, it may cause problems:
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-this-assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

✅ This rule is enabled in the `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#preset-configs).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

`this` should be used directly. If you want a reference to `this` from a higher scope, consider using [arrow function expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) or [`Function#bind()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind).
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-unnecessary-await.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end rule header -->
<!-- end auto-generated rule header -->
<!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` -->

The [`await` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await) should only be used on [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) values.
Expand Down
Loading