-
Notifications
You must be signed in to change notification settings - Fork 889
two EmptyLines after import statements #975
Comments
I had a custom rule (pre 3.0.0, haven't updated it) for blank lines above methods, may I propose a generic rule? Maybe something like: "blank-lines": [true, {
"after-imports": 2,
"above-conditionals": 1,
"above-methods": 1
} where the numbers can allow different teams to configure their preferences. |
@Pajn good idea! |
@stepancar, @Pajn - This will be really nice rule. Thank you. |
It will be great to have that rule. Thanks! |
Nice rule. Thank you. |
@Pajn could you share your custom rule, please? |
It's written by modifying a compiled rule, so it isn't super pretty. |
I definitely like this style and would love to see something offered in tslint's core for newlines after:
Also would love this same mechanism to also enforce zero newlines when closing blocks. |
@Pajn any further movement on this? |
IMO this doesn't seem like a good fit with TSLint core. We already have @stepancar / co., can you provide a justification for why this rule should exist? |
Whoa, @JoshuaKGoldberg the idea here isn't to get your take on what is good or not. It also certainly isn't to force everyone into using prettier (my take is that it creates very ugly, overly-compact code). Subjective
None of this means I want to impose the practice on others. At the same time though, I don't think it's unreasonable to ask that a linter support configurations specific to multiple organizations. Think I'm gonna reach for the adage that what's good for the goose isn't good for the gander here. |
☹ @atrauzzi I'm sorry if my post came off too strong - removed the For some more context, TSLint core's been moving away from formatting rules for some time now. Examples: #3995 / #3568 / #2814 / #3330 / #1306. In particular, per the discussion in #3330: every feature comes with a maintenance cost. The question here is whether the added maintenance for this formatting rule would be worth the benefit to users. How can we tell what's good for users? Normally TSLint goes by something like a casual mixture of collective gut intuition, well-explained use cases, and 👍 reactions to issues. Suggestion: how about putting this in either |
I get that there's a lot of hype for prettier, but I think there's warranted skepticism towards the tool and its "opinions". I've looked them over, but I apologize, these linked issues don't appear to serve as explanation. At best, they seem like rushed reasoning. Prettier even says it in its project description: It's opinionated, so who is this project serving to point people in that direction? Anyway -- the truth is, any discussion about prettier itself is beside the point: tslint punting on formatting is like a restaurant saying it's not going to serve drinks anymore. I - and many others I suspect - rely on tslint to be easy to use and a one-stop-shop.
Thanks for hearing me out. 😄 |
💀 It's time! 💀TSLint is being deprecated and no longer accepting pull requests for major new changes or features. See #4534. 😱 If you'd like to see this change implemented, you have two choices:
👋 It was a pleasure open sourcing with you! If you believe this message was posted here in error, please comment so we can re-open the issue! |
Time to make a new issue for eslint then :D |
🤖 Beep boop! 👉 TSLint is deprecated 👈 (#4534) and you should switch to typescript-eslint! 🤖 🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋 |
hello! Thank you for this project.
How to add rule 'two newlines after import statements'?
Thank you!
The text was updated successfully, but these errors were encountered: