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: n/no-path-concat for import.meta.* #295

Open
1 task done
voxpelli opened this issue Jun 9, 2024 · 0 comments
Open
1 task done

New Rule: n/no-path-concat for import.meta.* #295

voxpelli opened this issue Jun 9, 2024 · 0 comments
Labels

Comments

@voxpelli
Copy link
Member

voxpelli commented Jun 9, 2024

Rule details

n/no-path-concat helps out with how one should handle __dirname and __filename, but in ESM modules those does not exist (as mentioned in eg. #164) but instead there are three others with similar, yet different, concerns:

  • import.meta.dirname
  • import.meta.filename
  • import.meta.url

What type of rule is this?

Warns about a potential problem

Example code

const abc = import.meta.dirname + '/foo/bar.js';

Participation

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

Additional comments

Either n/no-path-concat is extended with those three or a new rule is introduced. I think n/no-path-concat could probably be extended? (Hence why I opened #294, because I would have suggested this as a rule change if I could)

@voxpelli voxpelli added the rule label Jun 9, 2024
@scagood scagood added rule:new A new rule for the package and removed rule labels Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants