A
A
Alex2020-10-21 15:33:33
JavaScript
Alex, 2020-10-21 15:33:33

How to mark a function as global in PhpStorm?

I have a function file. This function must be declared globally, no exports are needed. It is called from a third-party module outside the project.

function get3PAuthorizationUrls() {
    // ...
}

The problem is that the IDE sees that I'm not calling this function anywhere, and displays a warning:
Unused function get3PAuthorizationUrls
How to get rid of this? How do I tell the IDE that I shouldn't call this function, that it should exist and be global?

I tried adding export
export function get3PAuthorizationUrls() {
  // ...
}

Tried to add a tagglobal
/**
 * @global
 */
export function get3PAuthorizationUrls() {
  // ...
}

But the IDE still swears

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nokimaro, 2020-10-21
@Kozack

PhpStorm does not swear, but only notifies you of a possible problem.
The most correct solution is to simply ignore this warning, since the developer knows better.
If it interferes with your life, then you can disable this check in the Inspections section for this project.

spoiler
5f90459b40bf4718754553.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question