eslint-plugin-n
Advanced tools
Comparing version 17.3.1 to 17.4.0
@@ -19,8 +19,4 @@ /** | ||
/** @typedef {import('../unsupported-features/types.js').DeprecatedInfo} DeprecatedInfo */ | ||
/** | ||
* @typedef DeprecatedInfo | ||
* @property {string} since | ||
* @property {string|{ name: string, supported: string }[]|null} replacedBy | ||
*/ | ||
/** | ||
* @typedef ParsedOptions | ||
@@ -630,3 +626,3 @@ * @property {import('semver').Range} version | ||
v8BreakIterator: { | ||
[READ]: { since: "7.0.0", replacedBy: null }, | ||
[READ]: { since: "7.0.0", replacedBy: null, removed: "9.0.0" }, | ||
}, | ||
@@ -750,2 +746,4 @@ }, | ||
"{{name}} was deprecated since v{{version}}{{replace}}.", | ||
removed: | ||
"{{name}} was deprecated since v{{version}}, and removed in v{{removed}}.", | ||
}, | ||
@@ -766,2 +764,10 @@ }, | ||
function reportItem(node, name, info) { | ||
const messageId = info.removed ? "removed" : "deprecated" | ||
const data = { | ||
name, | ||
version: info.since, | ||
removed: info.removed || "", | ||
replace: toReplaceMessage(info.replacedBy, version), | ||
} | ||
context.report({ | ||
@@ -772,8 +778,4 @@ node, | ||
), | ||
messageId: "deprecated", | ||
data: { | ||
name, | ||
version: info.since, | ||
replace: toReplaceMessage(info.replacedBy, version), | ||
}, | ||
messageId, | ||
data, | ||
}) | ||
@@ -780,0 +782,0 @@ } |
@@ -20,4 +20,5 @@ "use strict" | ||
* @typedef DeprecatedInfo | ||
* @property {string} since | ||
* @property {string|{ name: string, supported: string }[]|null} replacedBy | ||
* @property {string} since the version when the API was deprecated. | ||
* @property {string|{ name: string, supported: string }[]|null} replacedBy the text of substitute way. | ||
* @property {string} [removed] the version when the API was removed. | ||
*/ | ||
@@ -24,0 +25,0 @@ |
@@ -7,3 +7,3 @@ /** | ||
const { major, rsort } = require("semver") | ||
const { rsort } = require("semver") | ||
const { ReferenceTracker } = require("@eslint-community/eslint-utils") | ||
@@ -13,2 +13,3 @@ const getConfiguredNodeVersion = require("./get-configured-node-version") | ||
const unprefixNodeColon = require("./unprefix-node-colon") | ||
const semverRangeSubset = require("semver/ranges/subset") | ||
@@ -43,8 +44,3 @@ /** | ||
const range = getSemverRange( | ||
[ | ||
...supported.map( | ||
version => `>= ${version} < ${major(version) + 1}` | ||
), | ||
`> ${major(latest)}`, | ||
].join("||") | ||
[...supported.map(version => `^${version}`), `>= ${latest}`].join("||") | ||
) | ||
@@ -56,3 +52,3 @@ | ||
return configured.intersects(range) | ||
return semverRangeSubset(configured, range) | ||
} | ||
@@ -59,0 +55,0 @@ |
{ | ||
"name": "eslint-plugin-n", | ||
"version": "17.3.1", | ||
"version": "17.4.0", | ||
"description": "Additional ESLint's rules for Node.js", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -14,2 +14,4 @@ export = plugin; | ||
/** @type {import('eslint').ESLint.Plugin & { configs: Configs }} */ | ||
// @ts-ignore | ||
declare const plugin: import('eslint').ESLint.Plugin & { | ||
@@ -19,9 +21,23 @@ configs: Configs; | ||
type Configs = { | ||
'recommended-module': import('eslint').ESLint.ConfigData; | ||
'recommended-script': import('eslint').ESLint.ConfigData; | ||
'recommended': import('eslint').ESLint.ConfigData; | ||
'flat/recommended-module': import('eslint').Linter.FlatConfig; | ||
'flat/recommended-script': import('eslint').Linter.FlatConfig; | ||
'flat/recommended': import('eslint').Linter.FlatConfig; | ||
'flat/mixed-esm-and-cjs': import('eslint').Linter.FlatConfig[]; | ||
// @ts-ignore | ||
'recommended-module': import('eslint').ESLint.ConfigData; | ||
// @ts-ignore | ||
'recommended-script': import('eslint').ESLint.ConfigData; | ||
// @ts-ignore | ||
'recommended': import('eslint').ESLint.ConfigData; | ||
// @ts-ignore | ||
'flat/recommended-module': import('eslint').Linter.FlatConfig; | ||
// @ts-ignore | ||
'flat/recommended-script': import('eslint').Linter.FlatConfig; | ||
// @ts-ignore | ||
'flat/recommended': import('eslint').Linter.FlatConfig; | ||
// @ts-ignore | ||
'flat/mixed-esm-and-cjs': import('eslint').Linter.FlatConfig[]; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
429009
11365