@@ -123,7 +123,11 @@ Generated by [AVA](https://avajs.dev).
123123 | ^^^^^^^^^ Do not use "__dirname".␊
124124 ␊
125125 --------------------------------------------------------------------------------␊
126- Suggestion 1/1: Replace "__dirname" with \`"…(import.meta.url)"\`.␊
126+ Suggestion 1/2: Replace \`__dirname\` with \`import.meta.dirname\`.␊
127+ 1 | const dirname = import.meta.dirname;␊
128+ ␊
129+ --------------------------------------------------------------------------------␊
130+ Suggestion 2/2: Replace \`__dirname\` with \`…(import.meta.url)\`.␊
127131 1 | const dirname = path.dirname(url.fileURLToPath(import.meta.url));␊
128132 `
129133
@@ -142,7 +146,11 @@ Generated by [AVA](https://avajs.dev).
142146 | ^^^^^^^^^^ Do not use "__filename".␊
143147 ␊
144148 --------------------------------------------------------------------------------␊
145- Suggestion 1/1: Replace "__filename" with \`"…(import.meta.url)"\`.␊
149+ Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
150+ 1 | const dirname = import.meta.filename;␊
151+ ␊
152+ --------------------------------------------------------------------------------␊
153+ Suggestion 2/2: Replace \`__filename\` with \`…(import.meta.url)\`.␊
146154 1 | const dirname = url.fileURLToPath(import.meta.url);␊
147155 `
148156
@@ -161,7 +169,11 @@ Generated by [AVA](https://avajs.dev).
161169 | ^^^^^^^^^ Do not use "__dirname".␊
162170 ␊
163171 --------------------------------------------------------------------------------␊
164- Suggestion 1/1: Replace "__dirname" with \`"…(import.meta.url)"\`.␊
172+ Suggestion 1/2: Replace \`__dirname\` with \`import.meta.dirname\`.␊
173+ 1 | const foo = { __dirname: import.meta.dirname};␊
174+ ␊
175+ --------------------------------------------------------------------------------␊
176+ Suggestion 2/2: Replace \`__dirname\` with \`…(import.meta.url)\`.␊
165177 1 | const foo = { __dirname: path.dirname(url.fileURLToPath(import.meta.url))};␊
166178 `
167179
@@ -180,7 +192,11 @@ Generated by [AVA](https://avajs.dev).
180192 | ^^^^^^^^^^ Do not use "__filename".␊
181193 ␊
182194 --------------------------------------------------------------------------------␊
183- Suggestion 1/1: Replace "__filename" with \`"…(import.meta.url)"\`.␊
195+ Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
196+ 1 | const foo = {__filename: import.meta.filename, };␊
197+ ␊
198+ --------------------------------------------------------------------------------␊
199+ Suggestion 2/2: Replace \`__filename\` with \`…(import.meta.url)\`.␊
184200 1 | const foo = {__filename: url.fileURLToPath(import.meta.url), };␊
185201 `
186202
@@ -199,7 +215,11 @@ Generated by [AVA](https://avajs.dev).
199215 | ^^^^^^^^^ Do not use "__dirname".␊
200216 ␊
201217 --------------------------------------------------------------------------------␊
202- Suggestion 1/1: Replace "__dirname" with \`"…(import.meta.url)"\`.␊
218+ Suggestion 1/2: Replace \`__dirname\` with \`import.meta.dirname\`.␊
219+ 1 | if (import.meta.dirname.startsWith("/project/src/")) {}␊
220+ ␊
221+ --------------------------------------------------------------------------------␊
222+ Suggestion 2/2: Replace \`__dirname\` with \`…(import.meta.url)\`.␊
203223 1 | if (path.dirname(url.fileURLToPath(import.meta.url)).startsWith("/project/src/")) {}␊
204224 `
205225
@@ -218,7 +238,11 @@ Generated by [AVA](https://avajs.dev).
218238 | ^^^^^^^^^^ Do not use "__filename".␊
219239 ␊
220240 --------------------------------------------------------------------------------␊
221- Suggestion 1/1: Replace "__filename" with \`"…(import.meta.url)"\`.␊
241+ Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
242+ 1 | if (import.meta.filename.endsWith(".js")) {}␊
243+ ␊
244+ --------------------------------------------------------------------------------␊
245+ Suggestion 2/2: Replace \`__filename\` with \`…(import.meta.url)\`.␊
222246 1 | if (url.fileURLToPath(import.meta.url).endsWith(".js")) {}␊
223247 `
224248
@@ -1833,7 +1857,11 @@ Generated by [AVA](https://avajs.dev).
18331857 | ^^^^^^^^^^ Do not use "__filename".␊
18341858 ␊
18351859 --------------------------------------------------------------------------------␊
1836- Suggestion 1/1: Replace "__filename" with \`"…(import.meta.url)"\`.␊
1860+ Suggestion 1/2: Replace \`__dirname\` with \`import.meta.filename\`.␊
1861+ 1 | import.meta.filename␊
1862+ ␊
1863+ --------------------------------------------------------------------------------␊
1864+ Suggestion 2/2: Replace \`__filename\` with \`…(import.meta.url)\`.␊
18371865 1 | url.fileURLToPath(import.meta.url)␊
18381866 `
18391867
0 commit comments