Describe the bug
Hi, I have recently upgraded @wordpress/eslint-plugin to version 4.0.0. After the update, eslint is telling me to remove spaces from inside parens, and replace ' with ". AFAIK this goes against WPC. I tried raising the issue at Automattic/wp-prettier#16 since I thought this was an issue with wp-prettier. From what I've been told, it's just that prettier isn't configured correctly for WPCS.
I haven't been using prettier before, so I would consider this a bug - using eslint-plugin, I would expect to get either no "stylistic" linting or linting in accordance with WPCS.
To reproduce
Steps to reproduce the behavior:
The exact build environment and result can be seen at https://circleci.com/gh/skaut/skaut-google-drive-gallery/3579
Expected behavior
I would expect to get either no "stylistic" linting or linting in accordance with WPCS.
Desktop (please complete the following information):
Additional context
Have you tried to follow my comment in your project: https://github.com/skaut/skaut-google-drive-gallery/pull/391#issuecomment-592173756?
Hi,
thanks, I noticed it on the phone, will try and report.
It seems like everything works as intended. It was an issue with configuration, the full discussion can be found in https://github.com/skaut/skaut-google-drive-gallery/pull/391.
Hi,
well, if eslint-plugin isn't configuring prettier to lint according to WPCS, why is it using it in the first place?
I understand the current state as "We don't care how you style your code, but you have to use prettier to do it and configure it yourself" - if that isn't a misunderstanding on my part, I don't get why the plugin would do that? I would like it to either give me a style that is according to WPCS or not lint style at all and leave it up to me....
@marekdedic, I see your point. I'm sure we can add a fallback to use the default WordPress Prettier config once https://github.com/WordPress/gutenberg/pull/20026 is in place. @ntwb, any plans to finish your PR or should I take it over?
In fact, when you use @wordpress/scripts, it's all handled properly. See:
Hi,
yeah, that seems like a great idea :+1: That way, we get WPCS by default, with an option to change it if one desires to.
Thanks
Noting that #20026 was merged so we have @wordpress/prettier-config that can be conditionally integrated with ESLint plugin.
https://github.com/WordPress/gutenberg/pull/21503 tries to fix the issue.
21503 tries to fix the issue.
Most helpful comment
Noting that #20026 was merged so we have
@wordpress/prettier-configthat can be conditionally integrated with ESLint plugin.