IntelliJ 2018.1.2 gives errors in Javascript code which 2018.1.1 says is fine

this code creates lots of errors after itself:

subMenus.push(
  <AppMenuItem
    attribute={{ 'data-qa': 'AppMenuItem_' + routeInfo.path.replace(/\//g, '')}}
    key={routeInfo.path}
  >
    item text
  </AppMenuItem>
);

this stops the errors:

const dataQaRouteKey = routeInfo.path.replace(/\//g, '');
subMenus.push(
  <AppMenuItem
    attribute={{ 'data-qa': 'AppMenuItem_' + dataQaRouteKey}}
    key={routeInfo.path}
  >
   item text
  </AppMenuItem>

);

The first version shows no errors in 2018.1.1.  Is this a bug or a feature?  Thanks!

0

Please sign in to leave a comment.