-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Config resolution in stdin mode #21
Comments
I didn't know that, the internal logic has to be reworked a bit then, PR welcome, even just for porting the failing tests over if not for fully fixing it. |
Or maybe more than a bit, I wonder what the cleanest way to map this onto the normal path would be 🤔 |
I had a look at this more earlier and it seems both manual config and auto config resolution need to be supported if we want to match prettier So if we specify But in addition to that, we should discover config files, probably using |
Copies the tests from prettier. Notable changes: - A failed plugin load throws an uncaught exception before this change. This catches it and logs an error to stderr - A `snapshot-diff` package was being used to create a `git diff` like diff as a jest snapshot. We can pick the unique lines out instead of using this Skipped tests: - `--help {option}` is not supported in prettier CLI - `--config-path` with stdin is not yet supported (see prettier#21) Notable hiccups: - Parsing argv seems to fall over on things like `--plugin=--foo--`, so the test has been changed for now to use `--plugin=totally-invalid`
Copies the `plugin-option` tests from prettier. Note that these will need updating once prettier#39 and prettier#21 are fixed.
When we run the CLI with stdin, it currently doesn't do any of the logic for config file resolution.
However, it is possible to specify a
--stdin-filepath
, in which case we should do the same resolution asrunGlobs
does.There are tests in prettier that we need to move over which will fail until this is possible. That, or we decide we don't want to support such a thing and don't take those tests.
cc @fabiospampinato
The text was updated successfully, but these errors were encountered: