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

[CLOSED] ERROR: Parsing Error: The keyword 'const' is reserved #12061

Open
3 tasks done
core-ai-bot opened this issue Aug 30, 2021 · 6 comments
Open
3 tasks done

[CLOSED] ERROR: Parsing Error: The keyword 'const' is reserved #12061

core-ai-bot opened this issue Aug 30, 2021 · 6 comments

Comments

@core-ai-bot
Copy link
Member

Issue by pixel3rr0r
Monday Nov 11, 2019 at 18:07 GMT
Originally opened as adobe/brackets#14960


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 329d08ffc) on Windows 10

@core-ai-bot
Copy link
Member Author

Comment by PortPixel
Sunday Dec 08, 2019 at 14:11 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by pixel3rr0r
Wednesday Jan 01, 2020 at 19:04 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by pixel3rr0r
Thursday Jan 02, 2020 at 19:13 GMT


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

Is it because of Node not starting?

@core-ai-bot
Copy link
Member Author

Comment by PortPixel
Thursday Jan 02, 2020 at 19:49 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by pixel3rr0r
Thursday Jan 16, 2020 at 19:24 GMT


Aha, now it worked! Thanks for your help!

@core-ai-bot
Copy link
Member Author

Comment by anna-rosew
Monday Nov 30, 2020 at 10:25 GMT


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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant