Skip to content

Commit

Permalink
prefer-module: Fix suggestion message (#2327)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker authored May 7, 2024
1 parent fe527a6 commit bc9d65c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rules/prefer-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const messages = {
[SUGGESTION_USE_STRICT_DIRECTIVE]: 'Remove "use strict" directive.',
[SUGGESTION_IMPORT_META_DIRNAME]: 'Replace `__dirname` with `import.meta.dirname`.',
[SUGGESTION_IMPORT_META_URL_TO_DIRNAME]: 'Replace `__dirname` with `…(import.meta.url)`.',
[SUGGESTION_IMPORT_META_FILENAME]: 'Replace `__dirname` with `import.meta.filename`.',
[SUGGESTION_IMPORT_META_FILENAME]: 'Replace `__filename` with `import.meta.filename`.',
[SUGGESTION_IMPORT_META_URL_TO_FILENAME]: 'Replace `__filename` with `…(import.meta.url)`.',
[SUGGESTION_IMPORT]: 'Switch to `import`.',
[SUGGESTION_EXPORT]: 'Switch to `export`.',
Expand Down
8 changes: 4 additions & 4 deletions test/snapshots/prefer-module.mjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^ Do not use "__filename".␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
Suggestion 1/2: Replace \`__filename\` with \`import.meta.filename\`.␊
1 | const dirname = import.meta.filename;␊
--------------------------------------------------------------------------------␊
Expand Down Expand Up @@ -192,7 +192,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^ Do not use "__filename".␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
Suggestion 1/2: Replace \`__filename\` with \`import.meta.filename\`.␊
1 | const foo = {__filename: import.meta.filename, };␊
--------------------------------------------------------------------------------␊
Expand Down Expand Up @@ -238,7 +238,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^ Do not use "__filename".␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
Suggestion 1/2: Replace \`__filename\` with \`import.meta.filename\`.␊
1 | if (import.meta.filename.endsWith(".js")) {}␊
--------------------------------------------------------------------------------␊
Expand Down Expand Up @@ -1857,7 +1857,7 @@ Generated by [AVA](https://avajs.dev).
| ^^^^^^^^^^ Do not use "__filename".␊
--------------------------------------------------------------------------------␊
Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
Suggestion 1/2: Replace \`__filename\` with \`import.meta.filename\`.␊
1 | import.meta.filename␊
--------------------------------------------------------------------------------␊
Expand Down
Binary file modified test/snapshots/prefer-module.mjs.snap
Binary file not shown.

0 comments on commit bc9d65c

Please sign in to comment.