Skip to content

Enable the unicorn/prefer-import-meta-properties ESLint plugin rule #19916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Snuffleupagus
Copy link
Collaborator

Given that we require Node.js versions >=20.16.0 || >=22.3.0 using this should be fine, based on the "History" data in https://nodejs.org/api/esm.html#importmetadirname respectively https://nodejs.org/api/esm.html#importmetafilename.

Please also see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-import-meta-properties.md

@Snuffleupagus Snuffleupagus force-pushed the prefer-import-meta-properties branch from 75e1d08 to 0be752f Compare May 14, 2025 06:02
@mozilla mozilla deleted a comment from moz-tools-bot May 14, 2025
@mozilla mozilla deleted a comment from moz-tools-bot May 14, 2025
@mozilla mozilla deleted a comment from moz-tools-bot May 14, 2025
@mozilla mozilla deleted a comment from moz-tools-bot May 14, 2025
@mozilla mozilla deleted a comment from moz-tools-bot May 16, 2025
@mozilla mozilla deleted a comment from moz-tools-bot May 16, 2025
@mozilla mozilla deleted a comment from moz-tools-bot May 16, 2025
@mozilla mozilla deleted a comment from moz-tools-bot May 16, 2025
@Snuffleupagus Snuffleupagus force-pushed the prefer-import-meta-properties branch from 0be752f to 13c9995 Compare May 16, 2025 05:50
@Snuffleupagus
Copy link
Collaborator Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/b61fe0895150524/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/60d4e2abd87fe17/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/60d4e2abd87fe17/output.txt

Total script time: 13.77 mins

  • Integration Tests: FAILED

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/b61fe0895150524/output.txt

Total script time: 32.39 mins

  • Integration Tests: FAILED

Copy link
Contributor

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look correct, but maybe it would be great in the future to use file URLs rather than paths when possible (since new URL/import.meta.url is a standard that works everywhere, unlike the Node.js-specific import.meta.dirname).

@timvandermeij timvandermeij merged commit 57cbaae into mozilla:master May 17, 2025
9 checks passed
@timvandermeij
Copy link
Contributor

Thanks for the improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants