brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

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

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by pixel3rr0r Monday Nov 11, 2019 at 18:07 GMT Originally opened as https://github.com/adobe/brackets/issues/14960


Prerequisites

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 commented 3 years ago

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 commented 3 years ago

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


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

core-ai-bot commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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


Aha, now it worked! Thanks for your help!

core-ai-bot commented 3 years ago

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