fxbois / web-mode

web template editing mode for emacs
https://web-mode.org
GNU General Public License v3.0
1.64k stars 260 forks source link

Automatic insersion of quotes in attribute in JSX #1277

Closed jcubic closed 1 year ago

jcubic commented 1 year ago

I write a lot of JSX (React) and I often write code like this:

<Item something={something}>

</Item>

And it's really annoying that Web-mode inserts ="" when you press =, I need to delete what web-mode is inserting almost every time, since props are more common than normal attributes. Is there a way to turn it off? In JSX you sometimes use "" and sometimes {}.

yugaego commented 1 year ago

Disable web-mode-enable-auto-quoting. F.i.

(setq web-mode-enable-auto-quoting nil)

or in *Customize* UI reaching it with M-x customize-group RET web-mode. There, you can find a list of all custom options provided by the mode.

Note that the question better matches Discussions, imo.

jcubic commented 1 year ago

Thanks, I wanted to ask on the Discussions but they are empty.