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

[JS/Flow] Generic type breaks further JSX syntax highlighting #236

Open phts opened 4 years ago

phts commented 4 years ago

In the example - root cause is Element<*>. If this type does not have <*> part - then highlighting works OK.

// @flow
import React from 'react';
import type { Element } from 'react';

type PropsType = {
  t: () => {},
  a: string,
};

const c = 'asd';
const d = 'asd';

const MyComp = ({ t, a }: PropsType): Element<*> => (
  <div className={`${d}-wrapper`}>
    <span t={t(c)} a={a} />
    <div className={`${d}-form`} />
  </div>
);

export default MyComp;

With <*>:

Screenshot 2019-09-23 at 12 35 34

Without:

Screenshot 2019-09-23 at 12 35 43