Skip to content
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

New Rule: reports the unsupported import.meta properties. #419

Open
1 task done
ota-meshi opened this issue Mar 10, 2025 · 1 comment · May be fixed by #420
Open
1 task done

New Rule: reports the unsupported import.meta properties. #419

ota-meshi opened this issue Mar 10, 2025 · 1 comment · May be fixed by #420

Comments

@ota-meshi
Copy link
Member

ota-meshi commented Mar 10, 2025

Rule details

The n/no-unsupported-features/node-builtins rule reports when require.resolve() is not available, but does not report import.meta.resolve().
I would like a rule that reports when import.meta.resolve() is not available.

What type of rule is this?

Warns about a potential problem

Example code

import.meta.resolve(); // Reports if it is not available for the specified Node version.
import.meta.filename; // Reports if it is not available for the specified Node version.
import.meta.dirname; // Reports if it is not available for the specified Node version.

Participation

  • I am willing to submit a pull request to implement this rule.

Additional comments

No response

@scagood
Copy link

scagood commented Mar 10, 2025

I am in favour of this, it's something I have hit a few times too 😅

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

Successfully merging a pull request may close this issue.

2 participants