question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I have a component which uses ES6+ features e.g.

myComponent extends React.Component { static propTypes = {

This throws a syntax error as expected because it is an ES6+ feature. In the past I have installed the relevant npm modules e.g. ("babel-preset-stage-0"😃 and altered the babel.rc file and it has been successful but even with these additions in this setup, i’m still getting syntax errors:

My babel.rc file looks like this

{
  "presets": [
    ["env", {
      "targets": {
        "node": true
      }
    }],
    "react",
    "stage-0",
    "es2015"
  ]
}

Package.json:

"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
leebensoncommented, Apr 17, 2017

Decorators and static properties have been now added to the kit

2reactions
leebensoncommented, Apr 15, 2017

Thanks for reporting. I’ll add ES7 support to the next release, hopefully tomorrow.

.babelrc is solely to kick-start the Webpack build process; all code-level syntax is handled inside the browser.js and server.js Webpack config files in kit/webpack, so that’s where plugins and transforms need to go.

Will report back here when decorator and static support is added.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find and fix problems in your JavaScript code - ESLint ...
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Linting React JSX with ESLint (in ES6) | egghead.io
ESLint is a JavaScript linter (static analysis tool) that offers full support for ES6, JSX, and other modern tools via plugins. We walk...
Read more >
What is linting and how can it save you time? - freeCodeCamp
lint, or a linter, is a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs.
Read more >
Lint the Code - Rediscovering JavaScript: ES6, ES7 & ES8
Get introduced to different types of lint tools and learn how to ensure secure, error-free code by linting code. We'll cover the following....
Read more >
A deep dive into linting in Node.js - LogRocket Blog
Take a deep dive into code linting Node.js, including why you should be using a linter and how they can help improve your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found