Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

ERROR: Parsing Error: The keyword 'const' is reserved #14960

Closed
3 tasks done
pixel3rr0r opened this issue Nov 11, 2019 · 6 comments
Closed
3 tasks done

ERROR: Parsing Error: The keyword 'const' is reserved #14960

pixel3rr0r opened this issue Nov 11, 2019 · 6 comments

Comments

@pixel3rr0r
Copy link

Prerequisites

  • Can you reproduce the problem with Debug -> Reload Without Extensions?
  • Did you perform a cursory search to see if your bug or enhancement is already reported?
  • Did you read the Troubleshooting guide?

Description

I've started a new project only containing three files, HTML, CSS and JS. HTML works fine, CSS works fine, but I just can't get the JavaScript to work. I've only written

'use strict'

const body = document.body;

I then get three JSLint Errors and one ESLint Errors:

image

Apparently Brackets does not support ES6. Since I have never worked with JSLint, I have absolutely no idea what to do.

Is there a global fix that works for new projects as well?

Steps to Reproduce

  1. Create a JavaScript-File with a fresh installation of Brackets
  2. Write the code mentioned above
  3. Voilà!

Expected behavior: Accept ES6 code

Actual behavior: Outputing warnings and an error.

Versions

I'm running Brackets Release 1.14 build 1.14.0-17740 (release 329d08f) on Windows 10

@PortPixel
Copy link

PortPixel commented Dec 8, 2019

Add /*eslint-env es6*/ to the top of the file(s)

@pixel3rr0r
Copy link
Author

Thanks, that worked! And sorry for the late reply!

@pixel3rr0r
Copy link
Author

It worked for a while, but then I started getting errors like these:
image

Is it because of Node not starting?

@pixel3rr0r pixel3rr0r reopened this Jan 2, 2020
@PortPixel
Copy link

PortPixel commented Jan 2, 2020

No, it's because its not defined anywhere jslint can see, add /*global require*/ to the top of the file(s) to tell jslint it's defined elsewhere.

@pixel3rr0r
Copy link
Author

Aha, now it worked! Thanks for your help!

@anna-rosew
Copy link

Hi,
I've had exactly the same issue but it doesn't work to insert /*global require*/ to the top of the file having added /eslint-env es6/S, I didn't know if there was an issues with my placement? I'm attempting to create a basic voice recognition app and I;m new to .js so could use some help.
Screenshot 2020-11-30 at 10 25 15

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants