Skip to content

Commit e8ddf67

Browse files
committed
docs: update docs for rule filename-blocklist
1 parent 02f787d commit e8ddf67

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

docs/rules/filename-blocklist.md

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,22 @@ src/bar.models.ts
3535
The key is used to declare the blocklisted filename pattern, while the value is used to hint at the correct filename that should be used instead. Both the key and value in the blocklist pattern object are glob expressions. The plugin will only check blocklisted pattern you explicitly provided:
3636

3737
```js
38-
module.exports = {
39-
plugins: ['check-file'],
40-
rules: {
41-
'check-file/filename-blocklist': [
42-
'error',
43-
{
44-
'**/*.model.ts': '*.models.ts',
45-
'**/*.util.ts': '*.utils.ts',
46-
},
47-
],
38+
export default [
39+
{
40+
plugins: {
41+
'check-file': checkFile,
42+
},
43+
rules: {
44+
'check-file/filename-blocklist': [
45+
'error',
46+
{
47+
'**/*.model.ts': '*.models.ts',
48+
'**/*.util.ts': '*.utils.ts',
49+
},
50+
],
51+
},
4852
},
49-
};
53+
];
5054
```
5155

5256
#### rule configuration object
@@ -61,19 +65,23 @@ Customizes the error message displayed when a file is blocked due to matching a
6165
When `errorMessage` is set, the suggested glob pattern is not necessary, it can be set as empty string.
6266

6367
```js
64-
module.exports = {
65-
plugins: ['check-file'],
66-
rules: {
67-
'check-file/filename-blocklist': [
68-
'error',
69-
{ '*.models.ts': '' },
70-
{
71-
errorMessage:
72-
'The file "{{ target }}" is blocked since it since it matches the blocklisted pattern "{{ pattern }}", see contribute.md for details',
73-
},
74-
],
68+
export default [
69+
{
70+
plugins: {
71+
'check-file': checkFile,
72+
},
73+
rules: {
74+
'check-file/filename-blocklist': [
75+
'error',
76+
{ '*.models.ts': '' },
77+
{
78+
errorMessage:
79+
'The file "{{ target }}" is blocked since it since it matches the blocklisted pattern "{{ pattern }}", see contribute.md for details',
80+
},
81+
],
82+
},
7583
},
76-
};
84+
];
7785
```
7886

7987
## Further Reading

0 commit comments

Comments
 (0)