You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules/filename-blocklist.md
+31-23Lines changed: 31 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -35,18 +35,22 @@ src/bar.models.ts
35
35
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:
36
36
37
37
```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
+
exportdefault [
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
+
},
48
52
},
49
-
};
53
+
];
50
54
```
51
55
52
56
#### rule configuration object
@@ -61,19 +65,23 @@ Customizes the error message displayed when a file is blocked due to matching a
61
65
When `errorMessage` is set, the suggested glob pattern is not necessary, it can be set as empty string.
62
66
63
67
```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
+
exportdefault [
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',
0 commit comments