Skip to content

Configuring global functions #14210

Answered by mdjermanovic
Atulin asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Atulin!

I think the correct solution would be to set the globals to "off" for the file where they're declared, as they are not already declared before that script executes.

That can be done either directly in the file, using the /* global */ configuration comment:

/* global getCookieValue: off, setCookie: off */

or in the config file, using overrides:

"globals": {
    "getCookieValue": "readonly",
    "setCookie": "readonly"
},
"overrides": [
    {
        "files": ["path/to/site.js"],
        "globals": {
            "getCookieValue": "off",
            "setCookie": "off"
        }
    }    
]

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Atulin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants