summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.eslintignore1
-rw-r--r--.eslintrc.js264
-rw-r--r--.eslintrc.yaml217
-rw-r--r--.gitignore2
-rw-r--r--Makefile2
-rw-r--r--benchmark/buffers/buffer-base64-decode-wrapped.js2
-rw-r--r--benchmark/buffers/buffer-base64-decode.js2
-rw-r--r--lib/.eslintrc.yaml10
-rw-r--r--lib/internal/errors.js6
-rw-r--r--lib/internal/test/unicode.js4
-rw-r--r--lib/timers.js4
-rw-r--r--lib/util.js2
-rw-r--r--test/.eslintrc.yaml16
-rw-r--r--test/addons/hello-world-esm/test.mjs2
-rw-r--r--test/common/README.md18
-rw-r--r--test/common/benchmark.js2
-rw-r--r--test/common/countdown.js3
-rw-r--r--test/common/dns.js2
-rw-r--r--test/common/duplexpair.js2
-rw-r--r--test/common/fixtures.js2
-rw-r--r--test/common/http2.js2
-rw-r--r--test/common/index.js2
-rw-r--r--test/common/index.mjs2
-rw-r--r--test/common/internet.js2
-rw-r--r--test/common/shared-lib-util.js2
-rw-r--r--test/common/tmpdir.js2
-rw-r--r--test/common/wpt.js2
-rw-r--r--test/es-module/esm-snapshot-mutator.js2
-rw-r--r--test/es-module/esm-snapshot.js2
-rw-r--r--test/es-module/test-esm-example-loader.js2
-rw-r--r--test/es-module/test-esm-forbidden-globals.mjs2
-rw-r--r--test/es-module/test-esm-json.mjs2
-rw-r--r--test/es-module/test-esm-loader-dependency.mjs2
-rw-r--r--test/es-module/test-esm-main-lookup.mjs2
-rw-r--r--test/es-module/test-esm-named-exports.mjs2
-rw-r--r--test/es-module/test-esm-namespace.mjs2
-rw-r--r--test/es-module/test-esm-ok.mjs2
-rw-r--r--test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs2
-rw-r--r--test/es-module/test-esm-preserve-symlinks-not-found.mjs2
-rw-r--r--test/es-module/test-esm-resolve-hook.mjs2
-rw-r--r--test/es-module/test-esm-shared-loader-dep.mjs2
-rw-r--r--test/es-module/test-esm-shebang.mjs2
-rw-r--r--test/es-module/test-esm-snapshot.mjs2
-rw-r--r--test/parallel/test-accessor-properties.js2
-rw-r--r--test/parallel/test-assert.js2
-rw-r--r--test/parallel/test-buffer-alloc.js2
-rw-r--r--test/parallel/test-buffer-concat.js2
-rw-r--r--test/parallel/test-global-console-exists.js2
-rw-r--r--test/parallel/test-http-invalid-urls.js2
-rw-r--r--test/parallel/test-querystring.js4
-rw-r--r--test/parallel/test-regression-object-prototype.js2
-rw-r--r--test/sequential/test-async-wrap-getasyncid.js4
-rw-r--r--test/sequential/test-inspector-overwrite-config.js2
-rw-r--r--tools/node_modules/eslint-plugin-node-core/index.js24
-rw-r--r--vcbuild.bat2
55 files changed, 366 insertions, 293 deletions
diff --git a/.eslintignore b/.eslintignore
index 483dbbc7d2..78ae310ce1 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -11,3 +11,4 @@ tools/remark-*
node_modules
benchmark/tmp
doc/**/*.js
+!.eslintrc.js
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 0000000000..7b8a2cc833
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,264 @@
+'use strict';
+
+const Module = require('module');
+const path = require('path');
+
+const NodePlugin = require('./tools/node_modules/eslint-plugin-node-core');
+NodePlugin.RULES_DIR = path.resolve(__dirname, 'tools', 'eslint-rules');
+
+const ModuleFindPath = Module._findPath;
+const hacks = [
+ 'eslint-plugin-node-core',
+ 'eslint-plugin-markdown',
+ 'babel-eslint',
+];
+Module._findPath = (request, paths, isMain) => {
+ const r = ModuleFindPath(request, paths, isMain);
+ if (!r && hacks.includes(request)) {
+ try {
+ return require.resolve(`./tools/node_modules/${request}`);
+ } catch (err) {
+ return require.resolve(
+ `./tools/node_modules/eslint/node_modules/${request}`);
+ }
+ }
+ return r;
+};
+
+module.exports = {
+ root: true,
+ plugins: ['markdown', 'node-core'],
+ env: { node: true, es6: true },
+ parser: 'babel-eslint',
+ parserOptions: { sourceType: 'script' },
+ overrides: [
+ {
+ files: [
+ 'doc/api/esm.md',
+ '*.mjs',
+ 'test/es-module/test-esm-example-loader.js',
+ ],
+ parserOptions: { sourceType: 'module' },
+ },
+ ],
+ rules: {
+ // Possible Errors
+ // http://eslint.org/docs/rules/#possible-errors
+ 'for-direction': 'error',
+ 'no-control-regex': 'error',
+ 'no-debugger': 'error',
+ 'no-dupe-args': 'error',
+ 'no-dupe-keys': 'error',
+ 'no-duplicate-case': 'error',
+ 'no-empty-character-class': 'error',
+ 'no-ex-assign': 'error',
+ 'no-extra-boolean-cast': 'error',
+ 'no-extra-parens': ['error', 'functions'],
+ 'no-extra-semi': 'error',
+ 'no-func-assign': 'error',
+ 'no-invalid-regexp': 'error',
+ 'no-irregular-whitespace': 'error',
+ 'no-obj-calls': 'error',
+ 'no-template-curly-in-string': 'error',
+ 'no-unexpected-multiline': 'error',
+ 'no-unreachable': 'error',
+ 'no-unsafe-negation': 'error',
+ 'use-isnan': 'error',
+ 'valid-typeof': 'error',
+
+ // Best Practices
+ // http://eslint.org/docs/rules/#best-practices
+ 'accessor-pairs': 'error',
+ 'array-callback-return': 'error',
+ 'dot-location': ['error', 'property'],
+ eqeqeq: ['error', 'smart'],
+ 'no-fallthrough': 'error',
+ 'no-global-assign': 'error',
+ 'no-multi-spaces': ['error', { ignoreEOLComments: true }],
+ 'no-octal': 'error',
+ 'no-proto': 'error',
+ 'no-redeclare': 'error',
+ 'no-restricted-properties': [
+ 'error',
+ {
+ object: 'assert',
+ property: 'deepEqual',
+ message: 'Use assert.deepStrictEqual().',
+ },
+ {
+ object: 'assert',
+ property: 'notDeepEqual',
+ message: 'Use assert.notDeepStrictEqual().',
+ },
+ {
+ object: 'assert',
+ property: 'equal',
+ message: 'Use assert.astrictEqual() rather than assert.equal().',
+ },
+ {
+ object: 'assert',
+ property: 'notEqual',
+ message: 'Use assert.notStrictEqual() rather than assert.notEqual().',
+ },
+ {
+ property: '__defineGetter__',
+ message: '__defineGetter__ is deprecated.',
+ },
+ {
+ property: '__defineSetter__',
+ message: '__defineSetter__ is deprecated.',
+ }
+ ],
+ 'no-return-await': 'error',
+ 'no-self-assign': 'error',
+ 'no-throw-literal': 'error',
+ 'no-unused-labels': 'error',
+ 'no-useless-call': 'error',
+ 'no-useless-concat': 'error',
+ 'no-useless-escape': 'error',
+ 'no-useless-return': 'error',
+ 'no-void': 'error',
+ 'no-with': 'error',
+
+ // Strict Mode
+ // http://eslint.org/docs/rules/#strict-mode
+ strict: ['error', 'global'],
+
+ // Variables
+ // http://eslint.org/docs/rules/#variables
+ 'no-delete-var': 'error',
+ 'no-undef': 'error',
+ 'no-unused-vars': ['error', { args: 'none' }],
+ 'no-use-before-define': ['error', {
+ classes: true,
+ functions: false,
+ variables: false,
+ }],
+
+ // Node.js and CommonJS
+ // http://eslint.org/docs/rules/#nodejs-and-commonjs
+ 'no-mixed-requires': 'error',
+ 'no-new-require': 'error',
+ 'no-path-concat': 'error',
+ 'no-restricted-modules': ['error', 'sys'],
+
+ // Stylistic Issues
+ // http://eslint.org/docs/rules/#stylistic-issues'
+ 'block-spacing': 'error',
+ 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
+ 'comma-dangle': ['error', 'only-multiline'],
+ 'comma-spacing': 'error',
+ 'comma-style': 'error',
+ 'computed-property-spacing': 'error',
+ 'eol-last': 'error',
+ 'func-call-spacing': 'error',
+ 'func-name-matching': 'error',
+ 'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
+ indent: ['error', 2, {
+ ArrayExpression: 'first',
+ CallExpression: { arguments: 'first' },
+ FunctionDeclaration: { parameters: 'first' },
+ FunctionExpression: { parameters: 'first' },
+ MemberExpression: 'off',
+ ObjectExpression: 'first',
+ SwitchCase: 1,
+ }],
+ 'key-spacing': ['error', { mode: 'minimum' }],
+ 'keyword-spacing': 'error',
+ 'linebreak-style': ['error', 'unix'],
+ 'max-len': ['error', {
+ code: 80,
+ ignorePattern: '^// Flags:',
+ ignoreRegExpLiterals: true,
+ ignoreUrls: true,
+ tabWidth: 2,
+ }],
+ 'new-parens': 'error',
+ 'no-lonely-if': 'error',
+ 'no-mixed-spaces-and-tabs': 'error',
+ 'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0, maxBOF: 0 }],
+ /* eslint-disable max-len, quotes */
+ 'no-restricted-syntax': [
+ 'error',
+ {
+ selector: `CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])`,
+ message: 'use a regular expression for second argument of assert.throws()',
+ },
+ {
+ selector: `CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]`,
+ message: 'assert.throws() must be invoked with at least two arguments.',
+ },
+ {
+ selector: `CallExpression[callee.name='setTimeout'][arguments.length<2]`,
+ message: 'setTimeout() must be invoked with at least two arguments.',
+ },
+ {
+ selector: `CallExpression[callee.name='setInterval'][arguments.length<2]`,
+ message: 'setInterval() must be invoked with at least 2 arguments.',
+ },
+ {
+ selector: 'ThrowStatement > CallExpression[callee.name=/Error$/]',
+ message: 'Use new keyword when throwing an Error.',
+ }
+ ],
+ /* eslint-enable max-len, quotes */
+ 'no-tabs': 'error',
+ 'no-trailing-spaces': 'error',
+ 'object-curly-spacing': ['error', 'always'],
+ 'one-var-declaration-per-line': 'error',
+ 'operator-linebreak': ['error', 'after'],
+ quotes: ['error', 'single', 'avoid-escape'],
+ semi: 'error',
+ 'semi-spacing': 'error',
+ 'space-before-blocks': ['error', 'always'],
+ 'space-before-function-paren': ['error', {
+ anonymous: 'never',
+ named: 'never',
+ asyncArrow: 'always',
+ }],
+ 'space-in-parens': ['error', 'never'],
+ 'space-infix-ops': 'error',
+ 'space-unary-ops': 'error',
+ 'unicode-bom': 'error',
+
+ // ECMAScript 6
+ // http://eslint.org/docs/rules/#ecmascript-6
+ 'arrow-parens': ['error', 'always'],
+ 'arrow-spacing': ['error', { before: true, after: true }],
+ 'constructor-super': 'error',
+ 'no-class-assign': 'error',
+ 'no-confusing-arrow': 'error',
+ 'no-const-assign': 'error',
+ 'no-dupe-class-members': 'error',
+ 'no-new-symbol': 'error',
+ 'no-this-before-super': 'error',
+ 'prefer-const': ['error', { ignoreReadBeforeAssign: true }],
+ 'rest-spread-spacing': 'error',
+ 'symbol-description': 'error',
+ 'template-curly-spacing': 'error',
+
+ // Custom rules in from eslint-plugin-node-core
+ 'node-core/no-unescaped-regexp-dot': 'error',
+ },
+ globals: {
+ COUNTER_HTTP_CLIENT_REQUEST: false,
+ COUNTER_HTTP_CLIENT_RESPONSE: false,
+ COUNTER_HTTP_SERVER_REQUEST: false,
+ COUNTER_HTTP_SERVER_RESPONSE: false,
+ COUNTER_NET_SERVER_CONNECTION: false,
+ COUNTER_NET_SERVER_CONNECTION_CLOSE: false,
+ DTRACE_HTTP_CLIENT_REQUEST: false,
+ DTRACE_HTTP_CLIENT_RESPONSE: false,
+ DTRACE_HTTP_SERVER_REQUEST: false,
+ DTRACE_HTTP_SERVER_RESPONSE: false,
+ DTRACE_NET_SERVER_CONNECTION: false,
+ DTRACE_NET_STREAM_END: false,
+ LTTNG_HTTP_CLIENT_REQUEST: false,
+ LTTNG_HTTP_CLIENT_RESPONSE: false,
+ LTTNG_HTTP_SERVER_REQUEST: false,
+ LTTNG_HTTP_SERVER_RESPONSE: false,
+ LTTNG_NET_SERVER_CONNECTION: false,
+ LTTNG_NET_STREAM_END: false,
+ internalBinding: false,
+ },
+};
diff --git a/.eslintrc.yaml b/.eslintrc.yaml
deleted file mode 100644
index 99489d2e7d..0000000000
--- a/.eslintrc.yaml
+++ /dev/null
@@ -1,217 +0,0 @@
-root: true
-
-plugins:
- - markdown
-
-env:
- node: true
- es6: true
-
-parser: babel-eslint
-
-parserOptions:
- sourceType: script
-
-overrides:
- - files: ["doc/api/esm.md", "*.mjs", "test/es-module/test-esm-example-loader.js"]
- parserOptions:
- sourceType: module
-
-rules:
- # Possible Errors
- # http://eslint.org/docs/rules/#possible-errors
- for-direction: error
- no-control-regex: error
- no-debugger: error
- no-dupe-args: error
- no-dupe-keys: error
- no-duplicate-case: error
- no-empty-character-class: error
- no-ex-assign: error
- no-extra-boolean-cast: error
- no-extra-parens: [error, functions]
- no-extra-semi: error
- no-func-assign: error
- no-invalid-regexp: error
- no-irregular-whitespace: error
- no-obj-calls: error
- no-template-curly-in-string: error
- no-unexpected-multiline: error
- no-unreachable: error
- no-unsafe-negation: error
- use-isnan: error
- valid-typeof: error
-
- # Best Practices
- # http://eslint.org/docs/rules/#best-practices
- accessor-pairs: error
- array-callback-return: error
- dot-location: [error, property]
- dot-notation: error
- eqeqeq: [error, smart]
- no-fallthrough: error
- no-global-assign: error
- no-multi-spaces: [error, {ignoreEOLComments: true}]
- no-octal: error
- no-proto: error
- no-redeclare: error
- no-restricted-properties:
- - error
- - object: assert
- property: deepEqual
- message: Use assert.deepStrictEqual().
- - object: assert
- property: notDeepEqual
- message: Use assert.notDeepStrictEqual().
- - object: assert
- property: equal
- message: Use assert.strictEqual() rather than assert.equal().
- - object: assert
- property: notEqual
- message: Use assert.notStrictEqual() rather than assert.notEqual().
- - property: __defineGetter__
- message: __defineGetter__ is deprecated.
- - property: __defineSetter__
- message: __defineSetter__ is deprecated.
- no-return-await: error
- no-self-assign: error
- no-self-compare: error
- no-throw-literal: error
- no-unused-labels: error
- no-useless-call: error
- no-useless-concat: error
- no-useless-escape: error
- no-useless-return: error
- no-void: error
- no-with: error
-
- # Strict Mode
- # http://eslint.org/docs/rules/#strict-mode
- strict: [error, global]
-
- # Variables
- # http://eslint.org/docs/rules/#variables
- no-delete-var: error
- no-undef: error
- no-unused-vars: [error, {args: none}]
- no-use-before-define: [error, {classes: true,
- functions: false,
- variables: false}]
-
- # Node.js and CommonJS
- # http://eslint.org/docs/rules/#nodejs-and-commonjs
- no-mixed-requires: error
- no-new-require: error
- no-path-concat: error
- no-restricted-modules: [error, sys]
-
- # Stylistic Issues
- # http://eslint.org/docs/rules/#stylistic-issues
- block-spacing: error
- brace-style: [error, 1tbs, {allowSingleLine: true}]
- comma-dangle: [error, only-multiline]
- comma-spacing: error
- comma-style: error
- computed-property-spacing: error
- eol-last: error
- func-call-spacing: error
- func-name-matching: error
- func-style: [error, declaration, {allowArrowFunctions: true}]
- indent: [error, 2, {ArrayExpression: first,
- CallExpression: {arguments: first},
- FunctionDeclaration: {parameters: first},
- FunctionExpression: {parameters: first},
- MemberExpression: off,
- ObjectExpression: first,
- SwitchCase: 1}]
- key-spacing: [error, {mode: minimum}]
- keyword-spacing: error
- linebreak-style: [error, unix]
- max-len: [error, {code: 80,
- ignorePattern: "^\/\/ Flags:",
- ignoreRegExpLiterals: true,
- ignoreUrls: true,
- tabWidth: 2}]
- new-parens: error
- no-lonely-if: error
- no-mixed-spaces-and-tabs: error
- no-multiple-empty-lines: [error, {max: 2, maxEOF: 0, maxBOF: 0}]
- no-restricted-syntax: [error, {
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']",
- message: "Please replace `assert.doesNotThrow()` and add a comment next to the code instead."
- }, {
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])",
- message: "Use a regular expression for second argument of assert.throws()"
- }, {
- selector: "CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.length<2]",
- message: "assert.throws() must be invoked with at least two arguments."
- }, {
- selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]",
- message: "setTimeout() must be invoked with at least two arguments."
- }, {
- selector: "CallExpression[callee.name='setInterval'][arguments.length<2]",
- message: "setInterval() must be invoked with at least 2 arguments."
- }, {
- selector: "ThrowStatement > CallExpression[callee.name=/Error$/]",
- message: "Use new keyword when throwing an Error."
- }]
- no-tabs: error
- no-trailing-spaces: error
- no-unsafe-finally: error
- object-curly-spacing: [error, always]
- one-var-declaration-per-line: error
- operator-linebreak: [error, after]
- quotes: [error, single, avoid-escape]
- semi: error
- semi-spacing: error
- space-before-blocks: [error, always]
- space-before-function-paren: [error, {
- anonymous: never,
- named: never,
- asyncArrow: always
- }]
- space-in-parens: [error, never]
- space-infix-ops: error
- space-unary-ops: error
- unicode-bom: error
-
- # ECMAScript 6
- # http://eslint.org/docs/rules/#ecmascript-6
- arrow-parens: [error, always]
- arrow-spacing: [error, {before: true, after: true}]
- constructor-super: error
- no-class-assign: error
- no-confusing-arrow: error
- no-const-assign: error
- no-dupe-class-members: error
- no-new-symbol: error
- no-this-before-super: error
- prefer-const: [error, {ignoreReadBeforeAssign: true}]
- rest-spread-spacing: error
- symbol-description: error
- template-curly-spacing: error
-
- # Custom rules in tools/eslint-rules
- no-unescaped-regexp-dot: error
-
-# Global scoped method and vars
-globals:
- COUNTER_HTTP_CLIENT_REQUEST: false
- COUNTER_HTTP_CLIENT_RESPONSE: false
- COUNTER_HTTP_SERVER_REQUEST: false
- COUNTER_HTTP_SERVER_RESPONSE: false
- COUNTER_NET_SERVER_CONNECTION: false
- COUNTER_NET_SERVER_CONNECTION_CLOSE: false
- DTRACE_HTTP_CLIENT_REQUEST: false
- DTRACE_HTTP_CLIENT_RESPONSE: false
- DTRACE_HTTP_SERVER_REQUEST: false
- DTRACE_HTTP_SERVER_RESPONSE: false
- DTRACE_NET_SERVER_CONNECTION: false
- DTRACE_NET_STREAM_END: false
- LTTNG_HTTP_CLIENT_REQUEST: false
- LTTNG_HTTP_CLIENT_RESPONSE: false
- LTTNG_HTTP_SERVER_REQUEST: false
- LTTNG_HTTP_SERVER_RESPONSE: false
- LTTNG_NET_SERVER_CONNECTION: false
- LTTNG_NET_STREAM_END: false
- internalBinding: false
diff --git a/.gitignore b/.gitignore
index 0ff301ace3..d619bb9a9c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,7 @@
!tools/doc/node_modules/**/.*
!.editorconfig
!.eslintignore
-!.eslintrc.yaml
+!.eslintrc.js
!.gitattributes
!.github
!.gitignore
diff --git a/Makefile b/Makefile
index 547890111b..d5a8d1e267 100644
--- a/Makefile
+++ b/Makefile
@@ -1101,7 +1101,7 @@ endif
LINT_JS_TARGETS = benchmark doc lib test tools
run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \
- --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md $(LINT_JS_TARGETS)
+ --ext=.js,.mjs,.md $(LINT_JS_TARGETS) --ignore-pattern '!.eslintrc.js'
run-lint-js-fix = $(run-lint-js) --fix
.PHONY: lint-js-fix
diff --git a/benchmark/buffers/buffer-base64-decode-wrapped.js b/benchmark/buffers/buffer-base64-decode-wrapped.js
index 61e3bb654e..1e6f1fde0a 100644
--- a/benchmark/buffers/buffer-base64-decode-wrapped.js
+++ b/benchmark/buffers/buffer-base64-decode-wrapped.js
@@ -13,7 +13,7 @@ function main({ n }) {
const line = `${'abcd'.repeat(charsPerLine / 4)}\n`;
const data = line.repeat(linesCount);
- // eslint-disable-next-line no-unescaped-regexp-dot
+ // eslint-disable-next-line node-core/no-unescaped-regexp-dot
data.match(/./); // Flatten the string
const buffer = Buffer.alloc(bytesCount, line, 'base64');
diff --git a/benchmark/buffers/buffer-base64-decode.js b/benchmark/buffers/buffer-base64-decode.js
index 492922fb2b..1631ed4f08 100644
--- a/benchmark/buffers/buffer-base64-decode.js
+++ b/benchmark/buffers/buffer-base64-decode.js
@@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, {
function main({ n }) {
const s = 'abcd'.repeat(8 << 20);
- // eslint-disable-next-line no-unescaped-regexp-dot
+ // eslint-disable-next-line node-core/no-unescaped-regexp-dot
s.match(/./); // Flatten string.
assert.strictEqual(s.length % 4, 0);
const b = Buffer.allocUnsafe(s.length / 4 * 3);
diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml
index e87596d4d5..5810faa661 100644
--- a/lib/.eslintrc.yaml
+++ b/lib/.eslintrc.yaml
@@ -1,7 +1,7 @@
rules:
# Custom rules in tools/eslint-rules
- require-buffer: error
- buffer-constructor: error
- no-let-in-for-declaration: error
- lowercase-name-for-primitive: error
- non-ascii-character: error
+ node-core/require-buffer: error
+ node-core/buffer-constructor: error
+ node-core/no-let-in-for-declaration: error
+ node-core/lowercase-name-for-primitive: error
+ node-core/non-ascii-character: error
diff --git a/lib/internal/errors.js b/lib/internal/errors.js
index fb4f5e8482..92e1efbf2f 100644
--- a/lib/internal/errors.js
+++ b/lib/internal/errors.js
@@ -1,6 +1,6 @@
-/* eslint documented-errors: "error" */
-/* eslint alphabetize-errors: "error" */
-/* eslint prefer-util-format-errors: "error" */
+/* eslint node-core/documented-errors: "error" */
+/* eslint node-core/alphabetize-errors: "error" */
+/* eslint node-core/prefer-util-format-errors: "error" */
'use strict';
diff --git a/lib/internal/test/unicode.js b/lib/internal/test/unicode.js
index 7172a43ec2..451c3c4737 100644
--- a/lib/internal/test/unicode.js
+++ b/lib/internal/test/unicode.js
@@ -3,6 +3,6 @@
// This module exists entirely for regression testing purposes.
// See `test/parallel/test-internal-unicode.js`.
-/* eslint-disable non-ascii-character */
+/* eslint-disable node-core/non-ascii-character */
module.exports = '✓';
-/* eslint-enable non-ascii-character */
+/* eslint-enable node-core/non-ascii-character */
diff --git a/lib/timers.js b/lib/timers.js
index bc98718fdf..2744f231b5 100644
--- a/lib/timers.js
+++ b/lib/timers.js
@@ -89,7 +89,7 @@ const kRefed = Symbol('refed');
// TimerWrap C++ handle, which makes the call after the duration to process the
// list it is attached to.
//
-/* eslint-disable non-ascii-character */
+/* eslint-disable node-core/non-ascii-character */
//
// ╔════ > Object Map
// ║
@@ -111,7 +111,7 @@ const kRefed = Symbol('refed');
// ║
// ╚════ > Linked List
//
-/* eslint-enable non-ascii-character */
+/* eslint-enable node-core/non-ascii-character */
//
// With this, virtually constant-time insertion (append), removal, and timeout
// is possible in the JavaScript layer. Any one list of timers is able to be
diff --git a/lib/util.js b/lib/util.js
index e13f5b8b80..93729991cd 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -633,7 +633,7 @@ function formatPrimitive(fn, value, ctx) {
// 2. If none matches, non-greedy match any text up to a whitespace or
// the end of the string.
//
- // eslint-disable-next-line max-len, no-unescaped-regexp-dot
+ // eslint-disable-next-line max-len, node-core/no-unescaped-regexp-dot
readableRegExps[divisor] = new RegExp(`(.|\\n){1,${divisor}}(\\s|$)|(\\n|.)+?(\\s|$)`, 'gm');
}
const indent = ' '.repeat(ctx.indentationLvl);
diff --git a/test/.eslintrc.yaml b/test/.eslintrc.yaml
index dbcb8ea6e0..a3fa2c2c8d 100644
--- a/test/.eslintrc.yaml
+++ b/test/.eslintrc.yaml
@@ -8,15 +8,15 @@ rules:
symbol-description: off
# Custom rules in tools/eslint-rules
- prefer-assert-iferror: error
- prefer-assert-methods: error
- prefer-common-expectserror: error
- prefer-common-mustnotcall: error
- crypto-check: error
- inspector-check: error
- number-isnan: error
+ node-core/prefer-assert-iferror: error
+ node-core/prefer-assert-methods: error
+ node-core/prefer-common-expectserror: error
+ node-core/prefer-common-mustnotcall: error
+ node-core/crypto-check: error
+ node-core/inspector-check: error
+ node-core/number-isnan: error
## common module is mandatory in tests
- required-modules: [error, common]
+ node-core/required-modules: [error, common]
# Global scoped methods and vars
globals:
diff --git a/test/addons/hello-world-esm/test.mjs b/test/addons/hello-world-esm/test.mjs
index 6e481ab4f7..d98de5bf87 100644
--- a/test/addons/hello-world-esm/test.mjs
+++ b/test/addons/hello-world-esm/test.mjs
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import assert from 'assert';
import binding from './build/binding.node';
diff --git a/test/common/README.md b/test/common/README.md
index 7fd36f5985..daf295855b 100644
--- a/test/common/README.md
+++ b/test/common/README.md
@@ -392,7 +392,7 @@ require a particular action to be taken after a given number of completed
tasks (for instance, shutting down an HTTP server after a specific number of
requests). The Countdown will fail the test if the remainder did not reach 0.
-<!-- eslint-disable strict, required-modules -->
+<!-- eslint-disable strict, node-core/required-modules -->
```js
const Countdown = require('../common/countdown');
@@ -526,7 +526,7 @@ Returns the result of
The http2.js module provides a handful of utilities for creating mock HTTP/2
frames for testing of HTTP/2 endpoints
-<!-- eslint-disable no-undef, no-unused-vars, required-modules, strict -->
+<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
```js
const http2 = require('../common/http2');
```
@@ -536,7 +536,7 @@ const http2 = require('../common/http2');
The `http2.Frame` is a base class that creates a `Buffer` containing a
serialized HTTP/2 frame header.
-<!-- eslint-disable no-undef, no-unused-vars, required-modules, strict -->
+<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
```js
// length is a 24-bit unsigned integer
// type is an 8-bit unsigned integer identifying the frame type
@@ -555,7 +555,7 @@ The serialized `Buffer` may be retrieved using the `frame.data` property.
The `http2.DataFrame` is a subclass of `http2.Frame` that serializes a `DATA`
frame.
-<!-- eslint-disable no-undef, no-unused-vars, required-modules, strict -->
+<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
```js
// id is the 32-bit stream identifier
// payload is a Buffer containing the DATA payload
@@ -572,7 +572,7 @@ socket.write(frame.data);
The `http2.HeadersFrame` is a subclass of `http2.Frame` that serializes a
`HEADERS` frame.
-<!-- eslint-disable no-undef, no-unused-vars, required-modules, strict -->
+<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
```js
// id is the 32-bit stream identifier
// payload is a Buffer containing the HEADERS payload (see either
@@ -590,7 +590,7 @@ socket.write(frame.data);
The `http2.SettingsFrame` is a subclass of `http2.Frame` that serializes an
empty `SETTINGS` frame.
-<!-- eslint-disable no-undef, no-unused-vars, required-modules, strict -->
+<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
```js
// ack is a boolean indicating whether or not to set the ACK flag.
const frame = new http2.SettingsFrame(ack);
@@ -603,7 +603,7 @@ socket.write(frame.data);
Set to a `Buffer` instance that contains a minimal set of serialized HTTP/2
request headers to be used as the payload of a `http2.HeadersFrame`.
-<!-- eslint-disable no-undef, no-unused-vars, required-modules, strict -->
+<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
```js
const frame = new http2.HeadersFrame(1, http2.kFakeRequestHeaders, 0, true);
@@ -615,7 +615,7 @@ socket.write(frame.data);
Set to a `Buffer` instance that contains a minimal set of serialized HTTP/2
response headers to be used as the payload a `http2.HeadersFrame`.
-<!-- eslint-disable no-undef, no-unused-vars, required-modules, strict -->
+<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
```js
const frame = new http2.HeadersFrame(1, http2.kFakeResponseHeaders, 0, true);
@@ -627,7 +627,7 @@ socket.write(frame.data);
Set to a `Buffer` containing the preamble bytes an HTTP/2 client must send
upon initial establishment of a connection.
-<!-- eslint-disable no-undef, no-unused-vars, required-modules, strict -->
+<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
```js
socket.write(http2.kClientMagic);
```
diff --git a/test/common/benchmark.js b/test/common/benchmark.js
index 6496da1cfb..1fd4476ba5 100644
--- a/test/common/benchmark.js
+++ b/test/common/benchmark.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
diff --git a/test/common/countdown.js b/test/common/countdown.js
index 5fcb77c4ed..67252657ec 100644
--- a/test/common/countdown.js
+++ b/test/common/countdown.js
@@ -1,4 +1,5 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
+
'use strict';
const assert = require('assert');
diff --git a/test/common/dns.js b/test/common/dns.js
index 69c67ac541..07f84d7a37 100644
--- a/test/common/dns.js
+++ b/test/common/dns.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
const assert = require('assert');
diff --git a/test/common/duplexpair.js b/test/common/duplexpair.js
index ea5bd86a04..fb4faca548 100644
--- a/test/common/duplexpair.js
+++ b/test/common/duplexpair.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
const { Duplex } = require('stream');
const assert = require('assert');
diff --git a/test/common/fixtures.js b/test/common/fixtures.js
index b4b7c042e8..b45e5bc809 100644
--- a/test/common/fixtures.js
+++ b/test/common/fixtures.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
const path = require('path');
diff --git a/test/common/http2.js b/test/common/http2.js
index 1d4c269fff..0f3378e9b8 100644
--- a/test/common/http2.js
+++ b/test/common/http2.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
// An HTTP/2 testing tool used to create mock frames for direct testing
diff --git a/test/common/index.js b/test/common/index.js
index 1fc029292a..54b146814a 100644
--- a/test/common/index.js
+++ b/test/common/index.js
@@ -19,7 +19,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-/* eslint-disable required-modules, crypto-check */
+/* eslint-disable node-core/required-modules, node-core/crypto-check */
'use strict';
const process = global.process; // Some tests tamper with the process global.
const path = require('path');
diff --git a/test/common/index.mjs b/test/common/index.mjs
index 00eceb79d4..6d6fe4997b 100644
--- a/test/common/index.mjs
+++ b/test/common/index.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import assert from 'assert';
diff --git a/test/common/internet.js b/test/common/internet.js
index 48b532ca8e..3880aa114e 100644
--- a/test/common/internet.js
+++ b/test/common/internet.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
// Utilities for internet-related tests
diff --git a/test/common/shared-lib-util.js b/test/common/shared-lib-util.js
index 7ff7518ac3..5699c4f74c 100644
--- a/test/common/shared-lib-util.js
+++ b/test/common/shared-lib-util.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
const path = require('path');
diff --git a/test/common/tmpdir.js b/test/common/tmpdir.js
index ed731b3e7a..d0221abbb2 100644
--- a/test/common/tmpdir.js
+++ b/test/common/tmpdir.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
const fs = require('fs');
diff --git a/test/common/wpt.js b/test/common/wpt.js
index 52d8b7a580..7cd644dc88 100644
--- a/test/common/wpt.js
+++ b/test/common/wpt.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
const assert = require('assert');
diff --git a/test/es-module/esm-snapshot-mutator.js b/test/es-module/esm-snapshot-mutator.js
index a0dfa0c28a..6c9a707306 100644
--- a/test/es-module/esm-snapshot-mutator.js
+++ b/test/es-module/esm-snapshot-mutator.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
const shouldSnapshotFilePath = require.resolve('./esm-snapshot.js');
require('./esm-snapshot.js');
diff --git a/test/es-module/esm-snapshot.js b/test/es-module/esm-snapshot.js
index 2c3c3a459a..f52c6f3adf 100644
--- a/test/es-module/esm-snapshot.js
+++ b/test/es-module/esm-snapshot.js
@@ -1,3 +1,3 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
module.exports = 1;
diff --git a/test/es-module/test-esm-example-loader.js b/test/es-module/test-esm-example-loader.js
index 9d1348292c..f7f0fd059a 100644
--- a/test/es-module/test-esm-example-loader.js
+++ b/test/es-module/test-esm-example-loader.js
@@ -1,5 +1,5 @@
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/example-loader.mjs
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import assert from 'assert';
import ok from './test-esm-ok.mjs';
diff --git a/test/es-module/test-esm-forbidden-globals.mjs b/test/es-module/test-esm-forbidden-globals.mjs
index d3e92b9238..d92df1611f 100644
--- a/test/es-module/test-esm-forbidden-globals.mjs
+++ b/test/es-module/test-esm-forbidden-globals.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
if (typeof arguments !== 'undefined') {
throw new Error('not an ESM');
diff --git a/test/es-module/test-esm-json.mjs b/test/es-module/test-esm-json.mjs
index 39279b74e5..5b432e0395 100644
--- a/test/es-module/test-esm-json.mjs
+++ b/test/es-module/test-esm-json.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import '../common/index';
import assert from 'assert';
import ok from './test-esm-ok.mjs';
diff --git a/test/es-module/test-esm-loader-dependency.mjs b/test/es-module/test-esm-loader-dependency.mjs
index 5d05118dbf..260bf613a7 100644
--- a/test/es-module/test-esm-loader-dependency.mjs
+++ b/test/es-module/test-esm-loader-dependency.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/loader-with-dep.mjs
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import './test-esm-ok.mjs';
// We just test that this module doesn't fail loading
diff --git a/test/es-module/test-esm-main-lookup.mjs b/test/es-module/test-esm-main-lookup.mjs
index 7c81cb647c..12f12c845c 100644
--- a/test/es-module/test-esm-main-lookup.mjs
+++ b/test/es-module/test-esm-main-lookup.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import assert from 'assert';
import main from '../fixtures/es-modules/pjson-main';
diff --git a/test/es-module/test-esm-named-exports.mjs b/test/es-module/test-esm-named-exports.mjs
index c70e16e216..9698ae3d9c 100644
--- a/test/es-module/test-esm-named-exports.mjs
+++ b/test/es-module/test-esm-named-exports.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/builtin-named-exports-loader.mjs
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import '../common/index';
import { readFile } from 'fs';
import assert from 'assert';
diff --git a/test/es-module/test-esm-namespace.mjs b/test/es-module/test-esm-namespace.mjs
index f6e550c2e5..6a5ee28a54 100644
--- a/test/es-module/test-esm-namespace.mjs
+++ b/test/es-module/test-esm-namespace.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import '../common/index';
import * as fs from 'fs';
diff --git a/test/es-module/test-esm-ok.mjs b/test/es-module/test-esm-ok.mjs
index 6712e1ab7d..49de5c47ec 100644
--- a/test/es-module/test-esm-ok.mjs
+++ b/test/es-module/test-esm-ok.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
const isJs = true;
export default isJs;
diff --git a/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs b/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs
index bfeb71ef3a..2ca0f56581 100644
--- a/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs
+++ b/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs
@@ -1,3 +1,3 @@
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/not-found-assert-loader.mjs
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import './not-found.js';
diff --git a/test/es-module/test-esm-preserve-symlinks-not-found.mjs b/test/es-module/test-esm-preserve-symlinks-not-found.mjs
index 22c888028e..5119957bae 100644
--- a/test/es-module/test-esm-preserve-symlinks-not-found.mjs
+++ b/test/es-module/test-esm-preserve-symlinks-not-found.mjs
@@ -1,3 +1,3 @@
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/not-found-assert-loader.mjs
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import './not-found';
diff --git a/test/es-module/test-esm-resolve-hook.mjs b/test/es-module/test-esm-resolve-hook.mjs
index dd7ac80bec..e2d20a42d4 100644
--- a/test/es-module/test-esm-resolve-hook.mjs
+++ b/test/es-module/test-esm-resolve-hook.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/js-loader.mjs
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import { namedExport } from '../fixtures/es-module-loaders/js-as-esm.js';
import assert from 'assert';
import ok from './test-esm-ok.mjs';
diff --git a/test/es-module/test-esm-shared-loader-dep.mjs b/test/es-module/test-esm-shared-loader-dep.mjs
index 970bfd7121..03668cbc99 100644
--- a/test/es-module/test-esm-shared-loader-dep.mjs
+++ b/test/es-module/test-esm-shared-loader-dep.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/loader-shared-dep.mjs
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import assert from 'assert';
import './test-esm-ok.mjs';
import dep from '../fixtures/es-module-loaders/loader-dep.js';
diff --git a/test/es-module/test-esm-shebang.mjs b/test/es-module/test-esm-shebang.mjs
index 43cc0f8367..96cec8ea98 100644
--- a/test/es-module/test-esm-shebang.mjs
+++ b/test/es-module/test-esm-shebang.mjs
@@ -1,6 +1,6 @@
#! }]) // isn't js
// Flags: --experimental-modules
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
const isJs = true;
export default isJs;
diff --git a/test/es-module/test-esm-snapshot.mjs b/test/es-module/test-esm-snapshot.mjs
index 878be79a34..4d3cf245a3 100644
--- a/test/es-module/test-esm-snapshot.mjs
+++ b/test/es-module/test-esm-snapshot.mjs
@@ -1,5 +1,5 @@
// Flags: --experimental-modules
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
import '../common/index';
import './esm-snapshot-mutator';
import one from './esm-snapshot';
diff --git a/test/parallel/test-accessor-properties.js b/test/parallel/test-accessor-properties.js
index b4ebf30f9b..713be7eac2 100644
--- a/test/parallel/test-accessor-properties.js
+++ b/test/parallel/test-accessor-properties.js
@@ -51,7 +51,7 @@ const UDP = process.binding('udp_wrap').UDP;
'object'
);
- if (common.hasCrypto) { // eslint-disable-line crypto-check
+ if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
// There are accessor properties in crypto too
const crypto = process.binding('crypto');
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js
index c5a2bfe856..2ea041e1e2 100644
--- a/test/parallel/test-assert.js
+++ b/test/parallel/test-assert.js
@@ -23,7 +23,7 @@
'use strict';
-/* eslint-disable prefer-common-expectserror */
+/* eslint-disable node-core/prefer-common-expectserror */
const common = require('../common');
const assert = require('assert');
diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js
index bf818ed054..30baa30319 100644
--- a/test/parallel/test-buffer-alloc.js
+++ b/test/parallel/test-buffer-alloc.js
@@ -915,7 +915,7 @@ common.expectsError(
}
}
-if (common.hasCrypto) { // eslint-disable-line crypto-check
+if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
// Test truncation after decode
const crypto = require('crypto');
diff --git a/test/parallel/test-buffer-concat.js b/test/parallel/test-buffer-concat.js
index fb29056830..9d6c6c7d35 100644
--- a/test/parallel/test-buffer-concat.js
+++ b/test/parallel/test-buffer-concat.js
@@ -62,7 +62,7 @@ function assertWrongList(value) {
});
}
-// eslint-disable-next-line crypto-check
+// eslint-disable-next-line node-core/crypto-check
const random10 = common.hasCrypto ?
require('crypto').randomBytes(10) :
Buffer.alloc(10, 1);
diff --git a/test/parallel/test-global-console-exists.js b/test/parallel/test-global-console-exists.js
index 1434b76e12..f2e7ba5a9a 100644
--- a/test/parallel/test-global-console-exists.js
+++ b/test/parallel/test-global-console-exists.js
@@ -1,4 +1,4 @@
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
diff --git a/test/parallel/test-http-invalid-urls.js b/test/parallel/test-http-invalid-urls.js
index 51e680071a..9a5567aab8 100644
--- a/test/parallel/test-http-invalid-urls.js
+++ b/test/parallel/test-http-invalid-urls.js
@@ -1,4 +1,4 @@
-/* eslint-disable crypto-check */
+/* eslint-disable node-core/crypto-check */
'use strict';
diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js
index 0dd66d0eb8..f4046c33a1 100644
--- a/test/parallel/test-querystring.js
+++ b/test/parallel/test-querystring.js
@@ -125,9 +125,9 @@ const qsColonTestCases = [
function extendedFunction() {}
extendedFunction.prototype = { a: 'b' };
const qsWeirdObjects = [
- // eslint-disable-next-line no-unescaped-regexp-dot
+ // eslint-disable-next-line node-core/no-unescaped-regexp-dot
[{ regexp: /./g }, 'regexp=', { 'regexp': '' }],
- // eslint-disable-next-line no-unescaped-regexp-dot
+ // eslint-disable-next-line node-core/no-unescaped-regexp-dot
[{ regexp: new RegExp('.', 'g') }, 'regexp=', { 'regexp': '' }],
[{ fn: () => {} }, 'fn=', { 'fn': '' }],
[{ fn: new Function('') }, 'fn=', { 'fn': '' }],
diff --git a/test/parallel/test-regression-object-prototype.js b/test/parallel/test-regression-object-prototype.js
index 01de440344..821c2af584 100644
--- a/test/parallel/test-regression-object-prototype.js
+++ b/test/parallel/test-regression-object-prototype.js
@@ -19,7 +19,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-/* eslint-disable required-modules */
+/* eslint-disable node-core/required-modules */
'use strict';
Object.prototype.xadsadsdasasdxx = function() {
diff --git a/test/sequential/test-async-wrap-getasyncid.js b/test/sequential/test-async-wrap-getasyncid.js
index 1877d53dbf..ce9465d94a 100644
--- a/test/sequential/test-async-wrap-getasyncid.js
+++ b/test/sequential/test-async-wrap-getasyncid.js
@@ -92,7 +92,7 @@ function testInitialized(req, ctor_name) {
}
-if (common.hasCrypto) { // eslint-disable-line crypto-check
+if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
const crypto = require('crypto');
// The handle for PBKDF2 and RandomBytes isn't returned by the function call,
@@ -240,7 +240,7 @@ if (common.hasCrypto) { // eslint-disable-line crypto-check
}
-if (common.hasCrypto) { // eslint-disable-line crypto-check
+if (common.hasCrypto) { // eslint-disable-line node-core/crypto-check
const { TCP, constants: TCPConstants } = process.binding('tcp_wrap');
const tcp = new TCP(TCPConstants.SOCKET);
diff --git a/test/sequential/test-inspector-overwrite-config.js b/test/sequential/test-inspector-overwrite-config.js
index ecb14c6638..2a00b1e079 100644
--- a/test/sequential/test-inspector-overwrite-config.js
+++ b/test/sequential/test-inspector-overwrite-config.js
@@ -8,7 +8,7 @@
// We cannot do a check for the inspector because the configuration variables
// were reset/removed by overwrite-config-preload-module.js.
-/* eslint-disable inspector-check */
+/* eslint-disable node-core/inspector-check */
const common = require('../common');
const assert = require('assert');
diff --git a/tools/node_modules/eslint-plugin-node-core/index.js b/tools/node_modules/eslint-plugin-node-core/index.js
new file mode 100644
index 0000000000..e27945688e
--- /dev/null
+++ b/tools/node_modules/eslint-plugin-node-core/index.js
@@ -0,0 +1,24 @@
+'use strict';
+
+const fs = require('fs');
+const path = require('path');
+
+let cache;
+module.exports = {
+ get rules() {
+ const RULES_DIR = module.exports.RULES_DIR;
+ if (!RULES_DIR)
+ return {};
+
+ if (!cache) {
+ cache = {};
+ const files = fs.readdirSync(RULES_DIR)
+ .filter(filename => filename.endsWith('.js'))
+ for (const file of files) {
+ const name = file.slice(0, -3);
+ cache[name] = require(path.resolve(RULES_DIR, file));
+ }
+ }
+ return cache;
+ },
+};
diff --git a/vcbuild.bat b/vcbuild.bat
index a3d32055de..88693a71cb 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -514,7 +514,7 @@ if defined lint_js_ci goto lint-js-ci
if not defined lint_js goto exit
if not exist tools\node_modules\eslint goto no-lint
echo running lint-js
-%config%\node tools\node_modules\eslint\bin\eslint.js --cache --rule "linebreak-style: 0" --rulesdir=tools\eslint-rules --ext=.js,.mjs,.md benchmark doc lib test tools
+%config%\node tools\node_modules\eslint\bin\eslint.js --cache --rule "linebreak-style: 0" --ext=.js,.mjs,.md benchmark doc lib test tools
goto exit
:lint-js-ci