The Linter and globals

I want to know if I need to add a topline Linter comment such as // globals Phaser3scenefilename.js
so I can import javascript (Phaser 3 scene) files. e.g. sceneMain.js
I saw something like this in the past but not sure if it still applies with Glitch and ESLint.
I can’t seem to find the old help discussion I saw previously.

1 Like

Hi @laserblue

Yes, you can use a comment to make ESLint assume that certain objects (not files) are globals.

You can also change your .eslintrc.json to recognise these things (not sure how, haven’t tried).

So in a file where you got red squigglies under Vue and VueLocalStorage for example, drop in a comment at the top like

/* global Vue, VueLocalStorage */

Here’s a related answer:

Hope it helps :slight_smile:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.