-
Notifications
You must be signed in to change notification settings - Fork 21
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
Prettier Plugin not respecting config when called via CLI #16
Comments
fbartho
changed the title
Prettier Plugin not activating when called via CLI
Prettier Plugin respecting-config when called via CLI
May 17, 2022
This is really strange, I run the cli on my own code and do not have this problem. Do you think you could make a minimal reproduction of this in a new repo that you could share? If nothing else, that might help narrow down why this is happening. |
I have verified that the preprocessor from the plugin for typescript is indeed being invoked and it is receiving the correct config options. |
fbartho
added a commit
to fbartho/prettier-plugin-sort-imports
that referenced
this issue
May 17, 2022
Relates to IanVS#16 Looks like a combination of config options are conflicting? Not sure why it triggers on CLI vs API for me, but the run_spec is able to reproduce it in this repo.
fbartho
changed the title
Prettier Plugin respecting-config when called via CLI
Prettier Plugin not respecting config when called via CLI
May 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your Environment
Describe the bug
In our repo, when we use a CLI command to rewrite all files, it successfully executes prettier, and maybe some of the plugin, but not all the configuration is preserved. Effectively it looks like it ignores the
importOrder
setting from the config.To Reproduce
(Using the config provided below)
With this test file, already formatted via prettier, but without the prettier-plugin-sort-imports installed.
testFile.ts
Run
yarn prettier --write testFile.ts
to see:CLI-formatted:
Trigger IDE to invoke prettier to auto-format to see:
Editor Formatted
Expected behavior
I would expect the IDE-prettier-invoked output to be the final result, since that matches my
importOrder
configuration.Given that it does make changes to the layout when invoking it via CLI with the plugin installed, I think the plugin isn't respecting the options from the configuration file when invoked via CLI. I have verified that prettier is indeed discovering the plugin via CLI
--support-info
and the above technique.Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Error log
N/A
Contribute to @ianvs/prettier-plugin-sort-imports
The text was updated successfully, but these errors were encountered: