Skip to content

Commit 5370d7e

Browse files
authored
docs: clarify one-var separateRequires matches any require() call (#21192)
* fix: account for shadowed `require` in `one-var` * apply suggestions * fix ci * docs: clarify `one-var` `separateRequires` matches any `require()` call
1 parent 93de066 commit 5370d7e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎docs/src/rules/one-var.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,8 @@ async function foo() {
451451

452452
:::
453453

454+
The `separateRequires` option applies to any variable whose initializer is a `require()` call. It does not check whether `require` refers to the CommonJS global or to a local binding with the same name, such as a function parameter.
455+
454456
Examples of **incorrect** code for this rule with the `{ separateRequires: true }` option:
455457

456458
::: incorrect

0 commit comments

Comments
 (0)