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

Conflict --config argument with Webpack triggers validation warning. #58

Closed
hunteva opened this issue Sep 22, 2017 · 4 comments
Closed

Comments

@hunteva
Copy link

hunteva commented Sep 22, 2017

I don't think this is a bug for eslint-plugin-prettier, but one recent PR gives Prettier a chance to load its configure file even in API mode introduce conflict with Webpack at least.

Since 1.6.0 Prettier now pickup '--config' arg from the command line to load its configuration, but it didn't distinguish who was the arg for, so if you set it up with webpack, eslint-loader and eslint-plugin-prettier and running command like

webpack --config webpack.dev.js

could have webpack.dev.js file been pick up by prettier as configuration thus resulting Validation Warning like this:

● Validation Warning:

Unknown option "devtool" with value "#source-map" was found.
This is probably a typing mistake. Fixing it will remove this message.

The reason I rise it here is that given the 'bridge' nature of eslint-plugin-prettier that using prettier in API mode, perhaps we could have flag controls this "loads config file by its self like it did in command mode" behaviour, I'm currently holding at version 2.2.0 to avoid this.

Just my 2 cents, not sure if it's duplicated, Please feel free to correct me.

@not-an-aardvark
Copy link
Member

Thanks for the report. I think this is an issue with prettier, not eslint-plugin-pretter -- it seems like resolveConfig shouldn't interpret global command line arguments when used from the API.

@hunteva
Copy link
Author

hunteva commented Sep 22, 2017

Thanks for quick reply, @not-an-aardvark I'm not sure the intention of resolveConfig at first place, but if you feel it looks like a bug, I'm happy to post it there.

@not-an-aardvark
Copy link
Member

I think it's an issue with prettier, although I'm not positive. If it turns out I'm wrong, feel free to let me know and I'll reopen this. 😄

@hunteva
Copy link
Author

hunteva commented Sep 22, 2017

Cool, I'll post it to Prettier, it looks more like over memorization to me now, Thanks!

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

2 participants