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 has problems with '--config' #2704

Closed
jason0x43 opened this issue Aug 30, 2017 · 3 comments
Closed

package.json has problems with '--config' #2704

jason0x43 opened this issue Aug 30, 2017 · 3 comments
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency

Comments

@jason0x43
Copy link

Say I have this file structure:

/path/to/project
    package.json
/tmp
    some_file.js

If I cd into /tmp and run prettier --config /path/to/project/package.json some_file.js, the values in the "prettier" key in the package.json are ignored. However, if I have this structure:

/path/to/project
    .prettierrc
/tmp
    some_file.js

and run prettier --config /path/to/project/.prettierrc some_file.js, the config values in .prettierrc are used.

@jason0x43
Copy link
Author

From a quick look, it seems like the problem might be that when prettier is loading a package.json file (or any config file) specified with --config, it treats the entire file as a config file. However, when loading a package.json file during config discovery, prettier pulls out the "prettier" property.

@azz
Copy link
Member

azz commented Aug 30, 2017

^ I've opened an issue with cosmiconfig

@azz azz closed this as completed Aug 30, 2017
@azz azz added the scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency label Aug 30, 2017
@jason0x43
Copy link
Author

Great, thanks

@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jul 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. scope:dependency Issues that cannot be solved inside Prettier itself, and must be fixed in a dependency
Projects
None yet
Development

No branches or pull requests

2 participants