forked from mysticatea/eslint-plugin-node
-
-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
Description
It'd be nice to be able to ignore specific deprecation warnings in no-deprecated-api (see #183)
The core of the feature is already implemented in:
eslint-plugin-n/lib/rules/no-unsupported-features/node-builtins.js
Lines 41 to 52 in 85b7945
| ignores: { | |
| type: "array", | |
| items: { | |
| enum: Array.from( | |
| new Set([ | |
| ...enumeratePropertyNames(traceMap.globals), | |
| ...enumeratePropertyNames(traceMap.modules), | |
| ]) | |
| ), | |
| }, | |
| uniqueItems: true, | |
| }, |
eslint-plugin-n/lib/util/check-unsupported-builtins.js
Lines 14 to 30 in 85b7945
| /** | |
| * Parses the options. | |
| * @param {import('eslint').Rule.RuleContext} context The rule context. | |
| * @returns {Readonly<{ | |
| * version: import('semver').Range; | |
| * ignores: Set<string>; | |
| * allowExperimental: boolean; | |
| * }>} Parsed value. | |
| */ | |
| function parseOptions(context) { | |
| const raw = context.options[0] || {} | |
| const version = getConfiguredNodeVersion(context) | |
| const ignores = new Set(raw.ignores || []) | |
| const allowExperimental = raw.allowExperimental ?? false | |
| return Object.freeze({ version, ignores, allowExperimental }) | |
| } |
eslint-plugin-n/lib/util/check-unsupported-builtins.js
Lines 99 to 103 in 85b7945
| const name = unprefixNodeColon(path.join(".")) | |
| if (options.ignores.has(name)) { | |
| continue | |
| } |