No restricted globals

I am using React and Redux to develop a webapp and when I started up my project I got this:

Line 13:  Unexpected use of 'location'  no-restricted-globals

Search for the keywords to learn more about each error.

I search a lot about how to resolve it, but none of the answers I found helped me, so I turned to Stack overflow.

Does anyone know how to fix this error? I appreciate all the help I can get.

Answers


Try adding window before location (i.e. window.location).


This is a simple and maybe not the best solution, but it works.

On the line above the line you get your error, paste this:

// eslint-disable-next-line no-restricted-globals


/* eslint no-restricted-globals:0 */

is another alternate approach


Need Your Help

Which signal does ctrl-x send when used in a terminal?

linux bash signals signal-handling ctrl

On Linux/Unix there are signals. The CtrlC one (SIGINT) is obvious to me.

.NET - Get protocol, host, and port

.net asp.net url uri authority

Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm on the following URL: