Hi Andrea,
Since I've received zero answers on this one, I've assumed there was no way to do that.
I'm sure there is a way, but I just had no time to investigate this week. Sorry.
I believe the "internal linter" is a SpiderMonkey thing, not GJS, so it would be more a question of whether GJS would accept a patch to disable it.
I originally submitted a patch to upstream Jasmine where I fixed those warnings, and they accepted some of my modifications, but not these particular ones, as they said that putting functions after an unconditional return statement is a style choice that they prefer. (Since functions are [I think?] hoisted then this warning is probably not a good one, anyway.)
However since most of the SpiderMonkey warnings are reasonable, the upstream modules might well accept your modifications.
If interested, I've fixed that one for you. I've forked and hand-patched babel-standalone build to be compatible with GJS internal linter:
This is really interesting!
The following is the plugins "preset" I'm using for mozjs24 since it's IMO not worth bringing in the entire ES2015 preset because most of it "just works":
Anyway, my babel-standalone fork would be capable of translating at runtime that too.
What does it mean for GJS develoeprs? Following just few improvements:
- forget about `imports.lang` and old MooTools, write native `class` as if there's no yesterday
Is there a way to write GObject-derived classes using the native ES6 class keyword? (That's the only reason for the existence of the Lang.Class metaclass, as far as I'm concerned.)
- string templates all the things
- methods shorthands for any `{objects(){ return this.constructor; }}` or class definition
- named parameters
- unicode capable RegExp /via/u <-- flag
Hope somebody will find jsgtk or at least the GJS compatible version of babel-standalone useful.
I'm here to answer any question, if needed.
Best Regards
_______________________________________________
_javascript_-list mailing list
_javascript_-list gnome org
https://mail.gnome.org/mailman/listinfo/_javascript_-list