xojs / stylelint-config-xo

Stylelint shareable config for XO
MIT License
42 stars 6 forks source link

Replace stylistic rules with prettier plugin #16

Open fregante opened 2 years ago

fregante commented 2 years ago

Stylelint does a less-than-stellar job at formatting, and they’re fine with it:

So what do you think about adding this plugin to the config to defer this job to Prettier by default?

https://github.com/prettier/stylelint-prettier

connorjs commented 1 year ago

FYI - Stylelint 15 has deprecated stylistic rules, which means the stylelint-prettier-plugin stylelint-config-prettier has no utility v15+.

https://stylelint.io/migration-guide/to-15

Edit: Fix typo, thanks for pointing it out.

fregante commented 1 year ago

the stylelint-prettier-plugin has no utility v15+.

Doesn't v15 mean exactly the opposite? Because stylelint doesn't have formatting rules, you should use Prettier either separately or as a plugin.

In fact the plugin was readied for v15 by dropping its overriding config: https://github.com/prettier/stylelint-prettier/issues/284

fregante commented 1 year ago

I think you're confusing stylelint-config-prettier with the stylelint-prettier plugin

Either way, great move by stylelint, they were worse than eslint at formatting. I hope eslint takes note and follows suit.

connorjs commented 1 year ago

Correct! (a) I typed without checking specifics and (b) mis-read the intent when glancing through issues. 🤦🏻‍♂️🤦🏻‍♂️

Additionally, you may no longer need to extend Prettier's Stylelint config as there should be no conflicting rules:

{
- "extends": ["stylelint-config-prettier"],
  "rules": { .. }
}

Because stylelint doesn't have formatting rules, you should use Prettier either separately or as a plugin.

👍🏻

fregante commented 1 year ago

Yeah the confusing part is that they called the config a "plugin" in a few places 🤷‍♂️

sindresorhus commented 6 months ago

I personally don't plan to use Prettier, but I'm happy to have the current config split into stylistic and non-stylistic if that would help.