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

Stop using ESLint 5's ConfigFile.load, which is gone in ESLint 6. #303

Closed
chrisbobbe opened this issue Sep 14, 2020 · 5 comments
Closed

Comments

@chrisbobbe
Copy link

chrisbobbe commented Sep 14, 2020

prettier-eslint-cli can't currently use ESLint 6, and it would be great to fix that (see #304).

Ever since #91 was merged, pretter-eslint-cli has been using a util function ConfigFile.load that doesn't exist in ESLint 6; it was removed in eslint/eslint#11546 (merged in eslint/eslint@6ae21a4; released in v6.0.0-alpha.1).

To see the problem in action, get prettier-eslint-cli to use ESLint 6 (e.g., 6.8.0). One way to do this is to put lines like the following in the package.json of a project that uses prettier-eslint-cli:

+  "resolutions": {
+    "prettier-eslint-cli/eslint": "^6.8.0",
+    "prettier-eslint-cli/prettier-eslint": "^11.0.0"
+  }

Run yarn/npm install, then run the CLI, and see error output containing this:

Error: Cannot find module 'eslint/lib/config/config-file'

If it's important that we keep invoking ESLint's code for loading an ESLint config, it would be great to try to use something that's unambiguously part of ESLint's public API.

If it's not important, it might be good to stop doing so. In particular, I think the current behavior doesn't align with this bit of basic summary in the README for what prettier-eslint-cli does:

prettier-eslint-cli forwards on the filePath and other relevant options to prettier-eslint which identifies the applicable ESLint config for each file and uses that to determine the options for prettier and eslint --fix.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2021

Stale issue

@chrisbobbe
Copy link
Author

Go away stale-bot, there’s no sign this issue has been fixed. 🙂

@chrisbobbe
Copy link
Author

chrisbobbe commented Mar 15, 2021

(I believe the issue still hasn't been fixed.)

@aronwoost
Copy link

It is not. 😕

@chrisbobbe
Copy link
Author

Fixed in #431! 🎉

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

No branches or pull requests

2 participants