borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
557 stars 20 forks source link

JSX arrow function prop produces a closing tag #244

Open aprilmintacpineda opened 4 years ago

aprilmintacpineda commented 4 years ago

Enter in the following code:

<TestComponent onDone={() = } />

Notice that I intentionally left out arrow function like that, now you know what's next there right? The moment you type in the next character in the arrow function which is >, you'll get:

<TestComponent onDone={() =></div>} />

The same thing also happens with these:

<TestComponent onDone={() =}
<TestComponent
  test={() =}
/>

These works as expected:

<TestComponent onDone={() =
<TestComponent
  test={() =
/>
neaumusic commented 4 years ago

agreed this is super annoying, I did file a bug about this but nobody's gotten around to it

danro commented 4 years ago

Not necessarily a fix, but you can disable this behavior by adding:

"auto_close_tags": false

To your "Settings - Syntax Specific" json file.