Skip to content

Commit 73ad195

Browse files
authored
refactor: update blacklist to blocklist to remove noninclusive language (#16)
1 parent 12c3d59 commit 73ad195

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Then configure the rules you want to use under the rules section.
6464
"mocks/*/": "KEBAB_CASE"
6565
}
6666
],
67-
"check-file/filename-blacklist": [
67+
"check-file/filename-blocklist": [
6868
"error",
6969
{
7070
"**/*.model.ts": "*.models.ts",
@@ -81,7 +81,7 @@ Then configure the rules you want to use under the rules section.
8181
- [check-file/filename-naming-convention](docs/rules/filename-naming-convention.md): Enforce a consistent naming pattern for the filename of the specified file
8282
- [check-file/no-index](docs/rules/no-index.md): A file cannot be named "index"
8383
- [check-file/folder-naming-convention](docs/rules/folder-naming-convention.md): Enforce a consistent naming pattern for the name of the specified folder
84-
- [check-file/filename-blacklist](docs/rules/filename-blacklist.md): Blacklist file names by pattern
84+
- [check-file/filename-blocklist](docs/rules/filename-blocklist.md): Blocklist file names by pattern
8585

8686

8787
[npm-image]: https://img.shields.io/npm/v/eslint-plugin-check-file.svg

docs/rules/filename-blacklist.md renamed to docs/rules/filename-blocklist.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# The filename should not be blacklisted (filename-blacklist)
1+
# The filename should be blocklisted (filename-blocklist)
22

3-
Allows you to blacklist certain file name patterns.
3+
Allows you to blocklist certain file name patterns.
44

55
## Rule Details
66

@@ -9,7 +9,7 @@ This rule aims to maintain a consistent naming scheme.
99
If the rule had been set as follows:
1010
```js
1111
...
12-
'check-file/filename-blacklist': ['error', { '**/*.model.ts': '*.models.ts' }],
12+
'check-file/filename-blocklist': ['error', { '**/*.model.ts': '*.models.ts' }],
1313
...
1414
```
1515

@@ -28,17 +28,17 @@ src/bar.models.ts
2828

2929
### Options
3030

31-
#### blacklist pattern object
31+
#### blocklist pattern object
3232

33-
You need to specify a different naming pattern for each filename blacklist. The second pattern is used to hint at the correct file name that should be used instead.
33+
You need to specify a different naming pattern for each filename blocklist. The second pattern is used to hint at the correct file name that should be used instead.
3434

3535
```js
3636
module.exports = {
3737
plugins: [
3838
'check-file',
3939
],
4040
rules: {
41-
'check-file/filename-blacklist': ['error', {
41+
'check-file/filename-blocklist': ['error', {
4242
'**/*.model.ts': '*.models.ts',
4343
'**/*.util.ts': '*.utils.ts',
4444
}],

lib/rules/filename-blacklist.js renamed to lib/rules/filename-blocklist.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file The filename should not be blacklisted.
2+
* @file The filename should be blocklisted.
33
* @author Florian Ehmke
44
*/
55
'use strict';
@@ -17,10 +17,10 @@ module.exports = {
1717
meta: {
1818
type: 'layout',
1919
docs: {
20-
description: 'The filename should not be blacklisted',
20+
description: 'The filename should be blocklisted',
2121
category: 'Layout & Formatting',
2222
recommended: false,
23-
url: getDocUrl('filename-blacklist'),
23+
url: getDocUrl('filename-blocklist'),
2424
},
2525
fixable: null,
2626
schema: [
@@ -58,21 +58,21 @@ module.exports = {
5858
const filenameWithPath = getFilePath(context);
5959
const filename = getFilename(filenameWithPath);
6060

61-
for (const [blackListPattern, useInsteadPattern] of Object.entries(
61+
for (const [blockListPattern, useInsteadPattern] of Object.entries(
6262
rules
6363
)) {
64-
const matchResult = matchRule(filename, blackListPattern);
64+
const matchResult = matchRule(filename, blockListPattern);
6565

6666
if (matchResult) {
6767
const { path } = matchResult;
6868

6969
context.report({
7070
node,
7171
message:
72-
'The filename "{{ path }}" matches the blacklisted "{{ blackListPattern }}" pattern. Use a pattern like "{{ useInsteadPattern }}" instead.',
72+
'The filename "{{ path }}" matches the blocklisted "{{ blockListPattern }}" pattern. Use a pattern like "{{ useInsteadPattern }}" instead.',
7373
data: {
7474
path,
75-
blackListPattern,
75+
blockListPattern,
7676
useInsteadPattern,
7777
},
7878
});

tests/lib/rules/filename-blacklist.posix.js renamed to tests/lib/rules/filename-blocklist.posix.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file The filename should not be blacklisted
2+
* @file The filename should be blocklisted
33
* @author Florian Ehmke, Duke Luo
44
*/
55
'use strict';
@@ -8,13 +8,13 @@ const path = require('path');
88
const proxyquire = require('proxyquire');
99
const RuleTester = require('eslint').RuleTester;
1010

11-
const rule = proxyquire('../../../lib/rules/filename-blacklist', {
11+
const rule = proxyquire('../../../lib/rules/filename-blocklist', {
1212
path: { ...path.posix, '@global': true },
1313
});
1414
const ruleTester = new RuleTester();
1515

1616
ruleTester.run(
17-
"filename-blacklist with option: [{ '*.models.ts': '*.model.ts', '*.utils.ts': '*.util.ts' }]",
17+
"filename-blocklist with option: [{ '*.models.ts': '*.model.ts', '*.utils.ts': '*.util.ts' }]",
1818
rule,
1919
{
2020
valid: [
@@ -42,7 +42,7 @@ ruleTester.run(
4242
errors: [
4343
{
4444
message:
45-
'The filename "foo.models.ts" matches the blacklisted "*.models.ts" pattern. Use a pattern like "*.model.ts" instead.',
45+
'The filename "foo.models.ts" matches the blocklisted "*.models.ts" pattern. Use a pattern like "*.model.ts" instead.',
4646
column: 1,
4747
line: 1,
4848
},
@@ -55,7 +55,7 @@ ruleTester.run(
5555
errors: [
5656
{
5757
message:
58-
'The filename "foo.utils.ts" matches the blacklisted "*.utils.ts" pattern. Use a pattern like "*.util.ts" instead.',
58+
'The filename "foo.utils.ts" matches the blocklisted "*.utils.ts" pattern. Use a pattern like "*.util.ts" instead.',
5959
column: 1,
6060
line: 1,
6161
},
@@ -66,7 +66,7 @@ ruleTester.run(
6666
);
6767

6868
ruleTester.run(
69-
"filename-blacklist with option: [{ '*.models.ts': 'FOO' }]",
69+
"filename-blocklist with option: [{ '*.models.ts': 'FOO' }]",
7070
rule,
7171
{
7272
valid: [],
@@ -89,7 +89,7 @@ ruleTester.run(
8989
);
9090

9191
ruleTester.run(
92-
"filename-blacklist with option: [{ 'models.ts': '*.model.ts' }]",
92+
"filename-blocklist with option: [{ 'models.ts': '*.model.ts' }]",
9393
rule,
9494
{
9595
valid: [],

tests/lib/rules/filename-blacklist.windows.js renamed to tests/lib/rules/filename-blocklist.windows.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @file The filename should not be blacklisted
2+
* @file The filename should be blocklisted
33
* @author Duke Luo
44
*/
55
'use strict';
@@ -8,13 +8,13 @@ const path = require('path');
88
const proxyquire = require('proxyquire');
99
const RuleTester = require('eslint').RuleTester;
1010

11-
const rule = proxyquire('../../../lib/rules/filename-blacklist', {
11+
const rule = proxyquire('../../../lib/rules/filename-blocklist', {
1212
path: { ...path.win32, '@global': true },
1313
});
1414
const ruleTester = new RuleTester();
1515

1616
ruleTester.run(
17-
"filename-blacklist with option on Windows: [{ '*.models.ts': '*.model.ts' }]",
17+
"filename-blocklist with option on Windows: [{ '*.models.ts': '*.model.ts' }]",
1818
rule,
1919
{
2020
valid: [
@@ -38,7 +38,7 @@ ruleTester.run(
3838
errors: [
3939
{
4040
message:
41-
'The filename "foo.models.ts" matches the blacklisted "*.models.ts" pattern. Use a pattern like "*.model.ts" instead.',
41+
'The filename "foo.models.ts" matches the blocklisted "*.models.ts" pattern. Use a pattern like "*.model.ts" instead.',
4242
column: 1,
4343
line: 1,
4444
},
@@ -51,7 +51,7 @@ ruleTester.run(
5151
errors: [
5252
{
5353
message:
54-
'The filename "foo.models.ts" matches the blacklisted "*.models.ts" pattern. Use a pattern like "*.model.ts" instead.',
54+
'The filename "foo.models.ts" matches the blocklisted "*.models.ts" pattern. Use a pattern like "*.model.ts" instead.',
5555
column: 1,
5656
line: 1,
5757
},
@@ -62,7 +62,7 @@ ruleTester.run(
6262
);
6363

6464
ruleTester.run(
65-
"filename-blacklist with option on Windows: [{ '*.models.ts': 'FOO' }]",
65+
"filename-blocklist with option on Windows: [{ '*.models.ts': 'FOO' }]",
6666
rule,
6767
{
6868
valid: [],
@@ -85,7 +85,7 @@ ruleTester.run(
8585
);
8686

8787
ruleTester.run(
88-
"filename-blacklist with option on Windows: [{ 'models.ts': '*.model.ts' }]",
88+
"filename-blocklist with option on Windows: [{ 'models.ts': '*.model.ts' }]",
8989
rule,
9090
{
9191
valid: [],

0 commit comments

Comments
 (0)