Routing: Enforce imports from the compat package (#95499)

This commit is contained in:
Alex Khomenko 2024-10-28 17:18:49 +02:00 committed by GitHub
parent 6f888720de
commit ba2d004161
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 0 deletions

View File

@ -49,6 +49,14 @@
"importNames": ["Trans", "t"],
"message": "Please import from app/core/internationalization instead",
},
{
"name": "react-router-dom",
"message": "Please import from react-router-dom-v5-compat instead"
},
{
"name": "react-router",
"message": "Please import from react-router-dom-v5-compat instead"
}
],
},
],

View File

@ -4,6 +4,7 @@ import { createMemoryHistory } from 'history';
import { fromPairs } from 'lodash';
import { stringify } from 'querystring';
import { Provider } from 'react-redux';
// eslint-disable-next-line no-restricted-imports
import { Route, Router } from 'react-router-dom';
import { of } from 'rxjs';
import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock';

View File

@ -1,5 +1,6 @@
import { css } from '@emotion/css';
import { ComponentType } from 'react';
// eslint-disable-next-line no-restricted-imports
import { Router } from 'react-router-dom';
import { CompatRouter } from 'react-router-dom-v5-compat';

View File

@ -1,6 +1,7 @@
import { Store } from '@reduxjs/toolkit';
import * as React from 'react';
import { Provider } from 'react-redux';
// eslint-disable-next-line no-restricted-imports
import { Router } from 'react-router-dom';
import { CompatRouter } from 'react-router-dom-v5-compat';
import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock';

View File

@ -5,6 +5,7 @@ import { createMemoryHistory, MemoryHistoryBuildOptions } from 'history';
import { Fragment, PropsWithChildren } from 'react';
import * as React from 'react';
import { Provider } from 'react-redux';
// eslint-disable-next-line no-restricted-imports
import { Router } from 'react-router-dom';
import { CompatRouter } from 'react-router-dom-v5-compat';
import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock';