Skip to content

Commit 9257993

Browse files
committed
feat: using 'filename' than 'filenameWithPath' for the error message of folder-match-with-fex
1 parent c00aa8b commit 9257993

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

lib/constants/message.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const FILENAME_NAMING_CONVENTION_ERROR_MESSAGE =
1919
'The filename "{{ filename }}" does not match the "{{ originalNamingPattern }}" pattern';
2020

2121
export const FOLDER_MATCH_WITH_FEX_ERROR_MESSAGE =
22-
'The folder of the file "{{ filenameWithPath }}" does not match the "{{ folderPattern }}" pattern';
22+
'The folder of the file "{{ filename }}" does not match the "{{ folderPattern }}" pattern';
2323

2424
export const FOLDER_NAMING_CONVENTION_ERROR_MESSAGE =
2525
'The folder "{{ folder }}" does not match the "{{ namingPattern }}" pattern';

lib/rules/folder-match-with-fex.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default {
100100
node,
101101
messageId: 'noMatch',
102102
data: {
103-
filenameWithPath,
103+
filename,
104104
folderPattern,
105105
},
106106
});

tests/lib/rules/folder-match-with-fex.posix.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ruleTester.run(
5151
errors: [
5252
{
5353
message:
54-
'The folder of the file "/bar/__test__/foo.test.js" does not match the "**/__tests__/" pattern',
54+
'The folder of the file "foo.test.js" does not match the "**/__tests__/" pattern',
5555
column: 1,
5656
line: 1,
5757
},
@@ -86,7 +86,7 @@ ruleTester.run(
8686
errors: [
8787
{
8888
message:
89-
'The folder of the file "/__test__/foo.test.js" does not match the "*/__tests__/" pattern',
89+
'The folder of the file "foo.test.js" does not match the "*/__tests__/" pattern',
9090
column: 1,
9191
line: 1,
9292
},
@@ -99,7 +99,7 @@ ruleTester.run(
9999
errors: [
100100
{
101101
message:
102-
'The folder of the file "/bar/__tests__/foo.test.js" does not match the "*/__tests__/" pattern',
102+
'The folder of the file "foo.test.js" does not match the "*/__tests__/" pattern',
103103
column: 1,
104104
line: 1,
105105
},
@@ -112,7 +112,7 @@ ruleTester.run(
112112
errors: [
113113
{
114114
message:
115-
'The folder of the file "__tests__/foo.test.js" does not match the "*/__tests__/" pattern',
115+
'The folder of the file "foo.test.js" does not match the "*/__tests__/" pattern',
116116
column: 1,
117117
line: 1,
118118
},
@@ -157,7 +157,7 @@ ruleTester.run(
157157
errors: [
158158
{
159159
message:
160-
'The folder of the file "bar/_tests_/foo.test.js" does not match the "*/__tests__/" pattern',
160+
'The folder of the file "foo.test.js" does not match the "*/__tests__/" pattern',
161161
column: 1,
162162
line: 1,
163163
},
@@ -170,7 +170,7 @@ ruleTester.run(
170170
errors: [
171171
{
172172
message:
173-
'The folder of the file "bar/_tests_/foo.test.jsx" does not match the "*/__tests__/" pattern',
173+
'The folder of the file "foo.test.jsx" does not match the "*/__tests__/" pattern',
174174
column: 1,
175175
line: 1,
176176
},
@@ -183,7 +183,7 @@ ruleTester.run(
183183
errors: [
184184
{
185185
message:
186-
'The folder of the file "bar/_tests_/foo.test.ts" does not match the "*/__tests__/" pattern',
186+
'The folder of the file "foo.test.ts" does not match the "*/__tests__/" pattern',
187187
column: 1,
188188
line: 1,
189189
},
@@ -196,7 +196,7 @@ ruleTester.run(
196196
errors: [
197197
{
198198
message:
199-
'The folder of the file "bar/_tests_/foo.test.tsx" does not match the "*/__tests__/" pattern',
199+
'The folder of the file "foo.test.tsx" does not match the "*/__tests__/" pattern',
200200
column: 1,
201201
line: 1,
202202
},
@@ -231,7 +231,7 @@ ruleTester.run(
231231
errors: [
232232
{
233233
message:
234-
'The folder of the file "bar/_tests_/foo.test.js" does not match the "*/__tests__/" pattern',
234+
'The folder of the file "foo.test.js" does not match the "*/__tests__/" pattern',
235235
column: 1,
236236
line: 1,
237237
},
@@ -244,7 +244,7 @@ ruleTester.run(
244244
errors: [
245245
{
246246
message:
247-
'The folder of the file "bar/_tests_/foo.test.ts" does not match the "*/__tests__/" pattern',
247+
'The folder of the file "foo.test.ts" does not match the "*/__tests__/" pattern',
248248
column: 1,
249249
line: 1,
250250
},

tests/lib/rules/folder-match-with-fex.windows.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ruleTester.run(
5151
errors: [
5252
{
5353
message:
54-
'The folder of the file "bar/__test__/foo.test.js" does not match the "**/__tests__/" pattern',
54+
'The folder of the file "foo.test.js" does not match the "**/__tests__/" pattern',
5555
column: 1,
5656
line: 1,
5757
},
@@ -81,7 +81,7 @@ ruleTester.run(
8181
errors: [
8282
{
8383
message:
84-
'The folder of the file "__tests__/foo.test.js" does not match the "*/__tests__/" pattern',
84+
'The folder of the file "foo.test.js" does not match the "*/__tests__/" pattern',
8585
column: 1,
8686
line: 1,
8787
},
@@ -94,7 +94,7 @@ ruleTester.run(
9494
errors: [
9595
{
9696
message:
97-
'The folder of the file "__test__/foo.test.js" does not match the "*/__tests__/" pattern',
97+
'The folder of the file "foo.test.js" does not match the "*/__tests__/" pattern',
9898
column: 1,
9999
line: 1,
100100
},
@@ -107,7 +107,7 @@ ruleTester.run(
107107
errors: [
108108
{
109109
message:
110-
'The folder of the file "__tests__/foo.test.js" does not match the "*/__tests__/" pattern',
110+
'The folder of the file "foo.test.js" does not match the "*/__tests__/" pattern',
111111
column: 1,
112112
line: 1,
113113
},
@@ -152,7 +152,7 @@ ruleTester.run(
152152
errors: [
153153
{
154154
message:
155-
'The folder of the file "bar/_tests_/foo.test.js" does not match the "*/__tests__/" pattern',
155+
'The folder of the file "foo.test.js" does not match the "*/__tests__/" pattern',
156156
column: 1,
157157
line: 1,
158158
},
@@ -165,7 +165,7 @@ ruleTester.run(
165165
errors: [
166166
{
167167
message:
168-
'The folder of the file "bar/_tests_/foo.test.jsx" does not match the "*/__tests__/" pattern',
168+
'The folder of the file "foo.test.jsx" does not match the "*/__tests__/" pattern',
169169
column: 1,
170170
line: 1,
171171
},
@@ -178,7 +178,7 @@ ruleTester.run(
178178
errors: [
179179
{
180180
message:
181-
'The folder of the file "bar/_tests_/foo.test.ts" does not match the "*/__tests__/" pattern',
181+
'The folder of the file "foo.test.ts" does not match the "*/__tests__/" pattern',
182182
column: 1,
183183
line: 1,
184184
},
@@ -191,7 +191,7 @@ ruleTester.run(
191191
errors: [
192192
{
193193
message:
194-
'The folder of the file "bar/_tests_/foo.test.tsx" does not match the "*/__tests__/" pattern',
194+
'The folder of the file "foo.test.tsx" does not match the "*/__tests__/" pattern',
195195
column: 1,
196196
line: 1,
197197
},
@@ -226,7 +226,7 @@ ruleTester.run(
226226
errors: [
227227
{
228228
message:
229-
'The folder of the file "bar/_tests_/foo.test.js" does not match the "*/__tests__/" pattern',
229+
'The folder of the file "foo.test.js" does not match the "*/__tests__/" pattern',
230230
column: 1,
231231
line: 1,
232232
},
@@ -239,7 +239,7 @@ ruleTester.run(
239239
errors: [
240240
{
241241
message:
242-
'The folder of the file "bar/_tests_/foo.test.ts" does not match the "*/__tests__/" pattern',
242+
'The folder of the file "foo.test.ts" does not match the "*/__tests__/" pattern',
243243
column: 1,
244244
line: 1,
245245
},

0 commit comments

Comments
 (0)