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

no-title-property-in-meta: fix dangling comma and highlighting #32

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Nov 10, 2021

Issue: N/A

What Changed

Before, the highlighting was done in the entire meta. Now it's only in the title node:
image

I also fixed an issue where if the code is like this:

export default {
  title: 'Button',
  component: Button
}

would be fixed to this, leaving a comma:

export default {
  ,
  component: Button
}

Checklist

Check the ones applicable to your change:

  • Ran yarn update-all
  • Tests are updated
  • Documentation is updated

Change Type

Indicate the type of change your pull request is:

  • maintenance
  • documentation
  • patch
  • minor
  • major

@shilman shilman added the bug Something isn't working label Nov 10, 2021
suggestions: [
{
messageId: 'removeTitleInMeta',
output: 'export default { component: Button, }',
output: 'export default { component: Button }',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's up with the extra space?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's related to what you mentioned before:

Ideally we'd be modifying the DOM and then generating using prettier or something, but I guess we want to preserve the user's formatting as much as possible...

Not sure what's the best way to improve this without running prettier

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me -- a little hacky. Ideally we'd be modifying the DOM and then generating using prettier or something, but I guess we want to preserve the user's formatting as much as possible...

@yannbf yannbf merged commit dc3a983 into main Nov 11, 2021
@yannbf yannbf deleted the fix/no-title-property-in-meta-node branch November 11, 2021 11:23
@github-actions
Copy link

🚀 PR was released in v0.3.0 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants