Skip to content

Commit

Permalink
Fix: deprecates id-blacklist (and documents deprecation)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitropoulos committed Jul 7, 2020
1 parent b55fd3b commit 1d9a8bf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
3 changes: 3 additions & 0 deletions docs/rules/id-blacklist.md
@@ -0,0 +1,3 @@
# disallow specified identifiers (id-blacklist)

This rule has been deprecated. Please see the [`id-denylist`]('./id-blacklist') rule.
22 changes: 22 additions & 0 deletions lib/rules/id-blacklist.js
@@ -0,0 +1,22 @@
/**
* @fileoverview Rule that warns when identifier names that are
* specified in the configuration are used.
* @author Keith Cirkel (http://keithcirkel.co.uk)
*/

"use strict";

const idDenylist = require("./id-denylist");

// `id-blacklist` has been renamed to `id-denylist`
module.exports = {

// eslint-disable-next-line internal-rules/consistent-docs-url, internal-rules/no-invalid-meta
meta: Object.assign({}, {
deprecated: true,
docs: Object.assign({}, {
url: "https://eslint.org/docs/rules/id-blacklist"
}, idDenylist.meta.docs)
}, idDenylist.meta),
create: idDenylist.create
};
4 changes: 1 addition & 3 deletions lib/rules/index.js
Expand Up @@ -56,9 +56,7 @@ module.exports = new LazyLoadingRuleMap(Object.entries({
"grouped-accessor-pairs": () => require("./grouped-accessor-pairs"),
"guard-for-in": () => require("./guard-for-in"),
"handle-callback-err": () => require("./handle-callback-err"),

// Renamed to id-denylist.
"id-blacklist": () => require("./id-denylist"),
"id-blacklist": () => require("./id-blacklist"),
"id-denylist": () => require("./id-denylist"),
"id-length": () => require("./id-length"),
"id-match": () => require("./id-match"),
Expand Down
1 change: 1 addition & 0 deletions tools/rule-types.json
Expand Up @@ -43,6 +43,7 @@
"grouped-accessor-pairs": "suggestion",
"guard-for-in": "suggestion",
"handle-callback-err": "suggestion",
"id-blacklist": "suggestion",
"id-denylist": "suggestion",
"id-length": "suggestion",
"id-match": "suggestion",
Expand Down

0 comments on commit 1d9a8bf

Please sign in to comment.