-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
📎 Implement format option singleAttributePerLine
#1706
Comments
Hi @ematipico ! I've start working on this issue and have 1 question about running specific jsx tests with newly added configuration option |
That's expected because we track the value of the options in the snapshot tests. Just make sure that the snapshots show the new option. Then, commit all these new snapshot changes, and start creating new test cases. With the new test cases, you should be able to see the difference between the default value and the new value. |
I mean , how i can apply new optionsfor specific tests cases not for all existed. It my first contribution to biome and i not a familiar with all processes |
Hi @octoshikari , sorry for the lack of context, I didn't have much time yesterday. Creating new tests with new options in the formatter is a bit hectic and outdated, and I hope to renovate it soon, maybe with some help. So, usually, you can find an biome/crates/biome_js_formatter/tests/specs/ts/enum/options.json Lines 1 to 10 in 7f82152
Since we are adding a new option, we have to tell the testing infrastructure to understand and read the new option. You'll have to add a new option here: biome/crates/biome_js_formatter/tests/language.rs Lines 198 to 233 in 7f82152
And then you have to apply this option here, by adding a new function called biome/crates/biome_js_formatter/tests/language.rs Lines 279 to 282 in 7f82152
This should be enough to prepare the testing infrastructure. Then, I suggest creating a new folder here: https://github.com/biomejs/biome/tree/main/crates/biome_js_formatter/tests/specs/jsx As you can see, there are already two folder that test a particular option. Follow the same pattern. Create a new JSX file with what you want to test. Then create |
@ematipico Hi! Thank you for good clarification. I'm already created PR for this issue and added new test case with |
Description
From the discussion #698
It would be great if someone wanted to implement this option.
Here's the prettier reference: https://prettier.io/docs/en/options#single-attribute-per-line
I'm happy to reply to any questions you might have.
The text was updated successfully, but these errors were encountered: