Skip to content

Commit

Permalink
Change forbid wording everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Mar 31, 2022
1 parent 28e369c commit ea6f300
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/rules/explicit-length-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const isEmpty = 1 > foo.length;
```

```js
// Negative style is forbidden too
// Negative style is disallowed too
const isEmpty = !(foo.length > 0);
```

Expand Down Expand Up @@ -107,7 +107,7 @@ const isNotEmpty = Boolean(foo.length);
```

```js
// Negative style is forbidden too
// Negative style is disallowed too
const isNotEmpty = !(foo.length === 0);
```

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 @@ -7,7 +7,7 @@
🔧💡 *This rule is [auto-fixable](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) and provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).*
<!-- /RULE_NOTICE -->

The rule forbids using the `thisArg` argument in array methods:
The rule disallows using the `thisArg` argument in array methods:

- If the callback is an arrow function or a bound function, the `thisArg` won't affect it.
- If you intent to use a custom `this` in the callback, it's better to use the variable directly or use `callback.bind(thisArg)`.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-keyword-prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const fooNew = 'foo';

### `disallowedPrefixes`

If you want a custom list of forbidden prefixes you can set them with `disallowedPrefixes`:
If you want a custom list of disallowed prefixes you can set them with `disallowedPrefixes`:

```js
// eslint unicorn/no-keyword-prefix: ["error", {"disallowedPrefixes": ["new", "for"]}]
Expand Down Expand Up @@ -55,7 +55,7 @@ foo.newFoo = 2; // pass

### `onlyCamelCase`

The default behavior is to check for camel case usage. If you want to forbid the prefix entirely, set `onlyCamelCase` to `false`:
The default behavior is to check for camel case usage. If you want to disallow the prefix entirely, set `onlyCamelCase` to `false`:

```js
// eslint unicorn/no-keyword-prefix: ["error", {"onlyCamelCase": true}]
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 @@ -7,7 +7,7 @@
🔧 *This rule is [auto-fixable](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems).*
<!-- /RULE_NOTICE -->

This rule adds onto the built-in [`no-lonely-if`](https://eslint.org/docs/rules/no-lonely-if) rule, which only forbids `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.
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.

## Fail

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-useless-undefined.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Type: `object`
Type: `boolean`\
Default: `true`

Forbid the use of `undefined` at the end of function call arguments. Pass `checkArguments: false` to disable checking them.
Disallow the use of `undefined` at the end of function call arguments. Pass `checkArguments: false` to disable checking them.

#### Fail

Expand Down
10 changes: 5 additions & 5 deletions docs/rules/prefer-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

Prefer using the [JavaScript module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) format over the legacy CommonJS module format.

1. Forbids `'use strict'` directive.
1. Disallows `'use strict'` directive.

JavaScript modules use “Strict Mode” by default.

1. Forbids “Global Return”.
1. Disallows “Global Return”.

This is a CommonJS-only feature.

1. Forbids the global variables `__dirname` and `__filename`.
1. Disallows the global variables `__dirname` and `__filename`.

They are [not available in JavaScript modules](https://nodejs.org/api/esm.html#esm_no_filename_or_dirname).

Expand Down Expand Up @@ -45,11 +45,11 @@ Prefer using the [JavaScript module](https://developer.mozilla.org/en-US/docs/We
const foo = new URL('foo.js', import.meta.url);
```

1. Forbids `require(…)`.
1. Disallows `require(…)`.

`require(…)` can be replaced by `import …` or `import(…)`.

1. Forbids `exports` and `module.exports`.
1. Disallows `exports` and `module.exports`.

`export …` should be used in JavaScript modules.

Expand Down
4 changes: 2 additions & 2 deletions rules/prefer-modern-dom-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const replaceChildOrInsertBeforeSelector = [
'[callee.object.type="Identifier"]',
].join('');

const forbiddenMethods = new Map([
const disallowedMethods = new Map([
['replaceChild', 'replaceWith'],
['insertBefore', 'before'],
]);
Expand All @@ -32,7 +32,7 @@ const checkForReplaceChildOrInsertBefore = (context, node) => {
const method = node.callee.property.name;
const parentNode = node.callee.object.name;
const [newChildNode, oldChildNode] = node.arguments.map(({name}) => name);
const preferredMethod = forbiddenMethods.get(method);
const preferredMethod = disallowedMethods.get(method);

const fix = isValueNotUsable(node)
? fixer => fixer.replaceText(
Expand Down
4 changes: 2 additions & 2 deletions rules/prefer-query-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const selector = [
notDomNodeSelector('callee.object'),
].join('');

const forbiddenIdentifierNames = new Map([
const disallowedIdentifierNames = new Map([
['getElementById', 'querySelector'],
['getElementsByClassName', 'querySelectorAll'],
['getElementsByTagName', 'querySelectorAll'],
Expand Down Expand Up @@ -103,7 +103,7 @@ const fix = (node, identifierName, preferredSelector) => {
const create = () => ({
[selector](node) {
const method = node.callee.property.name;
const preferredSelector = forbiddenIdentifierNames.get(method);
const preferredSelector = disallowedIdentifierNames.get(method);

const problem = {
node: node.callee.property,
Expand Down

0 comments on commit ea6f300

Please sign in to comment.