Skip to content

Commit

Permalink
Use import attributes when importing json files (#1174) (#1176)
Browse files Browse the repository at this point in the history
* Use import attributes for json imports.

* rush change

* Add useTranslation to prettierignore

(cherry picked from commit cc00785)

Co-authored-by: GerardasB <[email protected]>
  • Loading branch information
mergify[bot] and GerardasB authored Jan 16, 2025
1 parent 91a4776 commit 778c12f
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ playwright-report

# test-app specific
routeTree.gen.ts

# temporary until prettier is updated
useTranslation.tsx
10 changes: 10 additions & 0 deletions common/changes/@itwin/appui-react/issue-1165_2025-01-15-15-07.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/appui-react",
"comment": "Use import attributes for json imports.",
"type": "none"
}
],
"packageName": "@itwin/appui-react"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/components-react",
"comment": "Use import attributes for json imports.",
"type": "none"
}
],
"packageName": "@itwin/components-react"
}
10 changes: 10 additions & 0 deletions common/changes/@itwin/core-react/issue-1165_2025-01-15-15-07.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-react",
"comment": "Use import attributes for json imports.",
"type": "none"
}
],
"packageName": "@itwin/core-react"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/imodel-components-react",
"comment": "Use import attributes for json imports.",
"type": "none"
}
],
"packageName": "@itwin/imodel-components-react"
}
2 changes: 1 addition & 1 deletion ui/appui-react/src/appui-react/hooks/useTranslation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion ui/core-react/src/core-react/l10n/useTranslation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 778c12f

Please sign in to comment.