Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard considers static class properties as parsing error in version 12 #1225

Closed
Visya opened this issue Nov 11, 2018 · 9 comments

Comments

@Visya
Copy link

commented Nov 11, 2018

What version of standard?
standard@12.0.1

What operating system, Node.js, and npm version?
MacOS, Node.js v8.12.0, npm 6.4.1

What did you expect to happen?
Standard allows static properties in classes

What actually happened?

class HomeScreen extends React.Component {
  static navigationOptions = {
    title: "MyApp"
  }
  ...

Standard output:

../screens/Home.js:7:28: Parsing error: Unexpected token =
@xiaweiss

This comment has been minimized.

Copy link

commented Nov 21, 2018

ES7 is not supported.
Same problem:

class Foo {
    myFunction  = () => {
  
   }
}
@stale

This comment has been minimized.

Copy link

commented Feb 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Feb 19, 2019

@brodybits

This comment has been minimized.

Copy link
Contributor

commented Feb 19, 2019

@stale stale bot removed the stale label Feb 19, 2019

@xiaweiss

This comment has been minimized.

Copy link

commented Feb 21, 2019

the above code will report lint error.
but in standard version 10.0.3, it worked, no error

@xiaweiss

This comment has been minimized.

Copy link

commented Feb 21, 2019

it also might be a bug of package linter-js-standard of atom editor

@lovetingyuan

This comment has been minimized.

Copy link

commented Feb 28, 2019

same problem, anyone will fix it?

@stale

This comment has been minimized.

Copy link

commented May 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label May 29, 2019

@brodybits

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

@stale stale bot removed the stale label May 29, 2019

@feross

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

Hi everyone,

You need to npm install babel-eslint and tell standard to use it as the parser. See: https://standardjs.com/#how-do-i-use-experimental-javascript-es-next-features

Once this is a Stage 4 language proposal and ESLint adds support for it, then the babel parser will no longer be required.

@feross feross closed this Aug 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
You can’t perform that action at this time.