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

(feat) support singleAttributePerLine #313

Merged
merged 3 commits into from
Oct 6, 2022
Merged

(feat) support singleAttributePerLine #313

merged 3 commits into from
Oct 6, 2022

Conversation

david-ding
Copy link
Contributor

This PR addresses #305 by adding support for the singleAttributePerLine option from prettier

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Thank you! This mostly looks good, except the tests are currently failing. Also left two comments.

src/lib/extractAttributes.ts Show resolved Hide resolved
): PrintFn {
return (path) =>
path.getNode().name !== snippedTagContentAttribute
? [getAttributeLine(node, options), path.call(print)]
Copy link
Member

Choose a reason for hiding this comment

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

We still need to use concat here even if it's now deprecated because we support Prettier versions where that wasn't a thing yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! This mostly looks good, except the tests are currently failing. Also left two comments.

Thanks! I'm also not sure why the tests are failing, I ran npm test and they all passed locally 😕

@dummdidumm
Copy link
Member

For the tests to pass you probably need to bump Prettier in the devDeps and commit that package-lock change - it probably uses a version where that new option wasn't present yet.

@david-ding
Copy link
Contributor Author

oh I know what happened, I used yarn initially so it didn't use package-lock.json, now I can see the tests failing, will fix soon

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

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

Thank you and congrats on your first PR in this repo!

@dummdidumm dummdidumm merged commit db2543f into sveltejs:master Oct 6, 2022
@aradalvand
Copy link

aradalvand commented Oct 8, 2022

@dummdidumm Sorry if this is a dumb question but when will this be released?

Thank you very much @david-ding for implementing it by the way!

@aradalvand
Copy link

aradalvand commented Oct 17, 2022

@dummdidumm This is actually now causing the syntax highlighting in <style> to break, could you please take a look at this issue?

@dummdidumm
Copy link
Member

Don't bump issues in separate places. I saw that, and I'll get round to it eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants