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

Add GJS environment #73

Closed
wants to merge 1 commit into from
Closed

Add GJS environment #73

wants to merge 1 commit into from

Conversation

mattiasb
Copy link

GJS is a JavaScript environment used in the GNOME Project.

@sindresorhus
Copy link
Owner

Can you link to some docs about it?

@mattiasb
Copy link
Author

The project page
The git repository

@mattiasb
Copy link
Author

The globals are fetched from the gjs repl, like this:

gjs> Object.getOwnPropertyNames( window )
undefined,Object,Function,eval,Array,Boolean,Error,InternalError,
EvalError,RangeError,ReferenceError,SyntaxError,TypeError,
URIError,Math,isNaN,isFinite,parseFloat,parseInt,NaN,Infinity,Number,
JSON,RegExp,String,escape,unescape,uneval,decodeURI,encodeURI,
decodeURIComponent,encodeURIComponent,Int8Array,Uint8Array,
Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,
Uint8ClampedArray,DataView,ArrayBuffer,Iterator,StopIteration,Date,
WeakMap,Proxy,Map,Set,Reflect,Debugger,window,log,logError,print,
printerr,GjsFileImporter,imports,ARGV

@sindresorhus
Copy link
Owner

It should only include globals not already included in builtin.

@mattiasb
Copy link
Author

Ok! Will amend tonight!

GJS is a JavaScript environment used in the GNOME Project.
@mattiasb
Copy link
Author

These were in builtin but not in GJS:

[
  "constructor",
  "hasOwnProperty",
  "isPrototypeOf",
  "Promise",
  "propertyIsEnumerable",
  "Symbol",
  "System",
  "toLocaleString",
  "toString",
  "valueOf",
  "WeakSet"
] 

Maybe that's okay though?

gnomesysadmins pushed a commit to GNOME/gnome-maps that referenced this pull request Jan 31, 2016
The ESLint recommended rules will complain about access to global
variables that it doesn't know about. This is good, but ESLint
doesn't yet know about the GJS environment.

There is a PR (sindresorhus/globals#73) for the
globals project on Github (which ESLint uses) to add the GJS environment
and all its global variables.

Until the above mentioned PR is merged, explicitly allow all default
GJS global variables.
@sindresorhus
Copy link
Owner

@mattiasb That's ok. builtin includes ES2015 (ES6) too. If users only want ES5 stuff, they use the es5 field instead of builtin.

@sindresorhus
Copy link
Owner

LGTM

@sindresorhus
Copy link
Owner

@nzakas ?

@nzakas
Copy link
Collaborator

nzakas commented Feb 1, 2016

I'm curious, is the intent of adding these solely for use in ESLint?

The reason I ask is that 2.0.0 (hopefully out next week) supports custom environments in plugins, so it might end up being better to have these in a plugin rather than this package.

@mattiasb
Copy link
Author

mattiasb commented Feb 1, 2016

Yeah pretty much.

Is the idea to move all environments to ESLint plugins in the future? What do I gain by putting this in a plugin instead of in here? :)

@nzakas
Copy link
Collaborator

nzakas commented Feb 2, 2016

@mattiasb the idea is to democratize environments so that anyone can create and share an environment without having to go through a gatekeeper. It's just not sustainable for us to have to keep adding every random JavaScript environment and library globals.

@mattiasb
Copy link
Author

mattiasb commented Feb 2, 2016

That makes sense! :) Also if 2.0.0 is out around as soon as you I can just start with the latest beta.

Thanks!

@mattiasb mattiasb closed this Feb 2, 2016
@nzakas
Copy link
Collaborator

nzakas commented Feb 3, 2016

We are aiming to have the final 2.0.0 out either this week or next week.

gnomesysadmins pushed a commit to GNOME/gnome-maps that referenced this pull request Feb 4, 2016
The ESLint recommended rules will complain about access to global
variables that it doesn't know about. This is good, but ESLint
doesn't yet know about the GJS environment.

There is a PR (sindresorhus/globals#73) for the
globals project on Github (which ESLint uses) to add the GJS environment
and all its global variables.

Until the above mentioned PR is merged, explicitly allow all default
GJS global variables.
gnomesysadmins pushed a commit to GNOME/gnome-maps that referenced this pull request Feb 17, 2016
The ESLint recommended rules will complain about access to global
variables that it doesn't know about. This is good, but ESLint
doesn't yet know about the GJS environment.

There is a PR (sindresorhus/globals#73) for the
globals project on Github (which ESLint uses) to add the GJS environment
and all its global variables.

Until the above mentioned PR is merged, explicitly allow all default
GJS global variables.
gnomesysadmins pushed a commit to GNOME/gnome-maps that referenced this pull request Feb 27, 2016
The ESLint recommended rules will complain about access to global
variables that it doesn't know about. This is good, but ESLint
doesn't yet know about the GJS environment.

There is a PR (sindresorhus/globals#73) for the
globals project on Github (which ESLint uses) to add the GJS environment
and all its global variables.

Until the above mentioned PR is merged, explicitly allow all default
GJS global variables.
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

Successfully merging this pull request may close these issues.

None yet

3 participants