Skip to content

Commit bc9d65c

Browse files
authored
prefer-module: Fix suggestion message (#2327)
1 parent fe527a6 commit bc9d65c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

rules/prefer-module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const messages = {
2626
[SUGGESTION_USE_STRICT_DIRECTIVE]: 'Remove "use strict" directive.',
2727
[SUGGESTION_IMPORT_META_DIRNAME]: 'Replace `__dirname` with `import.meta.dirname`.',
2828
[SUGGESTION_IMPORT_META_URL_TO_DIRNAME]: 'Replace `__dirname` with `…(import.meta.url)`.',
29-
[SUGGESTION_IMPORT_META_FILENAME]: 'Replace `__dirname` with `import.meta.filename`.',
29+
[SUGGESTION_IMPORT_META_FILENAME]: 'Replace `__filename` with `import.meta.filename`.',
3030
[SUGGESTION_IMPORT_META_URL_TO_FILENAME]: 'Replace `__filename` with `…(import.meta.url)`.',
3131
[SUGGESTION_IMPORT]: 'Switch to `import`.',
3232
[SUGGESTION_EXPORT]: 'Switch to `export`.',

test/snapshots/prefer-module.mjs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Generated by [AVA](https://avajs.dev).
146146
| ^^^^^^^^^^ Do not use "__filename".␊
147147
148148
--------------------------------------------------------------------------------␊
149-
Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
149+
Suggestion 1/2: Replace \`__filename\` with \`import.meta.filename\`.␊
150150
1 | const dirname = import.meta.filename;␊
151151
152152
--------------------------------------------------------------------------------␊
@@ -192,7 +192,7 @@ Generated by [AVA](https://avajs.dev).
192192
| ^^^^^^^^^^ Do not use "__filename".␊
193193
194194
--------------------------------------------------------------------------------␊
195-
Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
195+
Suggestion 1/2: Replace \`__filename\` with \`import.meta.filename\`.␊
196196
1 | const foo = {__filename: import.meta.filename, };␊
197197
198198
--------------------------------------------------------------------------------␊
@@ -238,7 +238,7 @@ Generated by [AVA](https://avajs.dev).
238238
| ^^^^^^^^^^ Do not use "__filename".␊
239239
240240
--------------------------------------------------------------------------------␊
241-
Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
241+
Suggestion 1/2: Replace \`__filename\` with \`import.meta.filename\`.␊
242242
1 | if (import.meta.filename.endsWith(".js")) {}␊
243243
244244
--------------------------------------------------------------------------------␊
@@ -1857,7 +1857,7 @@ Generated by [AVA](https://avajs.dev).
18571857
| ^^^^^^^^^^ Do not use "__filename".␊
18581858
18591859
--------------------------------------------------------------------------------␊
1860-
Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
1860+
Suggestion 1/2: Replace \`__filename\` with \`import.meta.filename\`.␊
18611861
1 | import.meta.filename␊
18621862
18631863
--------------------------------------------------------------------------------␊

test/snapshots/prefer-module.mjs.snap

-5 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)