Skip to content
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

Autofix for functional/prefer-readonly-type produces confusing formatting #387

Closed
maxpatiiuk opened this issue Jul 19, 2022 · 1 comment · Fixed by #480
Closed

Autofix for functional/prefer-readonly-type produces confusing formatting #387

maxpatiiuk opened this issue Jul 19, 2022 · 1 comment · Fixed by #480
Labels
Priority: Low Nice addition, maybe... someday...

Comments

@maxpatiiuk
Copy link

maxpatiiuk commented Jul 19, 2022

Bug Report

Autofix for functional/prefer-readonly-type on a mapped type like the following inserts readonly on a wrong line:

let a: {
  [B in 'c']: 'd';
};

Expected behavior

let a: {
  readonly [B in 'c']: 'd';
};

Actual behavior

let a: { readonly
  [B in 'c']: 'd';
};

Proposed changes

Put readonly on the correct line.

Additional information

Related to #384

@maxpatiiuk maxpatiiuk added Status: Triage This issue needs to be triaged. Type: Bug Inconsistencies or issues which will cause a problem for users or implementors. labels Jul 19, 2022
@RebeccaStevens
Copy link
Collaborator

I'm not sure why this would be happening. I can look into it but formatting isn't the goal of this plugin; another rule or tool should be used to manage/fix formatting.

@RebeccaStevens RebeccaStevens added Priority: Low Nice addition, maybe... someday... and removed Type: Bug Inconsistencies or issues which will cause a problem for users or implementors. Status: Triage This issue needs to be triaged. labels Jul 19, 2022
@RebeccaStevens RebeccaStevens mentioned this issue Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Nice addition, maybe... someday...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants