Skip to content

Commit

Permalink
Apply to all tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura committed Apr 11, 2024
1 parent 2f611d9 commit 9501493
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 55 deletions.
29 changes: 1 addition & 28 deletions examples/get-starknet/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,8 @@
{
"extends": "../../tsconfig.react.json",
"compilerOptions": {
"baseUrl": ".",
"rootDir": "./src",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"declaration": true,
"target": "ES2020",
"module": "ESNext",
"strict": false,
"jsx": "preserve",
"jsxImportSource": "@emotion/react",
"allowJs": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"esModuleInterop": true,
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"downlevelIteration": true,
"noEmit": true,
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
],
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import ControllerConnector from "@cartridge/connector";
import { useAccount, useConnect, useDisconnect } from "@starknet-react/core";

export function ConnectWallet() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useAccount, useContractWrite } from "@starknet-react/core";
import { useEffect, useState } from "react";
import { useState } from "react";

const worldAddress =
"0x426bf51e62109e5c98e7d36dddf813881b610a1ff7c241e51ec3533ce58778c";
// const worldAddress =
// "0x426bf51e62109e5c98e7d36dddf813881b610a1ff7c241e51ec3533ce58778c";
const actionsAddress =
"0x6823753387c85935c6a3d141fb273e35ea9114a5f6e1c2b69d7c5bc3916c7f2";

Expand Down
6 changes: 5 additions & 1 deletion examples/starknet-react-next/src/components/SignMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { useState } from "react";
import { typedData } from "starknet";

export function SignMessage() {
const { address, account } = useAccount();
const {
// address,
account,
} = useAccount();
// const { contract } = useContract({
// address,
// });
Expand Down Expand Up @@ -99,6 +102,7 @@ export function SignMessage() {
);
}

// @ts-expect-error workaround to parse json with bigint
BigInt.prototype["toJSON"] = function () {
return this.toString();
};
10 changes: 10 additions & 0 deletions examples/starknet-react-next/src/components/TransferEth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export const TransferEth = () => {
const [txnHash, setTxnHash] = useState<string>();

const executePointOne = useCallback(async () => {
if (!account) {
return;
}

const res = await account.execute(
[
{
Expand All @@ -39,6 +43,9 @@ export const TransferEth = () => {
.finally(() => console.log("done"));
}, [account, chainId]);
const executeOne = useCallback(async () => {
if (!account) {
return;
}
setTxnHash(undefined);
const res = await account.execute(
[
Expand Down Expand Up @@ -66,6 +73,9 @@ export const TransferEth = () => {
.finally(() => console.log("done"));
}, [account, chainId]);
const execute005 = useCallback(async () => {
if (!account) {
return;
}
setTxnHash(undefined);
const res = await account.execute(
[
Expand Down
1 change: 1 addition & 0 deletions examples/starknet-react-next/src/pages/token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function UserBalance() {
return <div>Error!</div>;
}

// @ts-expect-error TODO: fix type
const balance = uint256.uint256ToBN(cairo.uint256(data[0]));
return <div>{balance.toString(10)}</div>;
}, [data, isLoading, error]);
Expand Down
20 changes: 1 addition & 19 deletions examples/starknet-react-next/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
{
"extends": "../../tsconfig.react.json",
"compilerOptions": {
"baseUrl": "./src",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"declaration": true,
"target": "ES2020",
"module": "ESNext",
"strict": false,
"jsx": "preserve",
"allowJs": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"incremental": true,
"esModuleInterop": true,
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"downlevelIteration": true,
"noEmit": true
},
"include": [
Expand Down
1 change: 1 addition & 0 deletions packages/keychain/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"types": [
"@emotion/react/types/css-prop"
],
"noEmit": true,
// TODO(#262): Enable these options (too many errors for this scope)
"strict": false,
"noImplicitAny": false,
Expand Down
3 changes: 3 additions & 0 deletions packages/ui-next/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"extends": "../../tsconfig.react.json",
"compilerOptions": {
"baseUrl": ".",
"rootDir": "./src",
"outDir": "./lib",
"jsx": "react-jsx",
"paths": {
"@/*": ["./src/*"]
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"compilerOptions": {
"baseUrl": ".",
"rootDir": "./src",
"outDir": "lib",
"types": ["@emotion/react/types/css-prop"]
"outDir": "./lib",
"types": ["@emotion/react/types/css-prop"],
},
"paths": {
"@cartridge/ui/components": ["./src/components"],
Expand Down
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noEmit": false
}
}
1 change: 0 additions & 1 deletion tsconfig.react.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// nextjs override these if not exist
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"allowJs": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"resolveJsonModule": true,
Expand Down

0 comments on commit 9501493

Please sign in to comment.