From 804a94f829a3b2429d591b2f65bde92254c6ad21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 1 Sep 2021 15:57:55 +0200 Subject: [PATCH] Use `import.meta.url` instead of `__dirname` (#13721) --- packages/babel-types/test/fields.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/babel-types/test/fields.js b/packages/babel-types/test/fields.js index 13408b8c2f67..0a59c40b7df7 100644 --- a/packages/babel-types/test/fields.js +++ b/packages/babel-types/test/fields.js @@ -3,9 +3,10 @@ import glob from "glob"; import path from "path"; import fs from "fs"; import { inspect } from "util"; +import { fileURLToPath } from "url"; -// eslint-disable-next-line no-restricted-globals -const packages = path.resolve(__dirname, "..", ".."); +const dirname = path.dirname(fileURLToPath(import.meta.url)); +const packages = path.resolve(dirname, "..", ".."); function readJson(file) { return new Promise((resolve, reject) => {