eslint-plugin-node
Advanced tools
Comparing version 7.0.1 to 8.0.0
@@ -33,2 +33,4 @@ { | ||
"node/prefer-global/process": "off", | ||
"node/prefer-global/text-decoder": "off", | ||
"node/prefer-global/text-encoder": "off", | ||
"node/prefer-global/url-search-params": "off", | ||
@@ -35,0 +37,0 @@ "node/prefer-global/url": "off", |
@@ -24,2 +24,4 @@ /* DON'T EDIT THIS FILE. This is generated by 'scripts/update-lib-index.js' */ | ||
"prefer-global/process": require("./rules/prefer-global/process"), | ||
"prefer-global/text-decoder": require("./rules/prefer-global/text-decoder"), | ||
"prefer-global/text-encoder": require("./rules/prefer-global/text-encoder"), | ||
"prefer-global/url-search-params": require("./rules/prefer-global/url-search-params"), | ||
@@ -26,0 +28,0 @@ "prefer-global/url": require("./rules/prefer-global/url"), |
@@ -149,3 +149,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/exports-style.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/exports-style.md", | ||
}, | ||
@@ -152,0 +152,0 @@ fixable: null, |
@@ -83,2 +83,5 @@ /** | ||
crypto: { | ||
_toBuf: { | ||
[READ]: { since: "11.0.0", replacedBy: null }, | ||
}, | ||
Credentials: { | ||
@@ -108,2 +111,11 @@ [READ]: { since: "0.12.0", replacedBy: "'tls.SecureContext'" }, | ||
}, | ||
prng: { | ||
[READ]: { since: "11.0.0", replacedBy: "'crypto.randomBytes()'" }, | ||
}, | ||
pseudoRandomBytes: { | ||
[READ]: { since: "11.0.0", replacedBy: "'crypto.randomBytes()'" }, | ||
}, | ||
rng: { | ||
[READ]: { since: "11.0.0", replacedBy: "'crypto.randomBytes()'" }, | ||
}, | ||
}, | ||
@@ -196,2 +208,5 @@ domain: { | ||
}, | ||
binding: { | ||
[READ]: { since: "10.9.0", replacedBy: null }, | ||
}, | ||
env: { | ||
@@ -289,2 +304,10 @@ NODE_REPL_HISTORY_FILE: { | ||
}, | ||
url: { | ||
parse: { | ||
[READ]: { since: "11.0.0", replacedBy: "'url.URL' constructor" }, | ||
}, | ||
resolve: { | ||
[READ]: { since: "11.0.0", replacedBy: "'url.URL' constructor" }, | ||
}, | ||
}, | ||
util: { | ||
@@ -375,2 +398,20 @@ debug: { | ||
}, | ||
COUNTER_NET_SERVER_CONNECTION: { | ||
[READ]: { since: "11.0.0", replacedBy: null }, | ||
}, | ||
COUNTER_NET_SERVER_CONNECTION_CLOSE: { | ||
[READ]: { since: "11.0.0", replacedBy: null }, | ||
}, | ||
COUNTER_HTTP_SERVER_REQUEST: { | ||
[READ]: { since: "11.0.0", replacedBy: null }, | ||
}, | ||
COUNTER_HTTP_SERVER_RESPONSE: { | ||
[READ]: { since: "11.0.0", replacedBy: null }, | ||
}, | ||
COUNTER_HTTP_CLIENT_REQUEST: { | ||
[READ]: { since: "11.0.0", replacedBy: null }, | ||
}, | ||
COUNTER_HTTP_CLIENT_RESPONSE: { | ||
[READ]: { since: "11.0.0", replacedBy: null }, | ||
}, | ||
GLOBAL: { | ||
@@ -430,3 +471,3 @@ [READ]: { since: "6.0.0", replacedBy: "'global'" }, | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-deprecated-api.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-deprecated-api.md", | ||
}, | ||
@@ -433,0 +474,0 @@ fixable: null, |
@@ -21,3 +21,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-extraneous-import.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-extraneous-import.md", | ||
}, | ||
@@ -24,0 +24,0 @@ fixable: null, |
@@ -21,3 +21,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-extraneous-require.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-extraneous-require.md", | ||
}, | ||
@@ -24,0 +24,0 @@ fixable: null, |
@@ -48,3 +48,3 @@ /** | ||
]) | ||
const BACK_SLASH = /\\/g | ||
const BACK_SLASH = /\\/gu | ||
@@ -59,3 +59,3 @@ module.exports = { | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-hide-core-modules.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-hide-core-modules.md", | ||
}, | ||
@@ -62,0 +62,0 @@ deprecated: true, |
@@ -20,3 +20,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-missing-import.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-missing-import.md", | ||
}, | ||
@@ -23,0 +23,0 @@ fixable: null, |
@@ -20,3 +20,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-missing-require.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-missing-require.md", | ||
}, | ||
@@ -23,0 +23,0 @@ fixable: null, |
@@ -39,3 +39,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-unpublished-bin.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-unpublished-bin.md", | ||
}, | ||
@@ -72,3 +72,3 @@ fixable: null, | ||
const relativePath = getConvertPath(context)( | ||
path.relative(basedir, rawFilePath).replace(/\\/g, "/") | ||
path.relative(basedir, rawFilePath).replace(/\\/gu, "/") | ||
) | ||
@@ -75,0 +75,0 @@ const filePath = path.join(basedir, relativePath) |
@@ -21,3 +21,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-unpublished-import.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-unpublished-import.md", | ||
}, | ||
@@ -24,0 +24,0 @@ fixable: null, |
@@ -21,3 +21,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-unpublished-require.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-unpublished-require.md", | ||
}, | ||
@@ -24,0 +24,0 @@ fixable: null, |
@@ -35,10 +35,10 @@ /** | ||
const DEFAULT_VERSION = "4.0.0" | ||
const FUNC_TYPE = /^(?:Arrow)?Function(?:Declaration|Expression)$/ | ||
const CLASS_TYPE = /^Class(?:Declaration|Expression)$/ | ||
const DESTRUCTURING_PARENT_TYPE = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression|AssignmentExpression|VariableDeclarator)$/ | ||
const TOPLEVEL_SCOPE_TYPE = /^(?:global|function|module)$/ | ||
const BINARY_NUMBER = /^0[bB]/ | ||
const OCTAL_NUMBER = /^0[oO]/ | ||
const UNICODE_ESC = /(\\+)u\{[0-9a-fA-F]+?\}/g | ||
const GET_OR_SET = /^(?:g|s)et$/ | ||
const FUNC_TYPE = /^(?:Arrow)?Function(?:Declaration|Expression)$/u | ||
const CLASS_TYPE = /^Class(?:Declaration|Expression)$/u | ||
const DESTRUCTURING_PARENT_TYPE = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression|AssignmentExpression|VariableDeclarator)$/u | ||
const TOPLEVEL_SCOPE_TYPE = /^(?:global|function|module)$/u | ||
const BINARY_NUMBER = /^0[bB]/u | ||
const OCTAL_NUMBER = /^0[oO]/u | ||
const UNICODE_ESC = /(\\+)u\{[0-9a-fA-F]+?\}/gu | ||
const GET_OR_SET = /^(?:g|s)et$/u | ||
const NEW_BUILTIN_TYPES = [ | ||
@@ -145,5 +145,5 @@ "Int8Array", | ||
} | ||
const REGEXP_NAMED_GROUP = /(\\*)\(\?<[_$\w]/ | ||
const REGEXP_LOOKBEHIND = /(\\*)\(\?<[=!]/ | ||
const REGEXP_UNICODE_PROPERTY = /(\\*)\\[pP]{.+?}/ | ||
const REGEXP_NAMED_GROUP = /(\\*)\(\?<[_$\w]/u | ||
const REGEXP_LOOKBEHIND = /(\\*)\(\?<[=!]/u | ||
const REGEXP_UNICODE_PROPERTY = /(\\*)\\[pP]\{.+?\}/u | ||
const FEATURES = { | ||
@@ -1051,5 +1051,8 @@ defaultParameters: { | ||
recommended: false, | ||
replacedBy: ["no-unsupported-ecma-features"], | ||
replacedBy: [ | ||
"no-unsupported-features/es-syntax", | ||
"no-unsupported-features/es-builtins", | ||
], | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-unsupported-features.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-unsupported-features.md", | ||
}, | ||
@@ -1056,0 +1059,0 @@ deprecated: true, |
@@ -131,3 +131,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-unsupported-features/es-builtins.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-unsupported-features/es-builtins.md", | ||
}, | ||
@@ -134,0 +134,0 @@ fixable: null, |
@@ -13,3 +13,3 @@ /** | ||
const getOrSet = /^(?:g|s)et$/ | ||
const getOrSet = /^(?:g|s)et$/u | ||
const features = { | ||
@@ -508,3 +508,3 @@ //-------------------------------------------------------------------------- | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-unsupported-features/es-syntax.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-unsupported-features/es-syntax.md", | ||
}, | ||
@@ -511,0 +511,0 @@ fixable: null, |
@@ -14,2 +14,3 @@ /** | ||
globals: { | ||
queueMicrotask: { [READ]: { supported: "11.0.0" } }, | ||
require: { | ||
@@ -64,2 +65,3 @@ resolve: { | ||
profileEnd: { [READ]: { supported: "8.0.0" } }, | ||
timeLog: { [READ]: { supported: "10.7.0" } }, | ||
timeStamp: { [READ]: { supported: "8.0.0" } }, | ||
@@ -77,2 +79,4 @@ timeline: { [READ]: { supported: "8.0.0" } }, | ||
fips: { [READ]: { supported: "6.0.0" } }, | ||
generateKeyPair: { [READ]: { supported: "10.12.0" } }, | ||
generateKeyPairSync: { [READ]: { supported: "10.12.0" } }, | ||
getCurves: { [READ]: { supported: "2.3.0" } }, | ||
@@ -97,2 +101,3 @@ getFips: { [READ]: { supported: "10.0.0" } }, | ||
fs: { | ||
Dirent: { [READ]: { supported: "10.10.0" } }, | ||
copyFile: { [READ]: { supported: "8.5.0" } }, | ||
@@ -122,4 +127,9 @@ copyFileSync: { [READ]: { supported: "8.5.0" } }, | ||
os: { | ||
constants: { [READ]: { supported: "6.3.0" } }, | ||
constants: { | ||
[READ]: { supported: "6.3.0" }, | ||
priority: { [READ]: { supported: "10.10.0" } }, | ||
}, | ||
getPriority: { [READ]: { supported: "10.10.0" } }, | ||
homedir: { [READ]: { supported: "2.3.0" } }, | ||
setPriority: { [READ]: { supported: "10.10.0" } }, | ||
userInfo: { [READ]: { supported: "6.0.0" } }, | ||
@@ -134,2 +144,3 @@ }, | ||
process: { | ||
allowedNodeEnvironmentFlags: { [READ]: { supported: "10.10.0" } }, | ||
argv0: { [READ]: { supported: "6.4.0" } }, | ||
@@ -144,2 +155,5 @@ channel: { [READ]: { supported: "7.1.0" } }, | ||
}, | ||
hrtime: { | ||
bigint: { [READ]: { supported: "10.7.0" } }, | ||
}, | ||
ppid: { [READ]: { supported: "9.2.0" } }, | ||
@@ -180,2 +194,3 @@ release: { [READ]: { supported: "3.0.0" } }, | ||
[READ]: { supported: "10.0.0" }, | ||
isBoxedPrimitive: { [READ]: { supported: "10.11.0" } }, | ||
}, | ||
@@ -196,2 +211,3 @@ }, | ||
Module: { [READ]: { supported: "9.6.0" } }, | ||
compileFunction: { [READ]: { supported: "10.10.0" } }, | ||
}, | ||
@@ -205,2 +221,8 @@ worker_threads: { | ||
Buffer: trackMap.modules.buffer.Buffer, | ||
TextDecoder: Object.assign({}, trackMap.modules.util.TextDecoder, { | ||
[READ]: { supported: "11.0.0" }, | ||
}), | ||
TextEncoder: Object.assign({}, trackMap.modules.util.TextEncoder, { | ||
[READ]: { supported: "11.0.0" }, | ||
}), | ||
URL: Object.assign({}, trackMap.modules.url.URL, { | ||
@@ -225,3 +247,3 @@ [READ]: { supported: "10.0.0" }, | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/no-unsupported-features/node-builtins.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/no-unsupported-features/node-builtins.md", | ||
}, | ||
@@ -228,0 +250,0 @@ fixable: null, |
@@ -29,3 +29,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/prefer-global/buffer.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/prefer-global/buffer.md", | ||
}, | ||
@@ -32,0 +32,0 @@ fixable: null, |
@@ -26,3 +26,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/prefer-global/console.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/prefer-global/console.md", | ||
}, | ||
@@ -29,0 +29,0 @@ fixable: null, |
@@ -26,3 +26,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/prefer-global/process.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/prefer-global/process.md", | ||
}, | ||
@@ -29,0 +29,0 @@ fixable: null, |
@@ -29,3 +29,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/prefer-global/url-search-params.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/prefer-global/url-search-params.md", | ||
}, | ||
@@ -32,0 +32,0 @@ fixable: null, |
@@ -28,3 +28,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/prefer-global/url.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/prefer-global/url.md", | ||
}, | ||
@@ -31,0 +31,0 @@ fixable: null, |
@@ -147,3 +147,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/process-exit-as-throw.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/process-exit-as-throw.md", | ||
}, | ||
@@ -150,0 +150,0 @@ fixable: null, |
@@ -12,4 +12,4 @@ /** | ||
const NODE_SHEBANG = "#!/usr/bin/env node\n" | ||
const SHEBANG_PATTERN = /^(#!.+?)?(\r)?\n/ | ||
const NODE_SHEBANG_PATTERN = /#!\/usr\/bin\/env node(?: [^\r\n]+?)?\n/ | ||
const SHEBANG_PATTERN = /^(#!.+?)?(\r)?\n/u | ||
const NODE_SHEBANG_PATTERN = /#!\/usr\/bin\/env node(?: [^\r\n]+?)?\n/u | ||
@@ -62,3 +62,3 @@ /** | ||
url: | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v7.0.1/docs/rules/shebang.md", | ||
"https://github.com/mysticatea/eslint-plugin-node/blob/v8.0.0/docs/rules/shebang.md", | ||
}, | ||
@@ -94,3 +94,3 @@ fixable: "code", | ||
getConvertPath(context)( | ||
path.relative(basedir, filePath).replace(/\\/g, "/") | ||
path.relative(basedir, filePath).replace(/\\/gu, "/") | ||
) | ||
@@ -97,0 +97,0 @@ ) |
@@ -34,3 +34,3 @@ /** | ||
const toRelative = fullPath => { | ||
const retv = path.relative(basedir, fullPath).replace(/\\/g, "/") | ||
const retv = path.relative(basedir, fullPath).replace(/\\/gu, "/") | ||
return convertPath(retv) | ||
@@ -37,0 +37,0 @@ } |
@@ -11,3 +11,3 @@ /** | ||
const ROOT = /^(?:[/.]|\.\.|[A-Z]:\\|\\\\)(?:[/\\]\.\.)*$/ | ||
const ROOT = /^(?:[/.]|\.\.|[A-Z]:\\|\\\\)(?:[/\\]\.\.)*$/u | ||
const cache = new Cache() | ||
@@ -14,0 +14,0 @@ |
@@ -112,3 +112,3 @@ /** | ||
const exclude = toStringArray(pattern.exclude) | ||
const fromRegexp = new RegExp(String(pattern.replace[0])) | ||
const fromRegexp = new RegExp(String(pattern.replace[0])) //eslint-disable-line require-unicode-regexp | ||
const toStr = String(pattern.replace[1]) | ||
@@ -115,0 +115,0 @@ |
@@ -14,3 +14,3 @@ /** | ||
const MODULE_TYPE = /^(?:Import|Export(?:Named|Default|All))Declaration$/ | ||
const MODULE_TYPE = /^(?:Import|Export(?:Named|Default|All))Declaration$/u | ||
@@ -17,0 +17,0 @@ /** |
@@ -15,5 +15,5 @@ /** | ||
const cache = new Cache() | ||
const SLASH_AT_BEGIN_AND_END = /^!?\/+|^!|\/+$/g | ||
const PARENT_RELATIVE_PATH = /^\.\./ | ||
const NEVER_IGNORED = /^(?:readme\.[^.]*|(?:licen[cs]e|changes|changelog|history)(?:\.[^.]*)?)$/i | ||
const SLASH_AT_BEGIN_AND_END = /^!?\/+|^!|\/+$/gu | ||
const PARENT_RELATIVE_PATH = /^\.\./u | ||
const NEVER_IGNORED = /^(?:readme\.[^.]*|(?:licen[cs]e|changes|changelog|history)(?:\.[^.]*)?)$/iu | ||
@@ -20,0 +20,0 @@ /** |
@@ -57,3 +57,3 @@ /** | ||
constructor(node, name, options) { | ||
const isModule = !/^(?:[./\\]|\w+:)/.test(name) | ||
const isModule = !/^(?:[./\\]|\w+:)/u.test(name) | ||
@@ -60,0 +60,0 @@ /** |
{ | ||
"name": "eslint-plugin-node", | ||
"version": "7.0.1", | ||
"version": "8.0.0", | ||
"description": "Additional ESLint's rules for Node.js", | ||
@@ -18,3 +18,3 @@ "engines": { | ||
"eslint-utils": "^1.3.1", | ||
"ignore": "^4.0.2", | ||
"ignore": "^5.0.2", | ||
"minimatch": "^3.0.4", | ||
@@ -25,5 +25,5 @@ "resolve": "^1.8.1", | ||
"devDependencies": { | ||
"@mysticatea/eslint-plugin": "^5.1.0", | ||
"@mysticatea/eslint-plugin": "^7.0.0", | ||
"codecov": "^3.0.4", | ||
"eslint": "^5.1.0", | ||
"eslint": "^5.8.0", | ||
"fast-glob": "^2.2.2", | ||
@@ -30,0 +30,0 @@ "mocha": "^5.2.0", |
@@ -33,3 +33,3 @@ # eslint-plugin-node | ||
"node/prefer-global/url-search-params": ["error", "always"], | ||
"node/prefer-global/url": ["error", "always"], | ||
"node/prefer-global/url": ["error", "always"] | ||
} | ||
@@ -88,5 +88,16 @@ } | ||
| [node/prefer-global/process](./docs/rules/prefer-global/process.md) | enforce either `process` or `require("process")` | | | ||
| [node/prefer-global/text-decoder](./docs/rules/prefer-global/text-decoder.md) | enforce either `TextDecoder` or `require("util").TextDecoder` | | | ||
| [node/prefer-global/text-encoder](./docs/rules/prefer-global/text-encoder.md) | enforce either `TextEncoder` or `require("util").TextEncoder` | | | ||
| [node/prefer-global/url-search-params](./docs/rules/prefer-global/url-search-params.md) | enforce either `URLSearchParams` or `require("url").URLSearchParams` | | | ||
| [node/prefer-global/url](./docs/rules/prefer-global/url.md) | enforce either `URL` or `require("url").URL` | | | ||
### Deprecated rules | ||
These rules have been deprecated in accordance with the [deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), and replaced by newer rules: | ||
| Rule ID | Replaced by | | ||
|:--------|:------------| | ||
| [node/no-hide-core-modules](./docs/rules/no-hide-core-modules.md) | (nothing) | | ||
| [node/no-unsupported-features](./docs/rules/no-unsupported-features.md) | [node/no-unsupported-features/es-syntax](./docs/rules/no-unsupported-features/es-syntax.md) and [node/no-unsupported-features/es-builtins](./docs/rules/no-unsupported-features/es-builtins.md) | | ||
<!--RULES_TABLE_END--> | ||
@@ -93,0 +104,0 @@ |
194796
48
5642
157
- Removedignore@4.0.6(transitive)
Updatedignore@^5.0.2