-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relax / revert @stylistic/comma-dangle
to ease migration from standard
#79
Comments
Some thoughts:
|
@jsumners Would you vote for removing the rule or to reverting to forbidding dangling commas? |
I think I would vote for removing the rule under the assumption that it would be the most permissive. |
Can we leave it as a default-off option similar to semi rules? |
People migrating to neostandard are warned about that style change from standard. And as such have implicilty agreed upon. But I do not see why neostandard could not offer:
On the implementation side, I do not think making a literal with boolean options to add is a good idea. It will make the life of users and maintainers better if:
The existing boolean seems to be orthogonal enough to the base rules configuration to stay as is. But that can also be folded into the style namespace, such as |
|
Fixes #79 Since there is no consensus on whether comma-dangle should be forbidden or required we should simply just ignore them for arrays, objects, imports, exports All non-ignored defaults to "never" – such as `functions`, `enums`, `generics`, `tuples` – so no need to add these
I personally prefer the dangling comma, but projects like undici would be about adding 3211 missing dangling commas. I dont think that this is nice for existing projects, basically pointing the blame to the one who migrates :-P |
Given that eslint will add it on document save, this is the only real argument I can make against it. Adding it to projects that have not been using it results in way too many changes. |
As both #78 (comment) and fastify/fastify#5509 mentioned, the enforcing of
comma-dangle
(that is one of two style related modernizations sincestandard@17.x
) is a bit too prescriptive and maybe even controversial.Related rule:
neostandard/lib/configs/modernization.js
Lines 23 to 29 in 3130ca9
As mentioned in fastify/fastify#5509 (comment) the equivalent in
standard@17.x
was:#78 (comment) suggests adding a configuration for the "legacy" behavior, something like
noCommaDangle: true
orlegacyCommaDangle: true
, but I don't like adding too many options.Another option would be to simply disable the rule completely and conclude that there is no consistent approach to this within the community anymore.
A third is to revert it completely, but that would make projects that then override it not be
neostandard
compliant anymore.I think its safe to say that the current state of it violates the mission statement (#7) of
Being a descriptive (not prescriptive) linting of common and good practices
The text was updated successfully, but these errors were encountered: