@@ -123,7 +123,11 @@ Generated by [AVA](https://avajs.dev).
123
123
| ^^^^^^^^^ Do not use "__dirname".␊
124
124
␊
125
125
--------------------------------------------------------------------------------␊
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)\`.␊
127
131
1 | const dirname = path.dirname(url.fileURLToPath(import.meta.url));␊
128
132
`
129
133
@@ -142,7 +146,11 @@ Generated by [AVA](https://avajs.dev).
142
146
| ^^^^^^^^^^ Do not use "__filename".␊
143
147
␊
144
148
--------------------------------------------------------------------------------␊
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)\`.␊
146
154
1 | const dirname = url.fileURLToPath(import.meta.url);␊
147
155
`
148
156
@@ -161,7 +169,11 @@ Generated by [AVA](https://avajs.dev).
161
169
| ^^^^^^^^^ Do not use "__dirname".␊
162
170
␊
163
171
--------------------------------------------------------------------------------␊
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)\`.␊
165
177
1 | const foo = { __dirname: path.dirname(url.fileURLToPath(import.meta.url))};␊
166
178
`
167
179
@@ -180,7 +192,11 @@ Generated by [AVA](https://avajs.dev).
180
192
| ^^^^^^^^^^ Do not use "__filename".␊
181
193
␊
182
194
--------------------------------------------------------------------------------␊
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)\`.␊
184
200
1 | const foo = {__filename: url.fileURLToPath(import.meta.url), };␊
185
201
`
186
202
@@ -199,7 +215,11 @@ Generated by [AVA](https://avajs.dev).
199
215
| ^^^^^^^^^ Do not use "__dirname".␊
200
216
␊
201
217
--------------------------------------------------------------------------------␊
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)\`.␊
203
223
1 | if (path.dirname(url.fileURLToPath(import.meta.url)).startsWith("/project/src/")) {}␊
204
224
`
205
225
@@ -218,7 +238,11 @@ Generated by [AVA](https://avajs.dev).
218
238
| ^^^^^^^^^^ Do not use "__filename".␊
219
239
␊
220
240
--------------------------------------------------------------------------------␊
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)\`.␊
222
246
1 | if (url.fileURLToPath(import.meta.url).endsWith(".js")) {}␊
223
247
`
224
248
@@ -1833,7 +1857,11 @@ Generated by [AVA](https://avajs.dev).
1833
1857
| ^^^^^^^^^^ Do not use "__filename".␊
1834
1858
␊
1835
1859
--------------------------------------------------------------------------------␊
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)\`.␊
1837
1865
1 | url.fileURLToPath(import.meta.url)␊
1838
1866
`
1839
1867
0 commit comments