brackets-archive / bracketsIssues

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

ES6 Support #13360

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by MarcelGerber Sunday Aug 30, 2015 at 23:35 GMT Originally opened as https://github.com/adobe/brackets/issues/11644


As a long term goal, we should look into adding proper ES6 (ES2015) (guides: 1 2) support. ES6 is already being used in a whole lot of applications, ranging from server-side code running on Node/io.js to client-side code transpiled with Babel and the like.

This includes:

I'd love to hear your feedback on these points. Feel free to elaborate on them, add new ones, or simply add your two cents. You can talk about the cool new feature you saw in this cool new editor, too. Thanks!

core-ai-bot commented 3 years ago

Comment by zaggino Monday Aug 31, 2015 at 04:50 GMT


My bit -> we should support async/await - even if it's not part of ES6, as it's gaining popularity and from what I've tested, atom and code work reasonably well with it. So far I've submitted this fix for CodeMirror to fix syntax highlighting in Brackets: https://github.com/codemirror/CodeMirror/commit/94fc3b71e8e9f52b9239276a34658023933aac68

core-ai-bot commented 3 years ago

Comment by petetnt Monday Aug 31, 2015 at 05:46 GMT


:+1:

I have been doing ES6 stuff in Brackets for a while now and everything works fairly well.

I'd be in favor for switching default linter from JSLint to something a bit more configurable. I recently switched to ESLint (from JSHint) because of doing lots of React/JSX/ES6 stuff and it's great (minus@zaggino's great Brackets-ESLint sometimes failing to load because of #11613, hopefully that's fixed by 1.5). Is Brackets itself still linted with JSLint? There was some discussion about switching that too sometime ago which could mean that this could be a good time for that.

core-ai-bot commented 3 years ago

Comment by danvim Wednesday Sep 02, 2015 at 14:39 GMT


+1

core-ai-bot commented 3 years ago

Comment by MiguelCastillo Wednesday Sep 02, 2015 at 15:07 GMT


I have been running ternific with the latest version of tern, and autocomplete is working pretty well.

core-ai-bot commented 3 years ago

Comment by ingorichter Wednesday Sep 02, 2015 at 16:05 GMT


+1 The update of the default linter is on my wishlist for a loong time. I'm using eslint most of the time, because of it's flexibility.

The rest of the list looks good and makes sense to me.

core-ai-bot commented 3 years ago

Comment by MiguelCastillo Friday Sep 11, 2015 at 22:35 GMT


ESLint 1 has been out for a little bit now, so I think we should be good to move brackets over to that.

I don't see an ESLint branch. @zaggino wanna pair up on adding ESLint? I can get something started.

core-ai-bot commented 3 years ago

Comment by zaggino Friday Sep 11, 2015 at 22:52 GMT


@MiguelCastillo Not sure what do you mean by adding ESLint, Defining linting rules for Brackets core? or? I have already put together an extension https://github.com/zaggino/brackets-eslint which I use to lint my projects.

core-ai-bot commented 3 years ago

Comment by MiguelCastillo Friday Sep 11, 2015 at 23:04 GMT


It's switching from jslint/jshint to eslint. There is lots of inline jslint annotations in the source. This means switching the grunt build to eslint and creating an .eslintrc. This is a really big effort because currently the default extension for linting in brackets is jslint, and we might want to have the default linting extension based on eslint.

@ingorichter What are your thoughts on this?

core-ai-bot commented 3 years ago

Comment by zaggino Friday Sep 11, 2015 at 23:42 GMT


Ah, understood. I currently don't have much time for any big efforts, I've been dedicating free time to rewriting bracktes-git for weeks now.

core-ai-bot commented 3 years ago

Comment by ingorichter Monday Sep 14, 2015 at 04:11 GMT


I'm happy to help getting eslint as default linter for the brackets codebase. IMHO, eslint provides the most configurable linter engine that can easily replace jslint and jshint at the same time. I don't remember the subtle differences between jslint and jshint, that prevented us from using jshint. But this was a discussion many moons ago and things have improved, especially for eslint as a big contender to conquer the veterans in this field. If we can get it to work with the codebase with less friction, that would be aweseome. It seems, that #11693 provides a good starting point. We need to make minor config changes to disable jslint as default linter in Brackets, but that is not a big deal. Let's go for it.

core-ai-bot commented 3 years ago

Comment by petetnt Monday Sep 14, 2015 at 05:32 GMT


@ingorichter the blocker moving from JSLint to JSHint was JSHint not having the options to enforce coding styles IIRC. Which is totally not an issue with ESLint which is great.

If there's anything specific about eslint that needs help with I am more than happy to contribute too.

core-ai-bot commented 3 years ago

Comment by MarcelGerber Thursday Sep 17, 2015 at 15:51 GMT


Maybe we can outsource the switch to ESLint (and corresponding discussion) into another issue, as it's quite big a undertaking on its own?

core-ai-bot commented 3 years ago

Comment by MiguelCastillo Thursday Sep 17, 2015 at 15:53 GMT


@MarcelGerber Yup, I think that makes sense... Let's push it over to this thread. https://github.com/adobe/brackets/pull/11693

core-ai-bot commented 3 years ago

Comment by meteormanaged Tuesday Nov 03, 2015 at 23:22 GMT


Any plans for this in the short term?

core-ai-bot commented 3 years ago

Comment by stowball Tuesday Nov 17, 2015 at 06:22 GMT


The lack of code hinting/introspection inside arrow functions is a massive blocker for me in my current role. Everything we write is in ES6 :(.

For example:

let foo;

(baz) => {
  // Hints here
}

Should provide hints for both foo and baz inside the arrow function. Also, all JS code hints seem to break in the entire app when I do something with React components.

Also, I give a million +1's for having ESLint as the default JS linter.

core-ai-bot commented 3 years ago

Comment by petetnt Tuesday Nov 17, 2015 at 07:30 GMT


@stowball Codehints work inside arrow functions for me. Have you tried the latest master (https://github.com/adobe/brackets/wiki/How-to-Hack-on-Brackets)?

The Javascript hinting should work for React components too, but there's no JSX support for Codemirror yet (see #11061), which means that HTML/React component hinting cannot be used in .jsx components

core-ai-bot commented 3 years ago

Comment by stowball Tuesday Nov 17, 2015 at 22:08 GMT


I wasn't far behind master, but just updated and still no dice. It seems brackets gives no codehints for variables defined with let and const, and nothing works inside arrow functions :(

The following code only gave me a code hint for long and bar inside of the normal function :(

var long;
let sausage;
const dog;

function (bar) {
    long; // works
    sausage;
    dog;
    bar; // works
}

(baz) => {
    long;
    sausage;
    dog;
    baz;
}
core-ai-bot commented 3 years ago

Comment by petetnt Wednesday Nov 18, 2015 at 06:58 GMT


@stowball weird, now I can repro the issue too. I thought that at least cherry picking #11569 would have at least fixed that but still the issue persists. Would be worth a try to bump tern to 0.16 and see if it's fixed.

core-ai-bot commented 3 years ago

Comment by johann-petrak Monday Aug 03, 2020 at 06:49 GMT


Just tried release 1.14.1 (because 1.14.2 cannot be installed on Ubuntu 20.4 with the available deb package and snap install uses this release) and noticed that a class declaration is shown as a syntax error. Is this really not something brackets understands?