export default class gives error

When using "export default class" in JavaScript, phpStorm gives an error that the code is incorrect and that after "export" it expects a function, class, etc.

This is incorrect. Is there a way to disable this check?

5 comments
Comment actions Permalink

What PHPStorm version do you use? What Javascript language version is chosen in Settings/Languages & Frameworks/Javascript?
Exact code snippet that shows up the issue would be helpful

0
Comment actions Permalink

phpStorm 9, Javascript is set to JSX/Harmony

@connect(state => ({
  categories: state.categories
}))
export default class CategoryListApp extends Component {
  render () {
    const { categories , dispatch } = this.props
    return
(
        <CategoryList categories={categories} {...bindActionCreators(CategoryListActions, dispatch)} />
    
)
  }
}
0
Comment actions Permalink

thanks! Known issue, https://youtrack.jetbrains.com/issue/WEB-16461 is fixed for WebStorm 11 (142 branch)

0
Comment actions Permalink

Thanks! Good to know. Any way of disabling this specific check so I can at least can get rid of the errors in the mean time?

0
Comment actions Permalink

This is a syntax error... such errors can't be suppressed - these are low-level checks done at  lexer level. I can suggest turning error highlighting off for such files  using Hector icon in the lower right corner: open your file in editor,  click the Hector icon and then move the slider to change the  Highlighting level to None. See
http://www.jetbrains.com/webstorm/webhelp/changing-highlighting-level-for-the-current-file.html


Note that you will need to reopen the project to get the highlighting updated
0

Please sign in to leave a comment.