File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,15 @@ const fooNew = 'foo';
22
22
23
23
## Options
24
24
25
- ### ` blacklist `
25
+ ### ` disallowedPrefixes `
26
26
27
- If you want a custom list of forbidden prefixes you can set them with ` blacklist ` :
27
+ If you want a custom list of forbidden prefixes you can set them with ` disallowedPrefixes ` :
28
28
29
29
``` js
30
- // eslint unicorn/no-keyword-prefix: ["error", {"blacklist ": ["new", "for"]}]
30
+ // eslint unicorn/no-keyword-prefix: ["error", {"disallowedPrefixes ": ["new", "for"]}]
31
31
const classFoo = " a" ; // pass
32
32
33
- // eslint unicorn/no-keyword-prefix: ["error", {"blacklist ": ["new", "for"]}]
33
+ // eslint unicorn/no-keyword-prefix: ["error", {"disallowedPrefixes ": ["new", "for"]}]
34
34
const forFoo = " a" ; // fail
35
35
```
36
36
Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ const messages = {
8
8
} ;
9
9
10
10
const prepareOptions = ( {
11
- blacklist ,
11
+ disallowedPrefixes ,
12
12
checkProperties = true ,
13
13
onlyCamelCase = true
14
14
} = { } ) => {
15
15
return {
16
- blacklist : ( blacklist || [
16
+ disallowedPrefixes : ( disallowedPrefixes || [
17
17
'new' ,
18
18
'class'
19
19
] ) ,
@@ -23,7 +23,7 @@ const prepareOptions = ({
23
23
} ;
24
24
25
25
function findKeywordPrefix ( name , options ) {
26
- return options . blacklist . find ( keyword => {
26
+ return options . disallowedPrefixes . find ( keyword => {
27
27
const suffix = options . onlyCamelCase ? '[A-Z]' : '.' ;
28
28
const regex = new RegExp ( `^${ keyword } ${ suffix } ` ) ;
29
29
return name . match ( regex ) ;
@@ -170,7 +170,7 @@ const schema = [
170
170
{
171
171
type : 'object' ,
172
172
properties : {
173
- blacklist : {
173
+ disallowedPrefixes : {
174
174
type : 'array' ,
175
175
items : [
176
176
{
Original file line number Diff line number Diff line change 87
87
} ,
88
88
{
89
89
code : 'const newFoo = "foo"' ,
90
- options : [ { blacklist : [ 'old' ] } ]
90
+ options : [ { disallowedPrefixes : [ 'old' ] } ]
91
91
} ,
92
92
outdent `
93
93
function Foo() {
@@ -262,7 +262,7 @@ test({
262
262
} ,
263
263
{
264
264
code : 'const oldFoo = "foo"' ,
265
- options : [ { blacklist : [ 'old' ] } ] ,
265
+ options : [ { disallowedPrefixes : [ 'old' ] } ] ,
266
266
errors : [ errorIgnoreList ]
267
267
} ,
268
268
{
You can’t perform that action at this time.
0 commit comments