0

I tried to add this to my eslint global variable

"globals": {
    "document": false,
    "navigator": false,
    "window": false,
    "rndr": false,
    "shrd": false,
    "path": true,
    "$": false // <--- I also added this
}

but still I am getting undeclared variable or function.

Here is the flycheck verification. enter image description here

But the error is still there.

enter image description here

Please, I need some guidance how to fix this.

Thanks

1

If you use flycheck and js2-mode, the error is shown by js2-mode not by flycheck.

You can disable js2-mode errors by setting

  (setq js2-mode-show-parse-errors nil)
  (setq js2-mode-show-strict-warnings nil)
0

You can customize js2-global-externs to your liking. It applies to every js2-mode buffer, so you won't need to duplicate your customization.

A list of any extern names you’d like to consider always declared. This list is global and is used by all ‘js2-mode’ files. You can create buffer-local externs list using ‘js2-additional-externs’.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.