Skip to content

Commit 7dc8f80

Browse files
committed
📝 fix rule names in documentation
1 parent e2da592 commit 7dc8f80

10 files changed

+36
-37
lines changed

docs/rules/callback-return.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The rule takes a single option - an array of possible callback names - which may
3232
Examples of **incorrect** code for this rule with the default `["callback", "cb", "next"]` option:
3333

3434
```js
35-
/*eslint callback-return: "error"*/
35+
/*eslint node/callback-return: "error"*/
3636

3737
function foo(err, callback) {
3838
if (err) {
@@ -45,7 +45,7 @@ function foo(err, callback) {
4545
Examples of **correct** code for this rule with the default `["callback", "cb", "next"]` option:
4646

4747
```js
48-
/*eslint callback-return: "error"*/
48+
/*eslint node/callback-return: "error"*/
4949

5050
function foo(err, callback) {
5151
if (err) {
@@ -60,7 +60,7 @@ function foo(err, callback) {
6060
Examples of **incorrect** code for this rule with the option `["done", "send.error", "send.success"]`:
6161

6262
```js
63-
/*eslint callback-return: ["error", ["done", "send.error", "send.success"]]*/
63+
/*eslint node/callback-return: ["error", ["done", "send.error", "send.success"]]*/
6464

6565
function foo(err, done) {
6666
if (err) {

docs/rules/global-require.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This rule requires all calls to `require()` to be at the top level of the module
2929
Examples of **incorrect** code for this rule:
3030

3131
```js
32-
/*eslint global-require: "error"*/
32+
/*eslint node/global-require: "error"*/
3333
/*eslint-env es6*/
3434

3535
// calling require() inside of a function is not allowed
@@ -61,7 +61,7 @@ try {
6161
Examples of **correct** code for this rule:
6262

6363
```js
64-
/*eslint global-require: "error"*/
64+
/*eslint node/global-require: "error"*/
6565

6666
// all these variations of require() are ok
6767
require('x');

docs/rules/handle-callback-err.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ If the configured name of the error variable begins with a `^` it is considered
7171
* If the option is `"^.+Error$"`, the rule reports unhandled errors where the parameter name ends with `Error` (for example, `connectionError` or `validationError` will match).
7272
* If the option is `"^.*(e|E)rr"`, the rule reports unhandled errors where the parameter name matches any string that contains `err` or `Err` (for example, `err`, `error`, `anyError`, `some_err` will match).
7373

74-
7574
## 🔎 Implementation
7675

7776
- [Rule source](../../lib/rules/handle-callback-err.js)

docs/rules/no-mixed-requires.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Configuring this rule with one boolean option `true` is deprecated.
3939
Examples of **incorrect** code for this rule with the default `{ "grouping": false, "allowCall": false }` options:
4040

4141
```js
42-
/*eslint no-mixed-requires: "error"*/
42+
/*eslint node/no-mixed-requires: "error"*/
4343

4444
var fs = require('fs'),
4545
i = 0;
@@ -52,7 +52,7 @@ var async = require('async'),
5252
Examples of **correct** code for this rule with the default `{ "grouping": false, "allowCall": false }` options:
5353

5454
```js
55-
/*eslint no-mixed-requires: "error"*/
55+
/*eslint node/no-mixed-requires: "error"*/
5656

5757
// only require declarations (grouping off)
5858
var eventEmitter = require('events').EventEmitter,
@@ -75,7 +75,7 @@ var foo = require('foo' + VERSION),
7575
Examples of **incorrect** code for this rule with the `{ "grouping": true }` option:
7676

7777
```js
78-
/*eslint no-mixed-requires: ["error", { "grouping": true }]*/
78+
/*eslint node/no-mixed-requires: ["error", { "grouping": true }]*/
7979

8080
// invalid because of mixed types "core" and "module"
8181
var fs = require('fs'),
@@ -91,7 +91,7 @@ var foo = require('foo'),
9191
Examples of **incorrect** code for this rule with the `{ "allowCall": true }` option:
9292

9393
```js
94-
/*eslint no-mixed-requires: ["error", { "allowCall": true }]*/
94+
/*eslint node/no-mixed-requires: ["error", { "allowCall": true }]*/
9595

9696
var async = require('async'),
9797
debug = require('diagnostics').someFunction('my-module'), /* allowCall doesn't allow calling any function */
@@ -101,7 +101,7 @@ var async = require('async'),
101101
Examples of **correct** code for this rule with the `{ "allowCall": true }` option:
102102

103103
```js
104-
/*eslint no-mixed-requires: ["error", { "allowCall": true }]*/
104+
/*eslint node/no-mixed-requires: ["error", { "allowCall": true }]*/
105105

106106
var async = require('async'),
107107
debug = require('diagnostics')('my-module'),

docs/rules/no-new-require.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ This rule aims to eliminate use of the `new require` expression.
2828
Examples of **incorrect** code for this rule:
2929

3030
```js
31-
/*eslint no-new-require: "error"*/
31+
/*eslint node/no-new-require: "error"*/
3232

3333
var appHeader = new require('app-header');
3434
```
3535

3636
Examples of **correct** code for this rule:
3737

3838
```js
39-
/*eslint no-new-require: "error"*/
39+
/*eslint node/no-new-require: "error"*/
4040

4141
var AppHeader = require('app-header');
4242
var appHeader = new AppHeader();

docs/rules/no-process-env.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This rule is aimed at discouraging use of `process.env` to avoid global dependen
1010
Examples of **incorrect** code for this rule:
1111

1212
```js
13-
/*eslint no-process-env: "error"*/
13+
/*eslint node/no-process-env: "error"*/
1414

1515
if(process.env.NODE_ENV === "development") {
1616
//...
@@ -20,7 +20,7 @@ if(process.env.NODE_ENV === "development") {
2020
Examples of **correct** code for this rule:
2121

2222
```js
23-
/*eslint no-process-env: "error"*/
23+
/*eslint node/no-process-env: "error"*/
2424

2525
var config = require("./config");
2626

docs/rules/no-process-exit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ This rule aims to prevent the use of `process.exit()` in Node.js JavaScript. As
2929
Examples of **incorrect** code for this rule:
3030

3131
```js
32-
/*eslint no-process-exit: "error"*/
32+
/*eslint node/no-process-exit: "error"*/
3333

3434
process.exit(1);
3535
process.exit(0);
@@ -38,7 +38,7 @@ process.exit(0);
3838
Examples of **correct** code for this rule:
3939

4040
```js
41-
/*eslint no-process-exit: "error"*/
41+
/*eslint node/no-process-exit: "error"*/
4242

4343
Process.exit();
4444
var exit = process.exit;

docs/rules/no-restricted-import.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The rule takes an array as options: the names of restricted modules.
1111

1212
```json
1313
{
14-
"no-restricted-import": ["error", [
14+
"node/no-restricted-import": ["error", [
1515
"foo-module",
1616
"bar-module"
1717
]]
@@ -22,7 +22,7 @@ You may also specify a custom message for each module you want to restrict as fo
2222

2323
```json
2424
{
25-
"no-restricted-import": ["error", [
25+
"node/no-restricted-import": ["error", [
2626
{
2727
"name": "foo-module",
2828
"message": "Please use foo-module2 instead."
@@ -39,7 +39,7 @@ And you can use glob patterns in the `name` property.
3939

4040
```json
4141
{
42-
"no-restricted-import": ["error", [
42+
"node/no-restricted-import": ["error", [
4343
{
4444
"name": "lodash/*",
4545
"message": "Please use xyz-module instead."
@@ -60,7 +60,7 @@ module.exports = {
6060
{
6161
files: "client/**",
6262
rules: {
63-
"no-restricted-import": ["error", [
63+
"node/no-restricted-import": ["error", [
6464
{
6565
name: path.resolve(__dirname, "server/**"),
6666
message: "Don't use server code from client code."
@@ -71,7 +71,7 @@ module.exports = {
7171
{
7272
files: "server/**",
7373
rules: {
74-
"no-restricted-import": ["error", [
74+
"node/no-restricted-import": ["error", [
7575
{
7676
name: path.resolve(__dirname, "client/**"),
7777
message: "Don't use client code from server code."
@@ -88,7 +88,7 @@ module.exports = {
8888
Examples of **incorrect** code for this rule with sample `"fs", "cluster", "lodash"` restricted modules:
8989

9090
```js
91-
/*eslint no-restricted-import: ["error", ["fs", "cluster", "lodash/*"]]*/
91+
/*eslint node/no-restricted-import: ["error", ["fs", "cluster", "lodash/*"]]*/
9292

9393
import fs from 'fs';
9494
import cluster from 'cluster';
@@ -98,14 +98,14 @@ import pick from 'lodash/pick';
9898
Examples of **correct** code for this rule with sample `"fs", "cluster", "lodash"` restricted modules:
9999

100100
```js
101-
/*eslint no-restricted-import: ["error", ["fs", "cluster", "lodash/*"]]*/
101+
/*eslint node/no-restricted-import: ["error", ["fs", "cluster", "lodash/*"]]*/
102102

103103
import crypto from 'crypto';
104104
import _ from 'lodash';
105105
```
106106

107107
```js
108-
/*eslint no-restricted-import: ["error", ["fs", "cluster", { "name": ["lodash/*", "!lodash/pick"] }]]*/
108+
/*eslint node/no-restricted-import: ["error", ["fs", "cluster", { "name": ["lodash/*", "!lodash/pick"] }]]*/
109109

110110
import pick from 'lodash/pick';
111111
```

docs/rules/no-restricted-require.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The rule takes an array as options: the names of restricted modules.
1818

1919
```json
2020
{
21-
"no-restricted-require": ["error", [
21+
"node/no-restricted-require": ["error", [
2222
"foo-module",
2323
"bar-module"
2424
]]
@@ -29,7 +29,7 @@ You may also specify a custom message for each module you want to restrict as fo
2929

3030
```json
3131
{
32-
"no-restricted-require": ["error", [
32+
"node/no-restricted-require": ["error", [
3333
{
3434
"name": "foo-module",
3535
"message": "Please use foo-module2 instead."
@@ -46,7 +46,7 @@ And you can use glob patterns in the `name` property.
4646

4747
```json
4848
{
49-
"no-restricted-require": ["error", [
49+
"node/no-restricted-require": ["error", [
5050
{
5151
"name": "lodash/*",
5252
"message": "Please use xyz-module instead."
@@ -67,7 +67,7 @@ module.exports = {
6767
{
6868
files: "client/**",
6969
rules: {
70-
"no-restricted-require": ["error", [
70+
"node/no-restricted-require": ["error", [
7171
{
7272
name: path.resolve(__dirname, "server/**"),
7373
message: "Don't use server code from client code."
@@ -78,7 +78,7 @@ module.exports = {
7878
{
7979
files: "server/**",
8080
rules: {
81-
"no-restricted-require": ["error", [
81+
"node/no-restricted-require": ["error", [
8282
{
8383
name: path.resolve(__dirname, "client/**"),
8484
message: "Don't use client code from server code."
@@ -95,7 +95,7 @@ module.exports = {
9595
Examples of **incorrect** code for this rule with sample `"fs", "cluster", "lodash"` restricted modules:
9696

9797
```js
98-
/*eslint no-restricted-require: ["error", ["fs", "cluster", "lodash/*"]]*/
98+
/*eslint node/no-restricted-require: ["error", ["fs", "cluster", "lodash/*"]]*/
9999

100100
const fs = require('fs');
101101
const cluster = require('cluster');
@@ -105,14 +105,14 @@ const pick = require('lodash/pick');
105105
Examples of **correct** code for this rule with sample `"fs", "cluster", "lodash"` restricted modules:
106106

107107
```js
108-
/*eslint no-restricted-require: ["error", ["fs", "cluster", "lodash/*"]]*/
108+
/*eslint node/no-restricted-require: ["error", ["fs", "cluster", "lodash/*"]]*/
109109

110110
const crypto = require('crypto');
111111
const _ = require('lodash');
112112
```
113113

114114
```js
115-
/*eslint no-restricted-require: ["error", ["fs", "cluster", { "name": ["lodash/*", "!lodash/pick"] }]]*/
115+
/*eslint node/no-restricted-require: ["error", ["fs", "cluster", { "name": ["lodash/*", "!lodash/pick"] }]]*/
116116

117117
const pick = require('lodash/pick');
118118
```

docs/rules/no-sync.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This rule has an optional object option `{ allowAtRootLevel: <boolean> }`, which
1414
Examples of **incorrect** code for this rule with the default `{ allowAtRootLevel: false }` option:
1515

1616
```js
17-
/*eslint no-sync: "error"*/
17+
/*eslint node/no-sync: "error"*/
1818

1919
fs.existsSync(somePath);
2020

@@ -26,7 +26,7 @@ function foo() {
2626
Examples of **correct** code for this rule with the default `{ allowAtRootLevel: false }` option:
2727

2828
```js
29-
/*eslint no-sync: "error"*/
29+
/*eslint node/no-sync: "error"*/
3030

3131
obj.sync();
3232

@@ -38,7 +38,7 @@ async(function() {
3838
Examples of **incorrect** code for this rule with the `{ allowAtRootLevel: true }` option
3939

4040
```js
41-
/*eslint no-sync: ["error", { allowAtRootLevel: true }]*/
41+
/*eslint node/no-sync: ["error", { allowAtRootLevel: true }]*/
4242

4343
function foo() {
4444
var contents = fs.readFileSync(somePath).toString();
@@ -50,7 +50,7 @@ var bar = baz => fs.readFileSync(qux);
5050
Examples of **correct** code for this rule with the `{ allowAtRootLevel: true }` option
5151

5252
```js
53-
/*eslint no-sync: ["error", { allowAtRootLevel: true }]*/
53+
/*eslint node/no-sync: ["error", { allowAtRootLevel: true }]*/
5454

5555
fs.readFileSync(somePath).toString();
5656
```

0 commit comments

Comments
 (0)