From e87aa6eb5e81b1dffab8ccc1d4b5a990258efc9d Mon Sep 17 00:00:00 2001 From: GerardasB <10091419+GerardasB@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:06:48 +0200 Subject: [PATCH 1/3] Use import attributes for json imports. --- ui/appui-react/src/appui-react/hooks/useTranslation.tsx | 2 +- .../src/components-react/l10n/useTranslation.tsx | 2 +- ui/core-react/src/core-react/l10n/useTranslation.tsx | 2 +- .../src/imodel-components-react/useTranslation.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/appui-react/src/appui-react/hooks/useTranslation.tsx b/ui/appui-react/src/appui-react/hooks/useTranslation.tsx index ebf3fdfdd39..e54555bf891 100644 --- a/ui/appui-react/src/appui-react/hooks/useTranslation.tsx +++ b/ui/appui-react/src/appui-react/hooks/useTranslation.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as defaults from "../UiFramework.json"; +import * as defaults from "../UiFramework.json" with { type: "json" }; import * as React from "react"; import { usePackageTranslation } from "@itwin/core-react/internal"; import { UiFramework } from "../UiFramework.js"; diff --git a/ui/components-react/src/components-react/l10n/useTranslation.tsx b/ui/components-react/src/components-react/l10n/useTranslation.tsx index 948269763f3..0b4ae2df5af 100644 --- a/ui/components-react/src/components-react/l10n/useTranslation.tsx +++ b/ui/components-react/src/components-react/l10n/useTranslation.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as defaults from "../UiComponents.json"; +import * as defaults from "../UiComponents.json" with { type: "json" }; import * as React from "react"; import { usePackageTranslation } from "@itwin/core-react/internal"; import { UiComponents } from "../UiComponents.js"; diff --git a/ui/core-react/src/core-react/l10n/useTranslation.tsx b/ui/core-react/src/core-react/l10n/useTranslation.tsx index e3bc706d6d8..cad7617d4b7 100644 --- a/ui/core-react/src/core-react/l10n/useTranslation.tsx +++ b/ui/core-react/src/core-react/l10n/useTranslation.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as defaults from "../UiCore.json"; +import * as defaults from "../UiCore.json" with { type: "json" }; import * as React from "react"; import { UiCore } from "../UiCore.js"; import { usePackageTranslation } from "./usePackageTranslation.js"; diff --git a/ui/imodel-components-react/src/imodel-components-react/useTranslation.tsx b/ui/imodel-components-react/src/imodel-components-react/useTranslation.tsx index 9c36886e5fb..c933bc02775 100644 --- a/ui/imodel-components-react/src/imodel-components-react/useTranslation.tsx +++ b/ui/imodel-components-react/src/imodel-components-react/useTranslation.tsx @@ -2,7 +2,7 @@ * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import * as defaults from "./UiIModelComponents.json"; +import * as defaults from "./UiIModelComponents.json" with { type: "json" }; import * as React from "react"; import { usePackageTranslation } from "@itwin/core-react/internal"; import { UiIModelComponents } from "./UiIModelComponents.js"; From 9d1f2112b8d76e3472dad61ac818bc2c4179ca04 Mon Sep 17 00:00:00 2001 From: GerardasB <10091419+GerardasB@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:08:56 +0200 Subject: [PATCH 2/3] rush change --- .../appui-react/issue-1165_2025-01-15-15-07.json | 10 ++++++++++ .../components-react/issue-1165_2025-01-15-15-07.json | 10 ++++++++++ .../@itwin/core-react/issue-1165_2025-01-15-15-07.json | 10 ++++++++++ .../issue-1165_2025-01-15-15-07.json | 10 ++++++++++ 4 files changed, 40 insertions(+) create mode 100644 common/changes/@itwin/appui-react/issue-1165_2025-01-15-15-07.json create mode 100644 common/changes/@itwin/components-react/issue-1165_2025-01-15-15-07.json create mode 100644 common/changes/@itwin/core-react/issue-1165_2025-01-15-15-07.json create mode 100644 common/changes/@itwin/imodel-components-react/issue-1165_2025-01-15-15-07.json diff --git a/common/changes/@itwin/appui-react/issue-1165_2025-01-15-15-07.json b/common/changes/@itwin/appui-react/issue-1165_2025-01-15-15-07.json new file mode 100644 index 00000000000..8a7d5bac5ec --- /dev/null +++ b/common/changes/@itwin/appui-react/issue-1165_2025-01-15-15-07.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/appui-react", + "comment": "Use import attributes for json imports.", + "type": "none" + } + ], + "packageName": "@itwin/appui-react" +} \ No newline at end of file diff --git a/common/changes/@itwin/components-react/issue-1165_2025-01-15-15-07.json b/common/changes/@itwin/components-react/issue-1165_2025-01-15-15-07.json new file mode 100644 index 00000000000..71b9c96ad0e --- /dev/null +++ b/common/changes/@itwin/components-react/issue-1165_2025-01-15-15-07.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/components-react", + "comment": "Use import attributes for json imports.", + "type": "none" + } + ], + "packageName": "@itwin/components-react" +} \ No newline at end of file diff --git a/common/changes/@itwin/core-react/issue-1165_2025-01-15-15-07.json b/common/changes/@itwin/core-react/issue-1165_2025-01-15-15-07.json new file mode 100644 index 00000000000..909cbe388f8 --- /dev/null +++ b/common/changes/@itwin/core-react/issue-1165_2025-01-15-15-07.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/core-react", + "comment": "Use import attributes for json imports.", + "type": "none" + } + ], + "packageName": "@itwin/core-react" +} \ No newline at end of file diff --git a/common/changes/@itwin/imodel-components-react/issue-1165_2025-01-15-15-07.json b/common/changes/@itwin/imodel-components-react/issue-1165_2025-01-15-15-07.json new file mode 100644 index 00000000000..b51535f7d66 --- /dev/null +++ b/common/changes/@itwin/imodel-components-react/issue-1165_2025-01-15-15-07.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/imodel-components-react", + "comment": "Use import attributes for json imports.", + "type": "none" + } + ], + "packageName": "@itwin/imodel-components-react" +} \ No newline at end of file From 6c95de6c92b42991407ea092566608e4d192e22f Mon Sep 17 00:00:00 2001 From: GerardasB <10091419+GerardasB@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:01:05 +0200 Subject: [PATCH 3/3] Add useTranslation to prettierignore --- .prettierignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.prettierignore b/.prettierignore index 82904a8e2e6..6abdbaa8b43 100644 --- a/.prettierignore +++ b/.prettierignore @@ -31,3 +31,6 @@ playwright-report # test-app specific routeTree.gen.ts + +# temporary until prettier is updated +useTranslation.tsx