You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--prettier overrides {"prettier/prettier": "off"} in rules #512
changed the title [-]--prettier overrides "prettier/prettier": "off" in rules[/-][+]--prettier overrides {"prettier/prettier": "off"} in rules[/+]on Dec 25, 2020
I don't get it, that doesn't seem to answer Sindre's question. What's the point of setting it to true if you disable it afterwards? What's even the intended outcome for XO?
In projects where I have both the Prettier CLI and XO, I just use prettier/prettier: "off" without needing to enable it in XO itself.
There is more to the Prettier integration than just the prettier/prettier rule. When possible, I want to use Prettier exclusively to check code style and to avoid both the Prettier CLI and XO erroring from a formatting error.
If you're going to set --prettier and prettier/prettier: "off" in your config, you might as well just set prettier/recommended once instead, it's less config and your intent is much clearer:
{"extends": "plugin:prettier/recommended"}
Asking XO to first run --prettier and then apparently disabling it later looks super confusing.
Feel free to reopen if this is considered a bug though.
I wouldn't consider this a bug, but I'd love a way to disable conflicting prettier rules (which is the role of eslint-config-prettier) but not surface the warnings or run prettier --fix through eslint/xo (which is the role of eslint-plugin-prettier).
Personally, I find it much nicer to just let prettier format on save silently than showing an error/warning in the IDE. Formatting should be just handled but surfacing a warning means I have to pay attention to something.
I've tried to solve this by just enabling the eslint-config-prettier rule:
{
"extends": "prettier"
}
However, because the typescript rules are applied after, this causes fights between @typescript-eslint/indent because it is applied over the top of the user config:
I'm happy to file this as a separate issue, but figured the original discussion was relevant. I'm also happy to contribute a PR once the direction is nailed down.
Activity
[-]--prettier overrides "prettier/prettier": "off" in rules[/-][+]--prettier overrides {"prettier/prettier": "off"} in rules[/+]sindresorhus commentedon Dec 25, 2020
What's the purpose of turning off
prettier/prettierwhile leaving theprettieroption totrue? I don't personally use Prettier or theprettieroption.jonahsnider commentedon Dec 25, 2020
I use the Prettier CLI to check all the files Prettier supports in my project. I don't want both the check-format and lint jobs in CI to fail.
fregante commentedon Aug 16, 2021
I don't get it, that doesn't seem to answer Sindre's question. What's the point of setting it to true if you disable it afterwards? What's even the intended outcome for XO?
In projects where I have both the Prettier CLI and XO, I just use
prettier/prettier: "off"without needing to enable it in XO itself.jonahsnider commentedon Aug 16, 2021
There is more to the Prettier integration than just the
prettier/prettierrule. When possible, I want to use Prettier exclusively to check code style and to avoid both the Prettier CLI and XO erroring from a formatting error.fregante commentedon Aug 17, 2021
What would that be?
jonahsnider commentedon Aug 17, 2021
Using
eslint-config-prettierto disable other formatting issues that should be handled by Prettier.fregante commentedon Aug 6, 2022
xo/lib/options-manager.js
Lines 412 to 421 in 3a4c9c9
If you're going to set
--prettierandprettier/prettier: "off"in your config, you might as well just setprettier/recommendedonce instead, it's less config and your intent is much clearer:Asking XO to first run
--prettierand then apparently disabling it later looks super confusing.Feel free to reopen if this is considered a bug though.
lachieh commentedon Mar 21, 2024
I wouldn't consider this a bug, but I'd love a way to disable conflicting prettier rules (which is the role of
eslint-config-prettier) but not surface the warnings or runprettier --fixthrough eslint/xo (which is the role ofeslint-plugin-prettier).Personally, I find it much nicer to just let prettier format on save silently than showing an error/warning in the IDE. Formatting should be just handled but surfacing a warning means I have to pay attention to something.
I've tried to solve this by just enabling the
eslint-config-prettierrule:However, because the typescript rules are applied after, this causes fights between
@typescript-eslint/indentbecause it is applied over the top of the user config:xo/lib/options-manager.js
Lines 356 to 359 in 1245088
I'm happy to file this as a separate issue, but figured the original discussion was relevant. I'm also happy to contribute a PR once the direction is nailed down.
fregante commentedon Sep 21, 2026
This was finally implemented as
--prettier compat