tools icon indicating copy to clipboard operation
tools copied to clipboard

📎 Add configuration option to remove semicolons

Open michaelhays opened this issue 1 year ago â€ĸ 9 comments

Description

Prettier has the option to remove semicolons from your code, except for in certain instances to prevent changing the meaning of the code.

It would be great to have this as a configuration option for Rome, particularly to help the adoption rate for existing codebases that don't use semicolons.

(Creating this issue as a continuation of a discussion in this project, to track interest in adding this option)

michaelhays avatar Oct 30 '22 05:10 michaelhays

This has been a much requested feature. @rome/staff How hard would this be to implement?

sebmck avatar Nov 10 '22 20:11 sebmck

would this also add the ability to add semicolons?

SuperchupuDev avatar Nov 10 '22 20:11 SuperchupuDev

@SuperchupuDev I'm not sure I know what that means? This issue is for a configuration option that causes semicolons to be omitted when they aren't necessary. Similar to the prettier option.

sebmck avatar Nov 10 '22 20:11 sebmck

nevermind, i was talking about something like the semi option from prettier to add instead of removing semicolons even if they aren't necessary, but looks like rome already does the same by default. maybe the configuration option described by this issue could be a semicolon option (that can be set to false) instead of a no-semicolon option? sounds more intuitive

SuperchupuDev avatar Nov 10 '22 20:11 SuperchupuDev

This has been a much requested feature. @rome/staff How hard would this be to implement?

I don't expect it to be too complicated. It's probably a day or two of work.

This is prettier's logic that we can us as a starting point.

https://github.com/prettier/prettier/blob/199a1bb38929c72861ead3cf44978a895eba65bb/src/language-js/print/statement.js#L89-L157

Let's see how today goes. Maybe I'll find some time to look into it.

MichaReiser avatar Nov 11 '22 07:11 MichaReiser

I love the idea of Rome but cannot use the VS Code extension because semicolons. ☚ī¸

ysageev avatar Nov 11 '22 18:11 ysageev

They clearly understand the need for this, please be patient!

Just leave a :+1: on this issue to express your support.

michaelhays avatar Nov 11 '22 18:11 michaelhays