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

package.json lookup should be from ESLint cwd #67

Open
privatenumber opened this issue Nov 21, 2022 · 1 comment
Open

package.json lookup should be from ESLint cwd #67

privatenumber opened this issue Nov 21, 2022 · 1 comment

Comments

@privatenumber
Copy link

ESLint supports setting the cwd.

However, the getPackageJson function looks up using process.cwd().

@privatenumber
Copy link
Author

Since creating dynamic configurations are not possible, I would recommend moving type look up to a per-rule basis. That way, ESLint's cwd is available and would yield accurate results for monorepos that contain mixed types.

Also, seems like the env configurations are pretty much identical to ESLint's builtin environments. I think this plugin could have a "smarter" rule that detects whether a CommonJS variable is used in a Module.

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

No branches or pull requests

1 participant