♻️ Replace fileURLToPath patterns with import.meta.*#6437
Conversation
|
Co-authored-by: dubzzz <[email protected]>
Co-authored-by: dubzzz <[email protected]>
Co-authored-by: dubzzz <[email protected]>
…variables Co-authored-by: dubzzz <[email protected]>
|
@copilot make sure you have not missed any place inclkuding doc files |
@fast-check/ava
@fast-check/expect-type
fast-check
@fast-check/jest
@fast-check/packaged
@fast-check/poisoning
@fast-check/vitest
@fast-check/worker
commit: |
|
👋 A preview of the new documentation is available at: http://696919aa453db4b55d351035--dubzzz-fast-check.netlify.app |
Verified all files including documentation. No places were missed: ✅ All ES module code files use inlined The only remaining uses of |
| // @ts-expect-error --module must be higher | ||
| const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
| const avaPackageRoot = path.join(__dirname, '..'); | ||
| const avaPackageRoot = path.join(import.meta.dirname, '..'); |
Co-authored-by: dubzzz <[email protected]>
| declare const jestExpect: typeof _jestExpect; | ||
|
|
||
| // @ts-expect-error --module must be higher | ||
| const generatedTestsDirectoryName = '.test-artifacts'; |
There was a problem hiding this comment.
@copilot move expect error on the line right before import.meta
There was a problem hiding this comment.
Moved the @ts-expect-error comments to be right before import.meta.dirname on all affected files (ava, jest, vitest, packaged). (9755265)
Co-authored-by: dubzzz <[email protected]>
| const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
| const avaPackageRoot = path.join(__dirname, '..'); | ||
| const avaPackageRoot = path.join( | ||
| // @ts-expect-error --module must be higher |
There was a problem hiding this comment.
@copilot move expect on the line before path join so that the display would be nicer with join and import staying together on the same line
There was a problem hiding this comment.
Moved the @ts-expect-error comment to the line before path.join so that path.join(import.meta.dirname, ...) stays on one line for better readability. (f42b277)
Co-authored-by: dubzzz <[email protected]>
|
👋 A preview of the new documentation is available at: http://69696fc20b62a80eeb8511df--dubzzz-fast-check.netlify.app |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6437 +/- ##
=======================================
Coverage 94.84% 94.84%
=======================================
Files 207 207
Lines 5567 5567
Branches 1456 1456
=======================================
Hits 5280 5280
Misses 274 274
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fileURLToPath(new URL('.', import.meta.url))withimport.meta.dirnamein code filesfileURLToPath(import.meta.url)withimport.meta.filenamein code filesimport.meta.dirnameandimport.meta.filenamedirectly instead of using intermediate variables__filename(not available as import.meta.* in CJS)fileURLToPathandurlmodules@ts-expect-error --module must be highercomments on the line beforepath.joinfor better readabilityOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.