-
Notifications
You must be signed in to change notification settings - Fork 11
Help test dprint
#16
Comments
I was able to fix those issues, which were happening because my local folder contains spaces: dprint/dprint-vscode#33 Actually, support for local |
I've just found out that the latest version of the JS/TS I've added a PR so we can test it in this repository: #17 |
I've been carefully reading the WP JavaScript coding standards and trying to match them with dprint options. You can see the result in the playground. TLDR;
Things that don't work
Bugs that affect WP coding standards
You can see the configuration in the {
"useTabs": true,
"lineWidth": 80,
"typescript": {
"quoteStyle": "alwaysSingle",
"useBraces": "always",
"singleBodyPosition": "nextLine",
"operatorPosition": "sameLine",
"preferSingleLine": true,
"memberExpression.preferSingleLine": false,
"binaryExpression.linePerExpression": true,
"memberExpression.linePerExpression": true,
"spaceAround": true
}
} |
@luisherranz, I think you should be comparing with what https://github.com/WordPress/gutenberg/blob/trunk/packages/prettier-config/lib/index.js I'm not 100% sure that all WP JS coding standards can be achieved with automated formatting so we tried to bring it as close as possible. We might miss some changes as well in the process. It probably would be best to run |
Oh, ok. I'll try to match the options you are currently using with
I'll do that as well, good idea. I think there are aesthetic differences between both in the formatting, but nothing that affects the coding standards. If we ever move Gutenberg to |
For the record, I've been trying to set up |
Oh, that's a shame 😩 Does the VS Code prettier extension work for you in that project? |
I'm going to stop this experiment and move back to Prettier to start testing the |
Done in #43. I'll add |
@gziolo proposed fully adopting prettier (and dropping the WordPress spacing standard) in January: https://make.wordpress.org/core/2022/01/05/proposal-changes-to-javascript-coding-standards-for-full-prettier-compatibility/
Even though the proposal received a lot of support, @ntwb said in Slack that the consensus at the moment is a "No" from the core team. We've been unable to locate where that core team conversation took place, and I'm not sure why Gutenberg contributors are not considered Core contributors, but the proposal is currently stuck because of that.
I'll keep trying to contact @ntwb and see if he can finally share more information about how, where and why that decision was made, but until then, I was testing
dprint
, as an alternative, just in caseprettier
doesn't finally work out.As I'm not the only one using this repository anymore, it'd be great to know your impressions with
dprint
. My main issue right now is that you cannot use a local node_modules installation, and therefore people need to figure out how to install it globally. Also, I was unable to make the VS Code extension work by default with the global installation ofdprint
and I had to manually add adprint.path
in the VS Code settings.If you've also tested it out while working on this repository, please share your impressions 🙂
The text was updated successfully, but these errors were encountered: