Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[object-curly-spacing] One-line object types do not adhere to spacing rules #1784

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
mpsijm opened this issue Mar 23, 2020 · 2 comments · Fixed by #2892
Closed

[object-curly-spacing] One-line object types do not adhere to spacing rules #1784

mpsijm opened this issue Mar 23, 2020 · 2 comments · Fixed by #2892
Labels
enhancement: new base rule extension New base rule extension required to handle a TS specific case good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@mpsijm
Copy link
Contributor

mpsijm commented Mar 23, 2020

Repro

{
  "rules": {
    "object-curly-spacing": "never"
  }
}
const foo = ({ status }: { status: int }) => console.log(status);

Expected Result
That running eslint --fix would fix this to:

const foo = ({status}: {status: int}) => console.log(status);

Actual Result
Instead, only the first curly brackets are fixed:

const foo = ({status}: { status: int }) => console.log(status);

Additional Info
This rule does not exist yet in @typescript-eslint, but should be extended from eslint like many other rules (e.g. brace-style)

Versions

package version
@typescript-eslint/eslint-plugin 2.24.0
@typescript-eslint/parser 2.24.0
TypeScript 3.6.3
ESLint 6.8.0
node 13.11.0
npm 6.13.7
@mpsijm mpsijm added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Mar 23, 2020
@mpsijm mpsijm changed the title [object-curly-space] issue title [object-curly-spacing] One-line object types do not adhere to spacing rules Mar 23, 2020
@bradzacher bradzacher added enhancement: new base rule extension New base rule extension required to handle a TS specific case good first issue Good for newcomers and removed triage Waiting for team members to take a look labels Mar 23, 2020
@anikethsaha
Copy link
Contributor

I will try to give it a shot tomorrow if no one is taking.

@sassanh
Copy link

sassanh commented Nov 23, 2020

@anikethsaha Kind reminder in case it is an easy but forgotten ticket :-)

@bradzacher bradzacher removed the has pr there is a PR raised to close this label Nov 23, 2020
mpsijm pushed a commit to mpsijm/typescript-eslint that referenced this issue Dec 21, 2020
mpsijm pushed a commit to mpsijm/typescript-eslint that referenced this issue Jan 8, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement: new base rule extension New base rule extension required to handle a TS specific case good first issue Good for newcomers package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
4 participants