Re: GJS internal linter



Since I've received zero answers on this one, I've assumed there was no way to do that.

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:
https://github.com/WebReflection/babel-standalone#babel-standalone

That fork made it possible for jsgtk ( https://github.com/WebReflection/jsgtk#jsgtk ) to include modules via `require("npm-module")` or `require("./local-module")` written directly in ES2015 syntax.

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":
https://github.com/WebReflection/jsgtk/blob/master/jsgtk#L94-L104

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:
  1. forget about `imports.lang` and old MooTools, write native `class` as if there's no yesterday
  2. string templates all the things
  3. methods shorthands for any `{objects(){ return this.constructor; }}` or class definition
  4. named parameters
  5. 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



On Thu, Apr 7, 2016 at 10:27 AM, Andrea Giammarchi <andrea giammarchi gmail com> wrote:
I wonder if there's a way to suppress, either via code or via CLI option, warnings about functions never returning (actually, every sort of warning, not just this one).

It's cool to have an integrated linter but it also makes it impossible to reuse code that doesn't care about those messages or rules.

This is not about how good-practice is to lint code and how dangerous a function that is meant to return undefined could be if it actually does not explicitly return undefined ... this is about code/modules interoperability with GJS.

For instance, in jsgtk I'm trying to bring in babel-standalone at runtime for lazily npm-like imported modules (so that mozjs core can be polyfilled where needed) but there are gazillion errors shown each time simply importing that file.

I really don't care about these errors: the library is huge, well tested, and not even mine.
Having a way to suppress, even temporarily, those warnings, would be a huge help.

Thanks in advance for any possible outcome.

Best Regards



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]