Skip to content

Base rule extension: block-spacing Extending base rule for TS related blocks #5990

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

Closed
5 tasks done
seahindeniz opened this issue Nov 14, 2022 · 1 comment · Fixed by #6195
Closed
5 tasks done

Base rule extension: block-spacing Extending base rule for TS related blocks #5990

seahindeniz opened this issue Nov 14, 2022 · 1 comment · Fixed by #6195
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: new base rule extension New base rule extension required to handle a TS specific case formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@seahindeniz
Copy link

Before You File a Proposal Please Confirm You Have Done The Following...

My proposal is suitable for this project

  • My proposal specifically checks TypeScript syntax, or it proposes a check that requires type information to be accurate.
  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Link to the base rule

https://eslint.org/docs/latest/rules/block-spacing

Description

I believe the purpose of the base rule, applies for TS too

Fail

interface Shape {x: number}
interface Shape { x: number}
interface Shape {x: number }
interface Shape {x: number; y: number}

Pass

interface Shape { x: number }
interface Shape { x: number; y: number }

Additional Info

Actually, having a rule that rejects single line interface declarations could work too

@seahindeniz seahindeniz added enhancement: new base rule extension New base rule extension required to handle a TS specific case package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Nov 14, 2022
@bradzacher bradzacher added the formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead. label Nov 14, 2022
@JoshuaKGoldberg
Copy link
Member

Accepting PRs for an extension rule that applies the same logic as the base block-spacing rule to TypeScript syntax: interfaces, object literal types, and the like. 👍

@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Nov 15, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: new base rule extension New base rule extension required to handle a TS specific case formatting Related to whitespace/bracket formatting. We strongly recommend you use a formatter instead. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
3 participants