-
Notifications
You must be signed in to change notification settings - Fork 4
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
Enforce / allow styles #11
Comments
doube quotes are TW btw. You can always override rules in your setup anyway, if you disagree with them 😉 The pg eslint config is not the bible. So I would say enforce the rules in this config, override in your project if you/your team disagrees. |
Why?
Yes, but I'd say you should have a good cause.
No, but they don't make sense if every projects overrides a lot of rules. If there are problematic rules, we can discuss them. |
The main purpose of our eslint config is to have a unified style. We can't all agree on everything and there will always be someone unhappy. But if we have those rules, they should be applied on every project and only be altered on the project level for good reason. Personal taste is not a reason to alter the config. |
True, but we are talking about one rule here. Also, the effect of "we allow, but don't enforce" is the same - you can choose what you want by overriding or by leaving out the rules.
single vs double qoutes are merely personal taste for example, afaik there are no downsides to using one or the other except from escaping strings (depending on which language you are using). Why not use what your team likes more. I have no problem to adapt, and a little bit of freedom keeps everyone happy. |
Maybe we should differentiate between Open Source modules and our own projects vs. (private) client projects. The latter is open for some customizations imho. It may be sensible to adjust some rules there depending on the project. |
Yes, but I would like that all of you are as happy as possible 😁. I know that it's annoying to write code with a code style that is in your way all the time. I'm always open to suggestions and changes, this should be our code style, not mine. And we have to re-validate the rules all the time because as new language features arrive, there might be better ways to do things (like I'm thinking about making this as objective as possible because we won't get far with things like "I think it's ugly" or "I don't like it". If you don't like it, there is usually a deeper cause than that – and you should find it. If the true cause is "It's unfamiliar", than you should give it a try. The current code style is the result of years working on different code bases and balancing developer ergonomics against "good" code, which is code that is readable, changeable and less error-prone. What about this: If somebody wants to change a rule, we should collect arguments for both sides. On the left side, there should be the status quo, on the right side the new rule. Status quo should always have the argument that "It's the status quo" because changing code manually is cumbersome. However, if a rule is fixable via Example Dangling Commas:
Personally, I'd weigh the arguments this way:
Someone else may weigh it this way:
After collecting all votes, we create a common ranking and we'll see which rule has more points:
Dangling Commas ( |
Follow up of the discussion #24 |
I had a discussion with @jhnns on Saturday about coding rules in general. I totally agree that some rules with a big impact have to be enforced. Things like single quotes vs. double quotes and literal spacing is something we want to keep consistent.
Other rules like dangling commas #10 could be something we allow, but don't enforce.
What do you think?
The text was updated successfully, but these errors were encountered: