-
Notifications
You must be signed in to change notification settings - Fork 89
Description
First of all, a small documentation issue: The padding-around-test-blocks rule isn't listed in the README.
I'd like to suggest ergonomic improvements for the block padding rules. There are 6 separate padding-around-*-blocks rules. There's also a padding-around-expect-groups rule, which is similarly named but categorically different. Speaking for myself, I find the block padding rules commonsensical, but the expect group padding rule a bit heavy-handed. Unfortunately, enabling the block padding rules requires 6 separate rule declarations:
"vitest/padding-around-after-all-blocks": "warn",
"vitest/padding-around-after-each-blocks": "warn",
"vitest/padding-around-before-all-blocks": "warn",
"vitest/padding-around-before-each-blocks": "warn",
"vitest/padding-around-describe-blocks": "warn",
"vitest/padding-around-test-blocks": "warn",
I thought I could perhaps subtract from the padding-around-all meta-rule, but when I tried that, ESLint seemed to ignore the "off" switch:
"vitest/padding-around-all": "warn",
"vitest/padding-around-expect-groups": "off",
So for now, I'm enabling the 6 block padding rules individually.
The simplest solution would be to add a padding-around-all-blocks meta-rule. If backward compatibility weren't a concern, I would suggest consolidating all of the block padding rules into a single rule, with options to allow it to be enabled for a subset of block types.