aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/design-system/src/components
diff options
context:
space:
mode:
authorIsmail Cherri <ismail.cherri@sonarsource.com>2024-04-16 02:28:41 -0500
committersonartech <sonartech@sonarsource.com>2024-04-16 20:02:44 +0000
commit66742a26cfa62ce98aff58e0f04dbf1708c2d9e6 (patch)
tree983bab02658a70bf91b308e0b5db73f062b9691c /server/sonar-web/design-system/src/components
parent6055f0479310bd81bb548ba53a2ef111e1847a74 (diff)
downloadsonarqube-66742a26cfa62ce98aff58e0f04dbf1708c2d9e6.tar.gz
sonarqube-66742a26cfa62ce98aff58e0f04dbf1708c2d9e6.zip
SONAR-21970 implement prettier plugin organize imports
Diffstat (limited to 'server/sonar-web/design-system/src/components')
-rw-r--r--server/sonar-web/design-system/src/components/__tests__/Link-test.tsx11
-rw-r--r--server/sonar-web/design-system/src/components/__tests__/NavLink-test.tsx11
2 files changed, 14 insertions, 8 deletions
diff --git a/server/sonar-web/design-system/src/components/__tests__/Link-test.tsx b/server/sonar-web/design-system/src/components/__tests__/Link-test.tsx
index ddfe30ed5ba..f9140e16dcd 100644
--- a/server/sonar-web/design-system/src/components/__tests__/Link-test.tsx
+++ b/server/sonar-web/design-system/src/components/__tests__/Link-test.tsx
@@ -18,8 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { screen } from '@testing-library/react';
-// @ts-expect-error React is needed for <></> fragments
-import React from 'react';
+import * as React from 'react';
import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom';
import { render } from '../../helpers/testUtils';
import { ContentLink, DiscreetLink, StandoutLink as Link } from '../Link';
@@ -117,10 +116,14 @@ const setupWithMemoryRouter = (component: JSX.Element, initialEntries = ['/initi
<Routes>
<Route
element={
- <>
+ // Below: using <></> won't work in extensions ('React' is not defined). This is because the
+ // name 'React' would already have been minified to something else when <> is resolved to
+ // React.Fragment
+ // eslint-disable-next-line react/jsx-fragments
+ <React.Fragment>
{component}
<ShowPath />
- </>
+ </React.Fragment>
}
path="/initial"
/>
diff --git a/server/sonar-web/design-system/src/components/__tests__/NavLink-test.tsx b/server/sonar-web/design-system/src/components/__tests__/NavLink-test.tsx
index e4004765875..6aaa88a9c44 100644
--- a/server/sonar-web/design-system/src/components/__tests__/NavLink-test.tsx
+++ b/server/sonar-web/design-system/src/components/__tests__/NavLink-test.tsx
@@ -18,8 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { screen } from '@testing-library/react';
-// @ts-expect-error React is needed for <></> fragments
-import React from 'react';
+import * as React from 'react';
import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom';
import { render } from '../../helpers/testUtils';
import NavLink from '../NavLink';
@@ -99,10 +98,14 @@ const setupWithMemoryRouter = (component: JSX.Element, initialEntries = ['/initi
<Routes>
<Route
element={
- <>
+ // Below: using <></> won't work in extensions ('React' is not defined). This is because the
+ // name 'React' would already have been minified to something else when <> is resolved to
+ // React.Fragment
+ // eslint-disable-next-line react/jsx-fragments
+ <React.Fragment>
{component}
<ShowPath />
- </>
+ </React.Fragment>
}
path="/initial"
/>