Since you are using react, I am assuming that you are using the useLocation() function that retrieves the router navigation.
In this case it is very common to assign it to a location variable in the following way:
const location = useLocation();
Then, I bet you're using it to retrieve for example the location.pathname.
Since eslint is detecting location as an element of window. it will throw the no-restricted-globals error compilation.
In order to fix this just rename the variable to the following:
const loc = useLocation();
Check out the following tsx/jsx code that describes the use of it.
const loc = useLocation();
return (
<div className="App">
<div className="app-container">
{loc.pathname !== '/login' && <Menu></Menu>}
<div className="mid-container">
<BodyContainer />
</div>
</div>
</div>
);
In the other hand, just in case you are using the location property from window (location.pathname) just adding window to it (window.location.pathname) will solve the issue as explained in the accepted answer.