Requiring browser module

Hi. I’m doing some project with Matter.js, and got some issue.

So, this is my index.html file head:

    <script src="https://cdnjs.cloudflare.com/ajax/libs/matter-js/0.12.0/matter.min.js"></script>
    <script src="/client.js"></script>

As you see, first off i’m installing matter.js and after that running my script, but in editor I get this:
image

If I’ll console log it, it will show up normally in page, is there way to hide this error message or something, because I don’t want to see them everywhere.

Thanks.

In the client.js script,

/* global Matter */

This will tell the hinter to treat Matter as a global variable defined elsewhere.

There’s a bunch of other configuration possible in https://jshint.com/docs/

Edit - maybe the editor is using eslinter rather than jshint? https://eslint.org/

2 Likes