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.

Since it is called es6 and I am using es6 syntax why are let and others are not supported?

See original GitHub issue

Hi!

The project seems promising however I cannot make it work on my ES6 code. I also added ‘use strict’; and using ESlint.

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (..emitted..\plato.js:30:15)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

My npm is:

  npm: '2.15.9',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '56.1',
  modules: '46',
  node: '4.6.1',
  openssl: '1.0.2j',
  uv: '1.9.1',
  v8: '4.5.103.37',
  zlib: '1.2.8' 

***Update: updated to node: ‘7.1.0’, now all I get is NaN everywhere and having issues with .reduce()

Error reading file src\client\application.js:  TypeError: (options.globals || []).reduce is not a function
TypeError: (options.globals || []).reduce is not a function
    at new Config (\node_modules\eslint\lib\config.js:211:44)
    at CLIEngine.executeOnText (\node_modules\eslint\lib\cli-engine.js:741:28)
    at lint (\node_modules\es6-plato\lib\reporters\eslint\index.js:49:23)
    at Object.process (\node_modules\es6-plato\lib\reporters\eslint\index.js:6:16)
    at processReporter (\node_modules\es6-plato\lib\plato.js:151:31)
    at \node_modules\lodash\lodash.js:4977:15
    at baseForOwn (\node_modules\lodash\lodash.js:3020:24)
    at \node_modules\lodash\lodash.js:4946:18
    at Function.forEach (\node_modules\lodash\lodash.js:9351:14)
    at \node_modules\es6-plato\lib\plato.js:146:7

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
garrymanncommented, Nov 20, 2016

Brilliant! Cheers for that! 😃

1reaction
the-simiancommented, Nov 17, 2016

Ok quick followup, @garrymann and @nlindley I know what your problem is with the globals prop: see here…

let lintRules = {
    'rules': {
        'indent': [
            2, 'tab'
        ],
        'quotes': [
            2, 'single'
        ],
        'semi': [
            2, 'always'
        ],
        'no-console': [1],
        'curly': ['error'],
        'no-dupe-keys': 2,
        'func-names': [1, 'always']
    },
    'env': {
        'es6': true
    },
    'globals': ['require'], //<---------------- that 
    'parserOptions': {
        'sourceType': 'module',
        'ecmaFeatures': {
            'jsx': true,
            'modules': true
        }
    }
};

look at the globals property. Basically the eslint api changed at some point. I updated my readme example to reflect this. It used to be an object { require: true }, but now it is an Array ['require'].

I just pulled down the latest and ran it. Everything is working just fine! Hope that helps 😃 Feel free to open another issue if you have any problems. Sorry if I took too long to respond, yesterday was pretty busy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ES6 In Depth: let and const - the Web developer blog
(Crunchy syntax details: let is a reserved word in strict mode code. In non-strict-mode code, for the sake of backward compatibility, you can ......
Read more >
dojo build systems does not recognize es6 syntax
I have in one project older ES5 modules and new ones in ES6. ... declarations (let, const, function, class) not yet supported outside...
Read more >
How to enable ES6 (and beyond) syntax with Node and Express
We need a package that translates ES6 and above syntax to ES5 code. ES5 code is the JS syntax style that is readable...
Read more >
"es6" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
ECMAScript 6 (ES6): What's New In The Next Version Of ...
Often one would use, for example, the j variable for another iteration in the same scope. But with let , you could safely...
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