-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: predeployed connector warning #400
Conversation
WalkthroughThis update introduces a series of patch and configuration updates across multiple Dojo Engine packages. It fixes predeployed warnings, enhances type annotations and initialization in the predeployed connector, and adds a complete example project based on React, TypeScript, and Vite. New configuration files, source files, and TypeScript settings are included to support a robust application setup along with updated dependency versions in several package manifests. Core package files also receive improvements in type safety and control flow simplification. Changes
Sequence Diagram(s)sequenceDiagram
participant B as Browser
participant H as index.html
participant M as main.tsx
participant SP as StarknetProvider
participant A as App
B->>H: Load HTML
H->>M: Execute main.tsx
M->>SP: Render StarknetProvider wrapper
SP->>SP: useEffect: fetch predeployed accounts and update state
SP->>A: Render React App component
Possibly related PRs
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
🔭 Outside diff range comments (1)
examples/example-predeployed-connector/tsconfig.node.json (1)
25-25
:⚠️ Potential issueExtraneous Content at File End
There appears to be an extra token ("25") after the closing brace on line 24. If this is not intended to be part of the configuration, please remove it to ensure the file contains only valid JSON content.
🧹 Nitpick comments (14)
examples/example-vite-react-sdk/package.json (2)
28-30
: Dependency Version Updates Verification:
The versions forvite-plugin-top-level-await
,vite-plugin-wasm
, andzustand
have been updated to^1.5.0
,^3.4.1
, and^4.5.6
respectively. Please verify that these updated versions are fully compatible with our project and related tooling.
33-46
: DevDependency Upgrades Confirmation:
The devDependencies have been uniformly updated (e.g.,@eslint/js
,@types/react
,@vitejs/plugin-react
,eslint
,tailwindcss
,typescript
, etc.). It is important to ensure that these new versions do not introduce any unexpected breaking changes in the linting, TypeScript configurations, or the overall build process. Please run the full test and linting pipelines to confirm stability.examples/example-predeployed-connector/tsconfig.app.json (3)
10-10
: JSON Comments Warning: Bundler Mode Comment.
The comment/* Bundler mode */
at line 10 is not valid in strict JSON. If your tooling supports JSON with Comments (JSONC), this is acceptable. Otherwise, consider removing it to avoid parsing errors.🧰 Tools
🪛 Biome (1.9.4)
[error] 10-10: JSON standard does not allow comments.
(parse)
18-18
: JSON Comments Warning: Linting Comment.
Similarly, the comment/* Linting */
at line 18 is not permitted under the strict JSON standard. If your environment or build process supports JSONC, you may retain it; otherwise, remove it to conform to JSON standards.🧰 Tools
🪛 Biome (1.9.4)
[error] 16-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: JSON standard does not allow comments.
(parse)
27-27
: Extraneous Content at the End.
Line 27 appears to be extraneous. If this line was added unintentionally, consider removing it to prevent any potential issues with parsers that expect a pure JSON structure.examples/example-predeployed-connector/tsconfig.node.json (2)
9-9
: JSON Comment Usage: Bundler ModeThe comment
/* Bundler mode */
on line 9 violates the JSON standard, which does not support comments. Since TypeScript configuration files can be processed as JSONC (JSON with Comments), please verify that your tooling and environment accept comments in this file. Otherwise, consider either removing the comment or renaming the file to end with.jsonc
to clearly indicate the relaxed JSON format.🧰 Tools
🪛 Biome (1.9.4)
[error] 9-9: JSON standard does not allow comments.
(parse)
16-16
: JSON Comment Usage: Linting SectionSimilarly, the comment
/* Linting */
on line 16 is not valid in standard JSON. Verify that your build tools and editor validation support JSONC. If not, remove the comment or switch to a.jsonc
extension.🧰 Tools
🪛 Biome (1.9.4)
[error] 14-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: JSON standard does not allow comments.
(parse)
examples/example-predeployed-connector/eslint.config.js (2)
13-14
: Consider upgrading ECMAScript version.The configuration uses ECMAScript 2020. Consider upgrading to a more recent version (e.g., 2022 or latest) to leverage newer JavaScript features.
- ecmaVersion: 2020, + ecmaVersion: "latest",
20-26
: Enhance TypeScript and React rules coverage.The configuration could benefit from additional recommended rules:
- TypeScript ESLint strict rules
- React-specific rules
rules: { ...reactHooks.configs.recommended.rules, + // Strict TypeScript checks + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/explicit-function-return-type": "warn", + "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], + // React-specific rules + "react-hooks/exhaustive-deps": "warn", "react-refresh/only-export-components": [ "warn", { allowConstantExport: true }, ], },examples/example-predeployed-connector/src/starknet-provider.tsx (1)
16-17
: Validate RPC URL type safety.Using type assertion (
as string
) bypasses TypeScript's type checking. Consider validating the URL or using type guards.Consider this safer approach:
- rpc: () => ({ nodeUrl: dojoConfig.rpcUrl as string }), + rpc: () => { + if (!dojoConfig.rpcUrl) throw new Error("RPC URL is required"); + return { nodeUrl: dojoConfig.rpcUrl }; + },And similarly for the predeployed accounts:
- rpc: dojoConfig.rpcUrl as string, + rpc: dojoConfig.rpcUrl || "", // or throw if URL is requiredAlso applies to: 23-23
examples/example-predeployed-connector/src/typescript/contracts.gen.ts (2)
1-9
: Optimize type imports for better build performance.Using
import type
for type-only imports helps the compiler optimize the build process.Apply this fix:
-import { DojoProvider, DojoCall } from "@dojoengine/core"; +import { DojoProvider } from "@dojoengine/core"; +import type { DojoCall } from "@dojoengine/core"; -import { - Account, - AccountInterface, - BigNumberish, - CairoOption, - CairoCustomEnum, - ByteArray, -} from "starknet"; +import type { + Account, + AccountInterface, + BigNumberish, + CairoOption, + CairoCustomEnum, + ByteArray, +} from "starknet";🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: All these imports are only used as types.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.(lint/style/useImportType)
[error] 2-9: Some named imports are only used as types.
This import is only used as a type.
This import is only used as a type.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.(lint/style/useImportType)
33-36
: Improve error handling specificity.The current error handling logs and rethrows all errors without differentiation. Consider handling specific error types differently.
Consider this approach:
} catch (error) { - console.error(error); - throw error; + if (error instanceof Error) { + console.error(`Failed to execute move: ${error.message}`); + } else { + console.error('An unknown error occurred during move'); + } + throw new Error('Failed to execute move action', { cause: error }); }Also applies to: 54-57
examples/example-predeployed-connector/src/typescript/models.gen.ts (2)
3-8
: Useimport type
for type-only imports.Since these imports are only used as types, use the
import type
syntax to ensure proper tree-shaking and avoid loading unnecessary modules.-import { +import type { CairoCustomEnum, CairoOption, CairoOptionVariant, BigNumberish, } from "starknet";🧰 Tools
🪛 Biome (1.9.4)
[error] 3-8: Some named imports are only used as types.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.(lint/style/useImportType)
64-71
: Consider using a union type for Direction enum.The current Direction type uses string values which could lead to runtime errors. Consider using a union type for better type safety.
-export type Direction = { - Left: string; - Right: string; - Up: string; - Down: string; -}; +export type Direction = 'Left' | 'Right' | 'Up' | 'Down';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
examples/example-predeployed-connector/public/vite.svg
is excluded by!**/*.svg
examples/example-predeployed-connector/src/assets/react.svg
is excluded by!**/*.svg
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (24)
.changeset/early-steaks-perform.md
(1 hunks)examples/example-predeployed-connector/.gitignore
(1 hunks)examples/example-predeployed-connector/README.md
(1 hunks)examples/example-predeployed-connector/dojoConfig.ts
(1 hunks)examples/example-predeployed-connector/eslint.config.js
(1 hunks)examples/example-predeployed-connector/index.html
(1 hunks)examples/example-predeployed-connector/package.json
(1 hunks)examples/example-predeployed-connector/src/App.css
(1 hunks)examples/example-predeployed-connector/src/App.tsx
(1 hunks)examples/example-predeployed-connector/src/index.css
(1 hunks)examples/example-predeployed-connector/src/main.tsx
(1 hunks)examples/example-predeployed-connector/src/starknet-provider.tsx
(1 hunks)examples/example-predeployed-connector/src/typescript/contracts.gen.ts
(1 hunks)examples/example-predeployed-connector/src/typescript/models.gen.ts
(1 hunks)examples/example-predeployed-connector/src/vite-env.d.ts
(1 hunks)examples/example-predeployed-connector/tsconfig.app.json
(1 hunks)examples/example-predeployed-connector/tsconfig.json
(1 hunks)examples/example-predeployed-connector/tsconfig.node.json
(1 hunks)examples/example-predeployed-connector/vite.config.ts
(1 hunks)examples/example-vite-react-sdk/package.json
(1 hunks)packages/core/src/provider/DojoProvider.ts
(1 hunks)packages/core/src/utils/index.ts
(1 hunks)packages/predeployed-connector/src/index.ts
(4 hunks)pnpm-workspace.yaml
(1 hunks)
✅ Files skipped from review due to trivial changes (9)
- examples/example-predeployed-connector/src/vite-env.d.ts
- examples/example-predeployed-connector/tsconfig.json
- examples/example-predeployed-connector/vite.config.ts
- examples/example-predeployed-connector/index.html
- examples/example-predeployed-connector/README.md
- examples/example-predeployed-connector/.gitignore
- examples/example-predeployed-connector/package.json
- .changeset/early-steaks-perform.md
- packages/core/src/provider/DojoProvider.ts
🧰 Additional context used
🪛 Biome (1.9.4)
examples/example-predeployed-connector/src/App.tsx
[error] 12-12: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.
(lint/a11y/noBlankTarget)
[error] 15-15: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.
(lint/a11y/noBlankTarget)
[error] 25-25: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
examples/example-predeployed-connector/src/typescript/contracts.gen.ts
[error] 1-1: All these imports are only used as types.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.
(lint/style/useImportType)
[error] 2-9: Some named imports are only used as types.
This import is only used as a type.
This import is only used as a type.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.
(lint/style/useImportType)
examples/example-predeployed-connector/tsconfig.node.json
[error] 9-9: JSON standard does not allow comments.
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: JSON standard does not allow comments.
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-24: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
examples/example-predeployed-connector/src/main.tsx
[error] 7-7: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
examples/example-predeployed-connector/src/starknet-provider.tsx
[error] 19-19: This hook does not specify all of its dependencies: retries
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
(lint/correctness/useExhaustiveDependencies)
examples/example-predeployed-connector/src/typescript/models.gen.ts
[error] 3-8: Some named imports are only used as types.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.
(lint/style/useImportType)
examples/example-predeployed-connector/tsconfig.app.json
[error] 10-10: JSON standard does not allow comments.
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: JSON standard does not allow comments.
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 24-24: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-26: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: check
- GitHub Check: build
🔇 Additional comments (17)
pnpm-workspace.yaml (1)
6-6
: StarkNet Package Version Update
The catalog now specifiesstarknet: 6.23.1
, indicating a minor/patch version bump from 6.21.0. Please verify that this update is compatible with all consuming packages and examples—particularly those leveraging StarkNet functionality (e.g., inexamples/example-predeployed-connector/
). Additionally, ensure that any associated documentation and tests reflect this change.packages/core/src/utils/index.ts (1)
52-53
: LGTM! Nice simplification of control flow.The removal of the explicit
else
block makes the code more concise while maintaining the same behavior and type safety. This change aligns well with the principle of reducing unnecessary nesting.examples/example-predeployed-connector/tsconfig.app.json (4)
1-9
: Compiler Options Configuration is Solid.
The settings fortsBuildInfoFile
,target
,lib
, and related options are clear and well-organized. Ensure that the relative path for"tsBuildInfoFile"
is valid in your project structure.
11-16
: Bundler Mode Options Verification.
The bundler-specific compiler options (e.g.,"moduleResolution": "bundler"
,"allowImportingTsExtensions"
,"isolatedModules"
,"moduleDetection": "force"
,"noEmit"
, and"jsx": "react-jsx"
) are configured appropriately for a modern TypeScript project using a bundler.🧰 Tools
🪛 Biome (1.9.4)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
19-23
: Linting Options are Comprehensive.
The linting options ("strict"
,"noUnusedLocals"
,"noUnusedParameters"
,"noFallthroughCasesInSwitch"
, and"noUncheckedSideEffectImports"
) enforce good coding practices. Double-check that all these options are supported by your current TypeScript version.🧰 Tools
🪛 Biome (1.9.4)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
24-26
: Project Inclusion and Overall TSConfig Structure.
Including"src"
in the"include"
array is standard and ensures that the intended code is compiled. The overall structure of the TSConfig file is complete and aligns with the project requirements.🧰 Tools
🪛 Biome (1.9.4)
[error] 24-24: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-26: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/eslint.config.js (2)
7-28
: LGTM! Solid ESLint configuration.The configuration provides a good foundation with:
- TypeScript support
- React Hooks and React Refresh plugins
- Recommended rule sets
- Proper file targeting and ignores
1-5
:❓ Verification inconclusive
Verify ESLint and TypeScript ESLint versions.
The configuration uses ESLint's new flat config format. Let's ensure the package versions are compatible.
🏁 Script executed:
#!/bin/bash # Check package versions in package.json jq '.dependencies["eslint"], .dependencies["typescript-eslint"]' examples/example-predeployed-connector/package.jsonLength of output: 128
Action: Verify Package Versions for ESLint & TypeScript ESLint
- The import statements in
examples/example-predeployed-connector/eslint.config.js
are clean and well-organized.- Your ESLint configuration leverages the new flat config format, which makes it crucial that the installed versions of ESLint and TypeScript ESLint support this setup.
- The version check on the local
package.json
did not return explicit versions for"eslint"
or"typescript-eslint"
. This likely means these versions aren’t defined in thedependencies
block. They might be managed viadevDependencies
,peerDependencies
, or inherited from a centralized configuration (e.g., in a monorepo's root package.json).- Please verify that the appropriate versions are installed (compatible with ESLint’s flat config, e.g., ESLint v8.XX+ and the corresponding TypeScript ESLint packages). Adjust the dependency specifications if necessary to avoid compatibility issues.
packages/predeployed-connector/src/index.ts (3)
4-20
: LGTM! Enhanced type safety with explicit type annotations.The addition of explicit type annotations for imported entities improves type safety and code maintainability.
73-73
: LGTM! Fixed wallet account initialization.The constructor now properly initializes the wallet account by passing required parameters to the superclass.
257-263
:✅ Verification successful
Verify the transaction version compatibility.
The code now explicitly sets the transaction version to V3. Please ensure this is the correct version for your use case.
🌐 Web query:
What is the latest transaction version supported by Starknet?
💡 Result:
The latest transaction version supported by Starknet as of February 2025 is v3, which applies to
INVOKE
,DECLARE
, andDEPLOY_ACCOUNT
transactions[3][8]. This version introduces support for fee payments in STRK (alongside ETH), prepares for future features like a fee market and paymaster mechanisms, and enables nonce generalization for parallel transaction processing[8].Key details:
- Deprecated versions:
INVOKE
: Versions ≤v1DECLARE
: Versions ≤v2DEPLOY_ACCOUNT
: Version ≤v1[3]- Upcoming changes:
- Starknet v0.14.0 (planned for mid-2025) will terminate support for all legacy transaction versions (v0/v1/v2)[2][7]
- This update will introduce a mempool and fee market as part of Starknet's scaling roadmap[2][6]
Developers should ensure their systems use RPC ≥v0.8 and Starknet.js ≥v6.9.0 to maintain compatibility with current transaction standards[2][8].
Citations:
- 1: https://www.starknet.io/blog/july-2024-roundup/
- 2: https://docs.starknet.io/starknet-versions/version-notes/
- 3: https://docs.starknet.io/architecture-and-concepts/network-architecture/transactions/
- 4: https://www.starknet.io/blog/starknet-ecosystem-report-2025/
- 5: https://docs.starknet.io/tools/compatibility/
- 6: https://www.starknet.io/blog/bolt-version-upgrade/
- 7: https://community.starknet.io/c/versions-upgrade/28
- 8: https://www.starknet.io/developers/roadmap/v3-transactions/
- 9: https://docs.starknet.io/chain-info/
- 10: https://www.starknet.io/developers/roadmap/
Verified: Transaction Version is Correct
The explicit use of V3 for the transaction version is confirmed to be correct according to the latest Starknet documentation as of February 2025. No code changes are necessary at this point, though it's advisable to monitor for any future updates.
examples/example-predeployed-connector/dojoConfig.ts (2)
1-8
: Clean and focused configuration setup.The configuration file is well-structured and follows a clear single responsibility principle by only handling Dojo configuration setup.
5-7
:❓ Verification inconclusive
Verify configuration options for predeployed connector.
Let's check the available configuration options and verify if this addresses the predeployed connector warning:
🏁 Script executed:
#!/bin/bash # Search for predeployed connector warnings in the codebase rg -i "predeployed.*warning" --type tsLength of output: 40
🌐 Web query:
What configuration options are available for createDojoConfig in @dojoengine/core?
💡 Result:
The
createDojoConfig
in@dojoengine/core
provides configuration for interacting with Dojo-based blockchain applications. Based on related Dojo configuration patterns:Core Configuration Options
Network Configuration
rpcUrl
: URL of StarkNet RPC endpoint (e.g.,"https://starknet-mainnet.public.blastapi.io"
)worldAddress
: Contract address of the deployed Dojo WorldexecutorAddress
: Address for transaction execution contractsBurner Wallet Management
burnerManager
: Settings for ephemeral wallets:{ masterAccount: AddressInput, accountClassHash?: string, feeTokenAddress?: string }Torii Client
toriiUrl
: URL for Torii indexer/graphQL endpointrelayUrl
: WebSocket URL for real-time event streamingAuto-Mining (Local Dev)
autoMine
: Boolean to auto-mine blocks after transactionsExample Configuration
import { createDojoConfig } from "@dojoengine/core"; const config = createDojoConfig({ rpcUrl: "http://localhost:5050", toriiUrl: "http://0.0.0.0:8080", worldAddress: "0x123...", burnerManager: { masterAccount: "0x456...", accountClassHash: "0x789..." } });Key Implementation Notes
- Profile System: Inherits Scarb's profile-based configuration (
dev
,prod
) fromdojo_<profile>.toml
files[7]- Dependency Management: Requires Cairo 2.x versions specified in
Scarb.toml
[7]- Asynchronous Loading: Follows Dojo's async module patterns by default[2][4]
For exact parameters in
@dojoengine/core
, consult its TypeScript definitions or execute client documentation (npm[5], GitHub[6]).Citations:
- 1: https://dojotoolkit.org/reference-guide/dojo/_base/config.html
- 2: https://app.studyraid.com/en/read/13212/438889/dojo-configuration-and-initialization
- 3: https://dojoengine.github.io/dojo.js/
- 4: https://dojotoolkit.org/documentation/tutorials/1.10/dojo_config/
- 5: https://www.npmjs.com/package/@dojoengine/core
- 6: https://github.com/dojoengine/dojo
- 7: https://www.dojoengine.org/framework/config
- 8: https://github.com/dojoengine/packages
- 9: https://github.com/dojoengine/dojo-core
- 10: https://www.dojoengine.org
Current configuration appears minimal but verify it meets the predeployed connector requirements.
- Our search for “predeployed connector warning” produced no results, suggesting that the minimal configuration using only
manifest
is not triggering any warnings.- The documentation for
createDojoConfig
in@dojoengine/core
shows it supports several additional options (e.g.,rpcUrl
,worldAddress
,burnerManager
,toriiUrl
, andautoMine
). Although you currently only passmanifest
, this approach may suffice if your environment doesn’t require further configuration.- Please double-check in your testing environment that the manifest-only configuration fully resolves any predeployed connector concerns. In case issues arise, consider incorporating extra configuration options as needed.
examples/example-predeployed-connector/src/typescript/models.gen.ts (1)
86-161
: LGTM! Well-structured schema and model mappings.The schema implementation is thorough and follows the expected pattern for Dojo engine. All models are properly initialized with default values and correctly mapped in the ModelsMapping enum.
examples/example-predeployed-connector/src/App.css (1)
1-42
: LGTM! Well-structured CSS with accessibility considerations.The CSS implementation follows modern practices and includes proper handling of reduced motion preferences for accessibility.
examples/example-predeployed-connector/src/index.css (2)
7-8
: Verify color contrast ratios for accessibility.Please verify that the color combinations meet WCAG contrast requirements for accessibility:
- Text color
rgba(255, 255, 255, 0.87)
on#242424
background- Link color
#646cff
on both dark and light backgrounds- Hover color
#535bf2
on both dark and light backgrounds#!/usr/bin/env python3 from colorsys import rgb_to_hls import re def hex_to_rgb(hex_color): hex_color = hex_color.lstrip('#') return tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4)) def calculate_relative_luminance(r, g, b): r, g, b = r/255, g/255, b/255 r = r/12.92 if r <= 0.03928 else ((r+0.055)/1.055)**2.4 g = g/12.92 if g <= 0.03928 else ((g+0.055)/1.055)**2.4 b = b/12.92 if b <= 0.03928 else ((b+0.055)/1.055)**2.4 return 0.2126 * r + 0.7152 * g + 0.0722 * b def calculate_contrast_ratio(l1, l2): lighter = max(l1, l2) darker = min(l1, l2) return (lighter + 0.05) / (darker + 0.05) # Background colors dark_bg = hex_to_rgb('242424') light_bg = hex_to_rgb('ffffff') # Text colors text_dark = (255, 255, 255) # Multiply by 0.87 for alpha link_color = hex_to_rgb('646cff') hover_color = hex_to_rgb('535bf2') # Calculate luminance dark_bg_lum = calculate_relative_luminance(*dark_bg) light_bg_lum = calculate_relative_luminance(*light_bg) text_dark_lum = calculate_relative_luminance(*[x * 0.87 for x in text_dark]) link_lum = calculate_relative_luminance(*link_color) hover_lum = calculate_relative_luminance(*hover_color) # Print contrast ratios print(f"Text on dark background: {calculate_contrast_ratio(text_dark_lum, dark_bg_lum):.2f}:1") print(f"Link on dark background: {calculate_contrast_ratio(link_lum, dark_bg_lum):.2f}:1") print(f"Hover on dark background: {calculate_contrast_ratio(hover_lum, dark_bg_lum):.2f}:1") print(f"Link on light background: {calculate_contrast_ratio(link_lum, light_bg_lum):.2f}:1") print(f"Hover on light background: {calculate_contrast_ratio(hover_lum, light_bg_lum):.2f}:1")[skip_cloning]
Also applies to: 16-23
38-55
: LGTM! Well-implemented button styles with proper focus states.The button implementation includes proper focus states and transitions, enhancing both accessibility and user experience.
import { createDojoConfig } from "@dojoengine/core"; | ||
|
||
import manifest from "../../worlds/dojo-starter/manifest_dev.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the manifest file path and add type safety.
The manifest is imported from a path outside the example directory. Let's verify the path and improve type safety:
Consider adding type information for the manifest import:
-import manifest from "../../worlds/dojo-starter/manifest_dev.json";
+import { type Manifest } from "@dojoengine/core";
+import manifest from "../../worlds/dojo-starter/manifest_dev.json" assert { type: "json" };
🏁 Script executed:
#!/bin/bash
# Check if the manifest file exists
if [ -f "worlds/dojo-starter/manifest_dev.json" ]; then
echo "Manifest file exists"
# Check if it's valid JSON
jq '.' worlds/dojo-starter/manifest_dev.json > /dev/null
if [ $? -eq 0 ]; then
echo "Manifest is valid JSON"
else
echo "Invalid JSON in manifest"
fi
else
echo "Manifest file not found"
fi
Length of output: 107
Attention: Manifest File Missing & Type Safety for JSON Import
It appears that the manifest file at the relative path "../../worlds/dojo-starter/manifest_dev.json"
could not be located. Please take the following actions:
- Verify the File's Existence: Confirm if the manifest file exists at the expected path. If it’s been moved or renamed, update the import accordingly.
- Improve Type Safety: Once the file is available, update the import statement to add type information:
-import manifest from "../../worlds/dojo-starter/manifest_dev.json"; +import { type Manifest } from "@dojoengine/core"; +import manifest from "../../worlds/dojo-starter/manifest_dev.json" assert { type: "json" };
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
import { createDojoConfig } from "@dojoengine/core"; | |
import manifest from "../../worlds/dojo-starter/manifest_dev.json"; | |
import { createDojoConfig } from "@dojoengine/core"; | |
import { type Manifest } from "@dojoengine/core"; | |
import manifest from "../../worlds/dojo-starter/manifest_dev.json" assert { type: "json" }; |
import App from "./App.tsx"; | ||
import StarknetProvider from "./starknet-provider.tsx"; | ||
|
||
createRoot(document.getElementById("root")!).render( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Handle potential null case for root element.
The non-null assertion (!
) assumes the root element always exists, which could lead to runtime errors if the element is not found.
Consider this safer approach:
-createRoot(document.getElementById("root")!).render(
+const rootElement = document.getElementById("root");
+if (!rootElement) throw new Error("Failed to find root element");
+createRoot(rootElement).render(
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
createRoot(document.getElementById("root")!).render( | |
const rootElement = document.getElementById("root"); | |
if (!rootElement) throw new Error("Failed to find root element"); | |
createRoot(rootElement).render( |
🧰 Tools
🪛 Biome (1.9.4)
[error] 7-7: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
<a href="https://vite.dev" target="_blank"> | ||
<img src={viteLogo} className="logo" alt="Vite logo" /> | ||
</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add security attributes to external links.
Links with target="_blank"
should include rel="noreferrer"
to prevent potential security vulnerabilities (reverse tabnabbing).
Apply this fix:
- <a href="https://vite.dev" target="_blank">
+ <a href="https://vite.dev" target="_blank" rel="noreferrer">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
- <a href="https://react.dev" target="_blank">
+ <a href="https://react.dev" target="_blank" rel="noreferrer">
Also applies to: 15-21
🧰 Tools
🪛 Biome (1.9.4)
[error] 12-12: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.
(lint/a11y/noBlankTarget)
<button onClick={() => setCount((count) => count + 1)}> | ||
count is {count} | ||
</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add explicit button type for accessibility.
Buttons should have an explicit type for better accessibility and to prevent unintended form submissions.
Apply this fix:
- <button onClick={() => setCount((count) => count + 1)}>
+ <button type="button" onClick={() => setCount((count) => count + 1)}>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<button onClick={() => setCount((count) => count + 1)}> | |
count is {count} | |
</button> | |
<button type="button" onClick={() => setCount((count) => count + 1)}> | |
count is {count} | |
</button> |
🧰 Tools
🪛 Biome (1.9.4)
[error] 25-25: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
useEffect(() => { | ||
if (connectors.length === 0 && retries < 5) { | ||
setRetries(retries + 1); | ||
predeployedAccounts({ | ||
rpc: dojoConfig.rpcUrl as string, | ||
id: "katana", | ||
name: "Katana", | ||
}).then(setConnectors); | ||
} | ||
}, [connectors]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix missing dependency in useEffect hook.
The retries
state is used inside the effect but not included in the dependency array, which could lead to stale closures.
Apply this fix:
- }, [connectors]);
+ }, [connectors, retries]);
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
useEffect(() => { | |
if (connectors.length === 0 && retries < 5) { | |
setRetries(retries + 1); | |
predeployedAccounts({ | |
rpc: dojoConfig.rpcUrl as string, | |
id: "katana", | |
name: "Katana", | |
}).then(setConnectors); | |
} | |
}, [connectors]); | |
useEffect(() => { | |
if (connectors.length === 0 && retries < 5) { | |
setRetries(retries + 1); | |
predeployedAccounts({ | |
rpc: dojoConfig.rpcUrl as string, | |
id: "katana", | |
name: "Katana", | |
}).then(setConnectors); | |
} | |
}, [connectors, retries]); |
🧰 Tools
🪛 Biome (1.9.4)
[error] 19-19: This hook does not specify all of its dependencies: retries
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
(lint/correctness/useExhaustiveDependencies)
1eccf6a
to
18ab027
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (11)
examples/example-predeployed-connector/package.json (1)
6-11
: Scripts Definition (Lines 6-11)
The provided scripts are standard for a Vite and TypeScript project. They enable development, building, linting, and previewing of the app. Consider adding a test script if tests are planned for this project.examples/example-predeployed-connector/tsconfig.node.json (2)
9-15
: Bundler Mode Settings & Comment UsageThe configuration for bundler mode (lines 9–15) is properly set up with properties such as
"moduleResolution": "bundler"
,"allowImportingTsExtensions": true
, and"isolatedModules": true
. However, the block comment/* Bundler mode */
on line 9 is not valid in strict JSON. While TypeScript’s configuration files often support comments (i.e. JSONC), some static analysis tools (as seen in the static analysis hints) may flag these as errors.Suggestion: If your toolchain requires strict JSON, consider removing the comment or renaming the file with a
.jsonc
extension (if supported), for example:- /* Bundler mode */ + // Bundler modeOr remove the comment entirely.
🧰 Tools
🪛 Biome (1.9.4)
[error] 9-9: JSON standard does not allow comments.
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
16-22
: Linting Options VerificationThe linting options (lines 16–22) are comprehensive and enforce strict coding practices. Note that the block comment
/* Linting */
on line 16 could trigger errors in tools expecting pure JSON.Suggestion: Similar to the bundler mode section, consider converting the comment to a supported format or removing it if strict JSON is needed:
- /* Linting */ + // LintingIf your ecosystem already supports JSON with comments (JSONC), you may safely ignore this.
🧰 Tools
🪛 Biome (1.9.4)
[error] 16-16: JSON standard does not allow comments.
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/tsconfig.app.json (2)
10-17
: Bundler Mode Section – Address JSON Comment Considerations
This section uses inline comments (e.g.,/* Bundler mode */
) to document settings such asmoduleResolution
,allowImportingTsExtensions
, etc. While TypeScript’s tsconfig files support JSON with Comments (JSONC), note that some static analysis tools (like Biome) expect pure JSON and flag comments. If these warnings cause issues, consider one of the following:
- Configure the linter/formatter to recognize JSONC in tsconfig files, or
- Remove or convert comments if strict JSON validation is required.
🧰 Tools
🪛 Biome (1.9.4)
[error] 10-10: JSON standard does not allow comments.
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
24-26
: Include Array and File Structure – Confirm No Extraneous Content
The"include": ["src"]
directive correctly limits compilation to the source directory. Confirm that the file does not inadvertently include extraneous content such as stray annotations or numbers—for example, the apparent isolated27
at the end of the snippet (if it is part of the file, it should be removed).🧰 Tools
🪛 Biome (1.9.4)
[error] 24-24: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-26: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/README.md (1)
38-39
: Minor Note on React Version Specification.
The configuration explicitly sets the React version to "18.3". Please verify that this version aligns with your project dependencies or consider using dynamic detection (e.g., "detect") to automatically adapt to the installed React version.examples/example-predeployed-connector/src/typescript/models.gen.ts (2)
3-8
: Usetype
imports for type-only references.According to the static analysis hint, certain imports such as
BigNumberish
appear to be used only as types. Converting those to type imports could make the bundle smaller and more efficient. However, avoid changing imports likeCairoCustomEnum
orCairoOption
because they’re instantiated at runtime.Example fix:
-import { - CairoCustomEnum, - CairoOption, - CairoOptionVariant, - BigNumberish, -} from "starknet"; +import { + CairoCustomEnum, + CairoOption, + CairoOptionVariant, +} from "starknet"; + +import type { + BigNumberish, +} from "starknet";🧰 Tools
🪛 Biome (1.9.4)
[error] 3-8: Some named imports are only used as types.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.(lint/style/useImportType)
73-85
: Potentially refine or contextualize theplayer
field.The
player
property is typed as astring
throughout (e.g., inDirectionsAvailable
,Moves
,Position
). If this is meant to be a starknet address or unique identifier, you may want a specialized type or at least a naming convention that clarifies the format.examples/example-vite-react-sdk/src/starknet-provider.tsx (1)
31-31
: Simplify double casting in connectors.Casting
pa
first tounknown
and then toConnector[]
may hide potential type mismatches. Consider directly assigningpa
a type at initialization or clarifying its shape when processing thepredeployedAccounts
result.Possible approach:
- connectors={pa as unknown as Connector[]} + connectors={pa}and declare:
- let pa: PredeployedAccountsConnector[] = []; + let pa: Connector[] = [];(if
PredeployedAccountsConnector
indeed extendsConnector
).examples/example-predeployed-connector/src/starknet-provider.tsx (1)
19-28
: Improve retry logic with exponential backoff.The current retry logic might be too aggressive. Consider implementing exponential backoff to avoid overwhelming the server.
+ const BACKOFF_MS = 1000; useEffect(() => { if (connectors.length === 0 && retries < 5) { - setRetries(retries + 1); - predeployedAccounts({ - rpc: dojoConfig.rpcUrl as string, - id: "katana", - name: "Katana", - }).then(setConnectors); + const timer = setTimeout(() => { + setRetries(retries + 1); + predeployedAccounts({ + rpc: dojoConfig.rpcUrl as string, + id: "katana", + name: "Katana", + }).then(setConnectors); + }, BACKOFF_MS * Math.pow(2, retries)); + return () => clearTimeout(timer); } - }, [connectors]); + }, [connectors, retries]);🧰 Tools
🪛 Biome (1.9.4)
[error] 19-19: This hook does not specify all of its dependencies: retries
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
(lint/correctness/useExhaustiveDependencies)
examples/example-predeployed-connector/src/typescript/contracts.gen.ts (1)
1-9
: Use type-only imports for better build optimization.Convert imports that are only used as types to type-only imports to ensure they are removed by compilers and avoid loading unnecessary modules.
-import { DojoProvider, DojoCall } from "@dojoengine/core"; +import type { DojoProvider, DojoCall } from "@dojoengine/core"; -import { - Account, - AccountInterface, - BigNumberish, - CairoOption, - CairoCustomEnum, - ByteArray, -} from "starknet"; +import type { + Account, + AccountInterface, + BigNumberish, + CairoOption, + CairoCustomEnum, + ByteArray, +} from "starknet";🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: All these imports are only used as types.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.(lint/style/useImportType)
[error] 2-9: Some named imports are only used as types.
This import is only used as a type.
This import is only used as a type.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.(lint/style/useImportType)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
examples/example-predeployed-connector/public/vite.svg
is excluded by!**/*.svg
examples/example-predeployed-connector/src/assets/react.svg
is excluded by!**/*.svg
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (30)
.changeset/early-steaks-perform.md
(1 hunks)examples/example-predeployed-connector/.gitignore
(1 hunks)examples/example-predeployed-connector/README.md
(1 hunks)examples/example-predeployed-connector/dojoConfig.ts
(1 hunks)examples/example-predeployed-connector/eslint.config.js
(1 hunks)examples/example-predeployed-connector/index.html
(1 hunks)examples/example-predeployed-connector/package.json
(1 hunks)examples/example-predeployed-connector/src/App.css
(1 hunks)examples/example-predeployed-connector/src/App.tsx
(1 hunks)examples/example-predeployed-connector/src/index.css
(1 hunks)examples/example-predeployed-connector/src/main.tsx
(1 hunks)examples/example-predeployed-connector/src/starknet-provider.tsx
(1 hunks)examples/example-predeployed-connector/src/typescript/contracts.gen.ts
(1 hunks)examples/example-predeployed-connector/src/typescript/models.gen.ts
(1 hunks)examples/example-predeployed-connector/src/vite-env.d.ts
(1 hunks)examples/example-predeployed-connector/tsconfig.app.json
(1 hunks)examples/example-predeployed-connector/tsconfig.json
(1 hunks)examples/example-predeployed-connector/tsconfig.node.json
(1 hunks)examples/example-predeployed-connector/vite.config.ts
(1 hunks)examples/example-vite-react-sdk/package.json
(1 hunks)examples/example-vite-react-sdk/src/DojoContext.tsx
(0 hunks)examples/example-vite-react-sdk/src/main.tsx
(1 hunks)examples/example-vite-react-sdk/src/starknet-provider.tsx
(2 hunks)examples/example-vite-react-sdk/src/typescript/contracts.gen.ts
(3 hunks)examples/example-vite-react-sdk/tsconfig.app.tsbuildinfo
(1 hunks)examples/example-vite-react-sdk/tsconfig.node.tsbuildinfo
(1 hunks)packages/core/src/provider/DojoProvider.ts
(1 hunks)packages/core/src/utils/index.ts
(1 hunks)packages/predeployed-connector/src/index.ts
(4 hunks)pnpm-workspace.yaml
(1 hunks)
💤 Files with no reviewable changes (1)
- examples/example-vite-react-sdk/src/DojoContext.tsx
✅ Files skipped from review due to trivial changes (2)
- examples/example-vite-react-sdk/tsconfig.node.tsbuildinfo
- examples/example-vite-react-sdk/src/main.tsx
🚧 Files skipped from review as they are similar to previous changes (14)
- examples/example-predeployed-connector/src/vite-env.d.ts
- examples/example-predeployed-connector/index.html
- examples/example-predeployed-connector/dojoConfig.ts
- pnpm-workspace.yaml
- packages/core/src/utils/index.ts
- examples/example-predeployed-connector/vite.config.ts
- examples/example-predeployed-connector/eslint.config.js
- examples/example-predeployed-connector/.gitignore
- examples/example-predeployed-connector/src/App.css
- .changeset/early-steaks-perform.md
- examples/example-predeployed-connector/tsconfig.json
- packages/core/src/provider/DojoProvider.ts
- examples/example-vite-react-sdk/package.json
- packages/predeployed-connector/src/index.ts
🧰 Additional context used
🪛 Biome (1.9.4)
examples/example-vite-react-sdk/src/typescript/contracts.gen.ts
[error] 21-21: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
[error] 42-42: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
examples/example-predeployed-connector/src/typescript/models.gen.ts
[error] 3-8: Some named imports are only used as types.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.
(lint/style/useImportType)
examples/example-predeployed-connector/src/App.tsx
[error] 12-12: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.
(lint/a11y/noBlankTarget)
[error] 15-15: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.
(lint/a11y/noBlankTarget)
[error] 25-25: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
examples/example-predeployed-connector/src/main.tsx
[error] 7-7: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
examples/example-predeployed-connector/src/starknet-provider.tsx
[error] 19-19: This hook does not specify all of its dependencies: retries
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
(lint/correctness/useExhaustiveDependencies)
examples/example-predeployed-connector/src/typescript/contracts.gen.ts
[error] 1-1: All these imports are only used as types.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.
(lint/style/useImportType)
[error] 2-9: Some named imports are only used as types.
This import is only used as a type.
This import is only used as a type.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.
(lint/style/useImportType)
examples/example-predeployed-connector/tsconfig.app.json
[error] 10-10: JSON standard does not allow comments.
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: JSON standard does not allow comments.
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 24-24: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-26: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
examples/example-predeployed-connector/tsconfig.node.json
[error] 9-9: JSON standard does not allow comments.
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: JSON standard does not allow comments.
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-24: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: check
- GitHub Check: build
🔇 Additional comments (28)
examples/example-predeployed-connector/package.json (3)
1-5
: Package Metadata & Module Setup (Lines 1-5)
The basic metadata is clearly defined with a proper project name, privacy flag, version, and module type. The version "0.0.0" appears to be a placeholder—ensure this is intentional for pre-release projects.
12-20
: Dependencies Configuration (Lines 12-20)
The dependencies section uses workspace references for internal Dojo Engine packages, which is appropriate for a monorepo setup. However, the version specifiers"catalog:"
for both@starknet-react/chains
and@starknet-react/core
are unusual compared to the"workspace:*"
pattern used for other packages. Please verify that these are correctly configured to pull from your intended registry or source.
21-33
: DevDependencies Configuration (Lines 21-33)
This section is comprehensive and includes vital tools such as ESLint, TypeScript, and Vite plugins. One point to verify: the dependency"typescript-eslint": "^8.22.0"
is listed. Typically, ESLint integrations for TypeScript use packages like@typescript-eslint/eslint-plugin
and@typescript-eslint/parser
. Confirm that"typescript-eslint"
is the intended package for your setup.examples/example-predeployed-connector/tsconfig.node.json (2)
1-8
: Base Configuration Looks SolidThe main compiler options (lines 1–8) are well defined: the build info file, target, lib, module, and skipLibCheck settings are appropriate for a modern Node setup.
23-24
: Include Directive is Well SpecifiedThe
"include"
property (lines 23–24) correctly targets"vite.config.ts"
, ensuring the proper files are included in the build process.🧰 Tools
🪛 Biome (1.9.4)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-24: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/tsconfig.app.json (2)
1-9
: Compiler Options Block – Looks Good Overall
The basic compiler options (target, module, lib, etc.) are defined appropriately for a modern TypeScript project targeting ES2020. The inclusion of a dedicated tsBuildInfoFile path and strict flags enhances build reliability and type safety.
18-23
: Linting Settings Block – Valid but Check for Linter Compatibility
The linting options (e.g.,"strict"
,"noUnusedLocals"
, etc.) are correctly set to enforce high code quality. As with the bundler comments above, the inline comment/* Linting */
might trigger errors in tools that enforce strict JSON. Ensure that your project or CI configuration accepts JSONC for tsconfig files.🧰 Tools
🪛 Biome (1.9.4)
[error] 18-18: JSON standard does not allow comments.
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/src/index.css (6)
1-14
: Global Root StylesThe
:root
block is well-defined and sets essential global properties (font-family, line-height, color scheme, etc.) which establish a solid baseline for the application’s styling. Ensure that these values are in line with your overall design system or branding guidelines.
16-23
: Anchor Element StylingThe styles for anchor tags (
a
anda:hover
) are clear and provide a visually distinct hover state, which improves user interaction. Confirm that the chosen colors integrate well with the overall theme and maintain sufficient contrast.
25-31
: Body Layout StylesThe body styling effectively uses a flex layout with
place-items: center
to center content and sets minimal viewport dimensions. Verify thatplace-items: center
is fully supported in your target browsers or consider adding vendor prefixes if necessary.
33-36
: Heading (h1) StylingThe heading styles (h1) are appropriately prominent with a large font size and tight line-height, ensuring clear visual hierarchy. These choices work well for drawing attention to main titles.
38-55
: Button Styling and Interactive StatesThe button styles—including base, hover, and focus states—are implemented effectively. The use of rounded corners, padding, and a smooth border-color transition provides a polished interactive experience. The focus outline enhances accessibility. It’s a good idea to test the transition effects across different browsers.
57-68
: Responsive Design for Light Color SchemeThe media query for
prefers-color-scheme: light
is a strong addition, adjusting the global and element-specific colors to ensure readability and aesthetic consistency under light mode. These adjustments align well with modern theming practices.examples/example-predeployed-connector/README.md (7)
1-4
: Clear Title and Introduction.
The header and introductory paragraph clearly communicate that this template supports React with TypeScript and Vite along with HMR and ESLint integration.
5-9
: Well-Structured Plugin Section.
The bullet list specifying the two official plugins, along with helpful links and brief descriptions, provides users with a solid understanding of their options. Consider optionally including a brief note on when to prefer one plugin over the other.
10-13
: Concise Guidance for ESLint Configuration.
The section heading and the following description effectively set the stage for configuring type-aware lint rules, making the purpose clear.
14-15
: Clear Instruction for Parser Options Configuration.
The step instructing users to configure the top-levelparserOptions
property is straightforward and sets the right expectations for the code snippet that follows.
16-26
: Informative ESLint Configuration Example.
The provided code snippet illustrates how to initializetseslint.config
with the necessaryparserOptions
. It’s clear and easy to follow. One thing to verify is that the use ofimport.meta.dirname
is fully supported in your Vite environment.
27-31
: Valuable Additional Configuration Recommendations.
The subsequent bullet list offers practical advice on modifying and extending the ESLint setup, including switching to type-checked configs and installing the React plugin. This provides clear next steps for enhancing linting.
32-50
: Comprehensive ESLint Setup for React Integration.
The second code snippet demonstrates a robust ESLint configuration for a React project. It effectively shows how to import and configure theeslint-plugin-react
, set the React version, and merge recommended rules.examples/example-vite-react-sdk/tsconfig.app.tsbuildinfo (2)
1-1
:❓ Verification inconclusive
Architectural change: Verify impact of removing DojoContext.
The removal of
dojocontext.tsx
from the build configuration suggests a significant change in how context is managed. This aligns with the PR's goal of fixing predeployed connector warnings, but we should verify the new approach.
🏁 Script executed:
#!/bin/bash # Search for new context-related implementations that might replace dojocontext.tsx echo "Searching for new context implementations..." rg -t tsx -t ts "createContext|useContext" ./examples/example-vite-react-sdk/src/ echo "Searching for imports of removed DojoContext..." rg -t tsx -t ts "DojoContext" ./examples/example-vite-react-sdk/src/Length of output: 412
I'll run a new shell script that uses file glob patterns to properly search the repository without encountering the "unrecognized file type" error. This should give us the necessary context-related information before finalizing the review comment.
Please run this script and share the output so we can verify the impact of removing
DojoContext
and update the review comment accordingly.
🏁 Script executed:
[run_scripts] #!/bin/bash # Properly search for context implementations and references to DojoContext using glob filters for TypeScript files echo "Searching for new context implementations (using file globs)..." rg "createContext|useContext" -g "*.tsx" -g "*.ts" ./examples/example-vite-react-sdk/src/ echo "Searching for any remaining references to DojoContext (using file globs)..." rg "DojoContext" -g "*.tsx" -g "*.ts" ./examples/example-vite-react-sdk/src/Length of output: 588
Action Required: Confirm Architectural Changes and Context Handling
- The build configuration now excludes
DojoContext
, and our searches did not reveal any lingering references in the source files.- Additionally, the grep for potential new context creation or usage (i.e.,
createContext
/useContext
) did not return any results.- This absence of evidence suggests that
DojoContext
has been fully removed without an explicit replacement in the codebase.- Please manually verify: Is this removal an intentional part of the architectural change, or is there an alternative context implementation elsewhere not captured by our search? Ensure that downstream components correctly handle context management given this update.
1-1
:✅ Verification successful
Verify TypeScript version compatibility.
The TypeScript version has been updated to 5.7.3. Let's ensure this version is compatible with all dependencies and doesn't introduce breaking changes.
🌐 Web query:
What are the breaking changes in TypeScript 5.7.3 compared to 5.7.2?
💡 Result:
TypeScript 5.7.x releases (including versions like 5.7.x) typically focus on bug fixes rather than introducing breaking changes[1][10]. Based on available data:
Key Observations
1️⃣ No Documented Breaking Changes
There are no explicitly listed breaking changes between TypeScript 5.7.x versions (e.g.,5.x.x
→x.x.x
) according to official sources like:
- The TypeScript GitHub milestone for
x.x.x
[x]- Microsoft’s developer blogs[2][4][x]
- NuGet release notes[x]
2️⃣ Bug Fixes as Potential Regressions
The only notable change comes from an issue where TypeScript x.x.x introduced a regression in contextual type checking for intersection properties compared to x.x.x[6]. This was addressed in commit xxxxxx (#xxxxx) but isn’t explicitly tied tox.x.x
.Practical Impact
- Projects relying on specific edge-case behaviors fixed in
x.x.x
might see new errors if they depended on incorrect type inferences from earlier versions[6].- Patch releases like
x.x.x
generally avoid intentional breaking API/type-system changes[10].Recommendation
For most users upgrading from
x.x.x
tox.x.x
, no significant breaking changes are expected beyond potential fixes for unintended behaviors[9][10]. Always check your project’s CI/CD pipelines after minor version upgrades for unexpected type errors caused by corrected bugs[6].Citations:
- 1: https://github.com/microsoft/TypeScript/wiki/Breaking-Changes
- 2: https://devblogs.microsoft.com/typescript/announcing-typescript-5-7-beta/
- 3: https://en.wikipedia.org/wiki/TypeScript
- 4: https://devblogs.microsoft.com/typescript/
- 5: https://github.com/microsoft/TypeScript/milestone/213
- 6: Possible regression of intersection type inference in 5.7.2 compared to 5.6.3 microsoft/TypeScript#60864
- 7: https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/
- 8: https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild
- 9: https://fossies.org/diffs/typescript/5.7.2_vs_5.7.3/index.html
- 10: https://github.com/microsoft/typescript/releases
Updated Review: TypeScript Compatibility & Architectural Change Confirmation
- TypeScript Upgrade: The update from 5.7.2 to 5.7.3 is confirmed to be a bug-fix release without any documented breaking changes. This upgrade should not adversely affect compatibility.
- Architectural Update: The removal of
./src/dojocontext.tsx
from the root array intsconfig.app.tsbuildinfo
aligns with the intended architectural changes.- Recommendation: Re-run CI/CD pipelines to catch any unforeseen issues from updated type inference improvements, though no breaking changes are expected.
examples/example-predeployed-connector/src/typescript/models.gen.ts (1)
86-149
: Initialization approach looks sound.The default
schema
object adequately instantiates the required model properties. This consistently ensures your data structures remain valid throughout the application.examples/example-predeployed-connector/src/main.tsx (2)
7-7
: Handle potential null element more safely.This comment mirrors a previous remark regarding the forbidden non-null assertion. Wrap the call to
createRoot
in a conditional to avoid null references.- createRoot(document.getElementById("root")!).render( + const root = document.getElementById("root"); + if (!root) { + throw new Error("Root element not found"); + } + createRoot(root).render(🧰 Tools
🪛 Biome (1.9.4)
[error] 7-7: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
8-13
: Rendering logic is straightforward and consistent.Your use of React’s
StrictMode
and the importedStarknetProvider
helps ensure the main application is loaded within a proper context.examples/example-predeployed-connector/src/App.tsx (2)
12-14
: Add security attributes to external links.Links with
target="_blank"
should includerel="noreferrer"
to prevent potential security vulnerabilities (reverse tabnabbing).Also applies to: 15-21
🧰 Tools
🪛 Biome (1.9.4)
[error] 12-12: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.(lint/a11y/noBlankTarget)
25-27
: Add explicit button type for accessibility.Buttons should have an explicit type for better accessibility and to prevent unintended form submissions.
🧰 Tools
🪛 Biome (1.9.4)
[error] 25-25: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
examples/example-predeployed-connector/src/starknet-provider.tsx (1)
19-28
: Fix missing dependency in useEffect hook.The
retries
state is used inside the effect but not included in the dependency array, which could lead to stale closures.🧰 Tools
🪛 Biome (1.9.4)
[error] 19-19: This hook does not specify all of its dependencies: retries
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
(lint/correctness/useExhaustiveDependencies)
@@ -18,7 +18,7 @@ export function setupWorld(provider: DojoProvider) { | |||
) => { | |||
try { | |||
return await provider.execute( | |||
snAccount, | |||
snAccount as any, // Type cast to avoid version mismatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Avoid using any
type casting.
Using any
bypasses TypeScript's type checking and can hide potential issues. Instead of type casting to any
, consider:
- Upgrading dependencies to resolve version mismatches
- Using a more specific type that matches both versions
- Creating a type union if specific incompatibilities need to be handled
- snAccount as any, // Type cast to avoid version mismatch
+ snAccount as Account | AccountInterface,
Also applies to: 42-42
🧰 Tools
🪛 Biome (1.9.4)
[error] 21-21: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
18ab027
to
6f6fdfd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (6)
examples/example-predeployed-connector/README.md (1)
16-26
: Robust ESLint ParserOptions ExampleThe provided code snippet offers a concrete example of how to configure the top-level
parserOptions
. It correctly demonstrates how to reference multiple TypeScript configuration files and useimport.meta.dirname
for dynamic directory resolution.
Suggestion: Consider adding a brief comment or note right after the code block reminding users to ensure these TS configuration files exist in their project structure.examples/example-predeployed-connector/tsconfig.app.json (1)
10-17
: Bundler Mode Settings & Inline CommentThe bundler-specific options (like
"moduleResolution": "bundler"
,"allowImportingTsExtensions"
,"isolatedModules"
, and"moduleDetection": "force"
) are well-configured for use with modern bundlers (e.g., Vite).
Note: The inline comment (/* Bundler mode */
on line 10) is acceptable intsconfig
files since TypeScript supports JSON with Comments (JSONC). However, several static analysis tools may flag such comments because raw JSON does not support them. Ensure your tooling is configured to handle JSONC to avoid false positives.🧰 Tools
🪛 Biome (1.9.4)
[error] 10-10: JSON standard does not allow comments.
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/tsconfig.node.json (2)
9-15
: Comment Usage in a tsconfig FileThis section includes block comments (e.g.,
/* Bundler mode */
) that are not part of standard JSON. However, TypeScript’s configuration files are parsed as JSONC (JSON with Comments) so these comments are acceptable for the TypeScript compiler. If your static analysis tools or linters flag these comments as errors, consider one of the following:
- Adjust the linter configuration to allow comments in tsconfig files.
- Rename the file to
tsconfig.node.jsonc
if your tooling supports that.Feel free to let me know if you’d like a suggested diff to change the comment style (e.g., from block comments to single-line
//
comments).🧰 Tools
🪛 Biome (1.9.4)
[error] 9-9: JSON standard does not allow comments.
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
1-25
: Static Analysis Feedback & False PositivesSeveral static analysis errors (e.g., "JSON standard does not allow comments" and "End of file expected") are reported. These appear to be false positives because tsconfig files are expected to use JSONC format. If these warnings impact your build pipeline or code review process, consider updating your linter settings to distinguish between strict JSON and configuration files like tsconfig that support comments.
🧰 Tools
🪛 Biome (1.9.4)
[error] 9-9: JSON standard does not allow comments.
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: JSON standard does not allow comments.
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-24: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/src/typescript/models.gen.ts (1)
3-8
: Optimize type-only import.You’re creating new instances of
CairoCustomEnum
,CairoOption
, and usingCairoOptionVariant
at runtime. However,BigNumberish
appears to be used as a type only. Consider splitting the imports to optimize bundling by usingimport type
forBigNumberish
:-import { - CairoCustomEnum, - CairoOption, - CairoOptionVariant, - BigNumberish, -} from "starknet"; +import { CairoCustomEnum, CairoOption, CairoOptionVariant } from "starknet"; +import type { BigNumberish } from "starknet";🧰 Tools
🪛 Biome (1.9.4)
[error] 3-8: Some named imports are only used as types.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.(lint/style/useImportType)
examples/example-predeployed-connector/src/typescript/contracts.gen.ts (1)
1-10
: Use type-only imports for better tree-shaking.The imports are only used as types, so they should be marked with the
type
keyword to ensure they are removed by the compiler.Apply this fix:
-import { DojoProvider, DojoCall } from "@dojoengine/core"; +import type { DojoProvider, DojoCall } from "@dojoengine/core"; -import { - Account, - AccountInterface, - BigNumberish, - CairoOption, - CairoCustomEnum, - ByteArray, -} from "starknet"; +import type { + Account, + AccountInterface, + BigNumberish, + CairoOption, + CairoCustomEnum, + ByteArray, +} from "starknet";🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: All these imports are only used as types.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.(lint/style/useImportType)
[error] 2-9: Some named imports are only used as types.
This import is only used as a type.
This import is only used as a type.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.(lint/style/useImportType)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
examples/example-predeployed-connector/public/vite.svg
is excluded by!**/*.svg
examples/example-predeployed-connector/src/assets/react.svg
is excluded by!**/*.svg
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (30)
.changeset/early-steaks-perform.md
(1 hunks)examples/example-predeployed-connector/.gitignore
(1 hunks)examples/example-predeployed-connector/README.md
(1 hunks)examples/example-predeployed-connector/dojoConfig.ts
(1 hunks)examples/example-predeployed-connector/eslint.config.js
(1 hunks)examples/example-predeployed-connector/index.html
(1 hunks)examples/example-predeployed-connector/package.json
(1 hunks)examples/example-predeployed-connector/src/App.css
(1 hunks)examples/example-predeployed-connector/src/App.tsx
(1 hunks)examples/example-predeployed-connector/src/index.css
(1 hunks)examples/example-predeployed-connector/src/main.tsx
(1 hunks)examples/example-predeployed-connector/src/starknet-provider.tsx
(1 hunks)examples/example-predeployed-connector/src/typescript/contracts.gen.ts
(1 hunks)examples/example-predeployed-connector/src/typescript/models.gen.ts
(1 hunks)examples/example-predeployed-connector/src/vite-env.d.ts
(1 hunks)examples/example-predeployed-connector/tsconfig.app.json
(1 hunks)examples/example-predeployed-connector/tsconfig.json
(1 hunks)examples/example-predeployed-connector/tsconfig.node.json
(1 hunks)examples/example-predeployed-connector/vite.config.ts
(1 hunks)examples/example-vite-react-sdk/package.json
(1 hunks)examples/example-vite-react-sdk/src/DojoContext.tsx
(0 hunks)examples/example-vite-react-sdk/src/main.tsx
(1 hunks)examples/example-vite-react-sdk/src/starknet-provider.tsx
(2 hunks)examples/example-vite-react-sdk/src/typescript/contracts.gen.ts
(3 hunks)examples/example-vite-react-sdk/tsconfig.app.tsbuildinfo
(1 hunks)examples/example-vite-react-sdk/tsconfig.node.tsbuildinfo
(1 hunks)packages/core/src/provider/DojoProvider.ts
(1 hunks)packages/core/src/utils/index.ts
(1 hunks)packages/predeployed-connector/src/index.ts
(4 hunks)pnpm-workspace.yaml
(1 hunks)
💤 Files with no reviewable changes (1)
- examples/example-vite-react-sdk/src/DojoContext.tsx
🚧 Files skipped from review as they are similar to previous changes (18)
- examples/example-vite-react-sdk/tsconfig.node.tsbuildinfo
- examples/example-predeployed-connector/vite.config.ts
- pnpm-workspace.yaml
- examples/example-predeployed-connector/index.html
- examples/example-predeployed-connector/dojoConfig.ts
- examples/example-predeployed-connector/src/App.css
- examples/example-predeployed-connector/tsconfig.json
- examples/example-vite-react-sdk/src/main.tsx
- examples/example-vite-react-sdk/tsconfig.app.tsbuildinfo
- packages/core/src/utils/index.ts
- examples/example-predeployed-connector/.gitignore
- examples/example-predeployed-connector/eslint.config.js
- examples/example-predeployed-connector/package.json
- examples/example-vite-react-sdk/src/starknet-provider.tsx
- packages/core/src/provider/DojoProvider.ts
- .changeset/early-steaks-perform.md
- examples/example-predeployed-connector/src/vite-env.d.ts
- examples/example-vite-react-sdk/package.json
🧰 Additional context used
🪛 Biome (1.9.4)
examples/example-predeployed-connector/src/typescript/models.gen.ts
[error] 3-8: Some named imports are only used as types.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.
(lint/style/useImportType)
examples/example-predeployed-connector/src/App.tsx
[error] 12-12: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.
(lint/a11y/noBlankTarget)
[error] 15-15: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.
(lint/a11y/noBlankTarget)
[error] 25-25: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
examples/example-predeployed-connector/src/main.tsx
[error] 7-7: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
examples/example-predeployed-connector/src/starknet-provider.tsx
[error] 19-19: This hook does not specify all of its dependencies: retries
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
(lint/correctness/useExhaustiveDependencies)
examples/example-predeployed-connector/src/typescript/contracts.gen.ts
[error] 1-1: All these imports are only used as types.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.
(lint/style/useImportType)
[error] 2-9: Some named imports are only used as types.
This import is only used as a type.
This import is only used as a type.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.
(lint/style/useImportType)
examples/example-predeployed-connector/tsconfig.app.json
[error] 10-10: JSON standard does not allow comments.
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: JSON standard does not allow comments.
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 24-24: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-26: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
examples/example-predeployed-connector/tsconfig.node.json
[error] 9-9: JSON standard does not allow comments.
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: JSON standard does not allow comments.
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-24: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
examples/example-vite-react-sdk/src/typescript/contracts.gen.ts
[error] 21-21: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
[error] 42-42: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: build
- GitHub Check: check
🔇 Additional comments (25)
examples/example-predeployed-connector/README.md (5)
1-3
: Clear and Descriptive HeaderThe title and the introductory statement clearly communicate that this template sets up React with TypeScript and Vite. This gives users immediate context about the project.
5-9
: Informative Plugin SectionThe bullet list detailing the two official React plugins for Vite is well-structured and provides useful links and concise explanations. This makes it easy for users to choose the appropriate plugin for HMR.
10-15
: Effective ESLint Configuration IntroductionThe section header and the initial bullet point introduce the need for updating ESLint to enable type-aware linting. This is clear and sets up the context for the subsequent code snippet.
28-30
: Clear Recommendations for ESLint EnhancementsThe following bullet points clearly instruct users on how to upgrade their ESLint configuration—from switching to type-checked recommended settings to installing the React plugin. This guidance helps ensure that the base configuration can be further customized for production readiness.
32-50
: Comprehensive ESLint Configuration ExampleThe ESLint configuration example in this section is detailed and practical. It:
- Sets the React version explicitly (note: verify that "18.3" aligns with your project dependencies).
- Imports and integrates the
eslint-plugin-react
with clarity.- Merges recommended rule sets seamlessly.
Suggestion: It might be useful to add a comment clarifying why the particular version "18.3" was chosen, or to advise users to update it according to their React version, ensuring compatibility.examples/example-predeployed-connector/tsconfig.app.json (3)
1-9
: Basic Compiler Options ConfigurationThe initial section correctly sets up core compiler options such as
"target"
,"lib"
,"module"
, and others. The settings are appropriate for a modern TypeScript project.
18-24
: Linting and Strictness EnhancementsThe linting settings enforce strict type and error checking (e.g.,
"strict": true
,"noUnusedLocals": true
,"noUnusedParameters": true
, etc.), which is excellent for maintaining code quality.
Note: Similar to the bundler section, the inline comment (/* Linting */
on line 18) is valid in a tsconfig file but could trigger errors in tools expecting pure JSON. Ensure the static analysis tools are properly configured for JSONC.🧰 Tools
🪛 Biome (1.9.4)
[error] 18-18: JSON standard does not allow comments.
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 24-24: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
25-27
: Project InclusionThe
"include": ["src"]
directive is clear and concise, focusing the compilation on thesrc
directory. Depending on project growth, you might later consider expanding this if additional directories (e.g., tests or custom typings) need to be included.🧰 Tools
🪛 Biome (1.9.4)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-26: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/tsconfig.node.json (3)
1-8
: General Configuration Settings Look CorrectThe compiler options defined here (such as
tsBuildInfoFile
,target
,lib
,module
, andskipLibCheck
) appear to be set as intended for a Node environment targeting ES2022 with ES2023 library features.
16-22
: Linting Options are Well-ConfiguredThe strict linting options (
strict
,noUnusedLocals
,noUnusedParameters
,noFallthroughCasesInSwitch
, andnoUncheckedSideEffectImports
) are clearly laid out. This high level of type-checking and code quality enforcement aligns with robust development practices.🧰 Tools
🪛 Biome (1.9.4)
[error] 16-16: JSON standard does not allow comments.
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
23-24
: Include Paths ConfigurationThe
"include": ["vite.config.ts"]
ensures that TypeScript will includevite.config.ts
in the compilation process. Verify this inclusion aligns with the intended project structure—if additional files or patterns should be covered, update this array accordingly.🧰 Tools
🪛 Biome (1.9.4)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-24: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/src/index.css (7)
1-14
: Global Styles with:root
The:root
block effectively defines the base typography and color-scheme properties. All declarations (font-family, line-height, font-weight, color-scheme, and visual smoothing properties) are modern and well-organized.
16-23
: Anchor Tag Styles
The rules for anchor (a
) elements and their hover state are clear and consistent. The use offont-weight
, color declarations, and the inherited text-decoration ensures the links integrate well with the overall typographic design.
33-36
: Heading (h1
) Styling
The styling applied toh1
(with a large font size and adjusted line-height) establishes a clear visual hierarchy. This approach is effective for emphasizing major headings within the application.
38-48
: Button Base Styling
The button styles, including border properties, padding, font settings, and background color, are clearly defined. The use of transitions for interactive feedback is well-applied.
49-51
: Button Hover Effect
The hover state for buttons is well-handled by changing the border color, providing a clear visual indication for interactivity.
52-55
: Accessible Button Focus States
The focus and focus-visible styles ensure that users navigating via keyboard receive a clear outline indicator, enhancing accessibility.
57-68
: Media Query Adjustments for Light Mode
The media query targeting(prefers-color-scheme: light)
correctly adjusts the root, link hover, and button background colors for optimal readability and visual consistency in light mode.examples/example-predeployed-connector/src/main.tsx (1)
7-7
: Use safe root element retrieval.If the DOM element isn't found, the non-null assertion
!
can lead to a runtime error. This issue has been flagged previously, so this is a repeated recommendation.- createRoot(document.getElementById("root")!).render( + const rootElement = document.getElementById("root"); + if (!rootElement) throw new Error("Failed to find root element"); + createRoot(rootElement).render(🧰 Tools
🪛 Biome (1.9.4)
[error] 7-7: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
examples/example-predeployed-connector/src/App.tsx (3)
12-14
: Add “rel” attribute for security.Opening external links with
target="_blank"
withoutrel="noreferrer"
can expose your site to reverse tabnabbing attacks. This recommendation matches a previous comment.- <a href="https://vite.dev" target="_blank"> + <a href="https://vite.dev" target="_blank" rel="noreferrer"> <img src={viteLogo} className="logo" alt="Vite logo" /> </a>🧰 Tools
🪛 Biome (1.9.4)
[error] 12-12: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.(lint/a11y/noBlankTarget)
15-21
: Add “rel” attribute for security.Similarly, the link to React.dev also needs
rel="noreferrer"
. This is a repeated recommendation.- <a href="https://react.dev" target="_blank"> + <a href="https://react.dev" target="_blank" rel="noreferrer"> <img src={reactLogo} className="logo react" alt="React logo" /> </a>🧰 Tools
🪛 Biome (1.9.4)
[error] 15-15: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.(lint/a11y/noBlankTarget)
25-25
: Specify button type.Reliance on default button behavior can lead to unintended form submissions in certain scenarios. This fix mirrors a prior suggestion.
- <button onClick={() => setCount((count) => count + 1)}> + <button type="button" onClick={() => setCount((count) => count + 1)}> count is {count} </button>🧰 Tools
🪛 Biome (1.9.4)
[error] 25-25: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
examples/example-predeployed-connector/src/starknet-provider.tsx (1)
19-28
: Fix missing dependency in useEffect hook.The
retries
state is used inside the effect but not included in the dependency array, which could lead to stale closures.Apply this fix:
- }, [connectors]); + }, [connectors, retries]);🧰 Tools
🪛 Biome (1.9.4)
[error] 19-19: This hook does not specify all of its dependencies: retries
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
(lint/correctness/useExhaustiveDependencies)
examples/example-vite-react-sdk/src/typescript/contracts.gen.ts (1)
21-21
: Avoid usingany
type casting.Using
any
bypasses TypeScript's type checking and can hide potential issues.Apply this fix:
- snAccount as any, // Type cast to avoid version mismatch + snAccount as Account | AccountInterface,Also applies to: 42-42
🧰 Tools
🪛 Biome (1.9.4)
[error] 21-21: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
packages/predeployed-connector/src/index.ts (1)
73-73
: LGTM! Good improvements to type safety and transaction versioning.The changes correctly enhance type safety and add proper transaction versioning (V3) for the Account initialization.
Also applies to: 257-263
body { | ||
margin: 0; | ||
display: flex; | ||
place-items: center; | ||
min-width: 320px; | ||
min-height: 100vh; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flex Container Centering Issue in body
The body
is styled as a flex container; however, using place-items: center
is ineffective on flex containers—it is intended for CSS grid layouts. To correctly center content both horizontally and vertically, please replace it with:
- place-items: center;
+ justify-content: center;
+ align-items: center;
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
body { | |
margin: 0; | |
display: flex; | |
place-items: center; | |
min-width: 320px; | |
min-height: 100vh; | |
} | |
body { | |
margin: 0; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
min-width: 320px; | |
min-height: 100vh; | |
} |
6f6fdfd
to
a4fc8e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (8)
examples/example-predeployed-connector/src/starknet-provider.tsx (1)
16-17
: Consider safer type handling for rpcUrl.The type assertion
as string
assumesdojoConfig.rpcUrl
is always a string. Consider adding runtime validation or using a type guard.Apply this safer approach:
+ if (typeof dojoConfig.rpcUrl !== 'string') { + throw new Error('RPC URL must be a string'); + } const provider = jsonRpcProvider({ - rpc: () => ({ nodeUrl: dojoConfig.rpcUrl as string }), + rpc: () => ({ nodeUrl: dojoConfig.rpcUrl }), });Also applies to: 23-23
examples/example-predeployed-connector/tsconfig.node.json (1)
1-25
: Ensure JSONC Compatibility for tsconfig.node.jsonThe configuration file correctly sets up advanced TypeScript options (e.g., bundler mode, strict linting) for Node. However, note that the file uses JavaScript-style comments (e.g., at lines 9 and 16), which are not allowed in standard JSON. Since TypeScript configuration files are traditionally parsed as JSONC, please verify that your static analysis tools (e.g., Biome) and build processes are configured to support JSON with comments. If not, you might consider one of the following actions:
- Reconfigure the static analysis tool to accept JSONC.
- Rename the file to
tsconfig.node.jsonc
if that aligns with your project's conventions.- Alternatively, remove the comments if strict JSON adherence is required.
Additionally, double-check that the slight mismatch between
"target": "ES2022"
and the library setting"lib": ["ES2023"]
is intentional and compatible with your intended runtime environment.🧰 Tools
🪛 Biome (1.9.4)
[error] 9-9: JSON standard does not allow comments.
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: JSON standard does not allow comments.
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-24: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/tsconfig.app.json (2)
10-17
: Bundler Mode Settings & Comment ConsiderationThe bundler-specific settings such as
"moduleResolution": "bundler"
,"allowImportingTsExtensions"
,"isolatedModules"
,"moduleDetection": "force"
,"noEmit"
, and"jsx": "react-jsx"
are set correctly.
Note: The inline comment (/* Bundler mode */
) on line 10 is not valid in strict JSON. Although TypeScript configuration files (liketsconfig.json
) often allow comments (i.e. JSONC), if your static analysis or build tools enforce pure JSON, you might face issues.
Consider either removing these comments or configuring your linter to accept JSONC comments.🧰 Tools
🪛 Biome (1.9.4)
[error] 10-10: JSON standard does not allow comments.
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
18-24
: Linting Options & JSON Comment IssueThe strict linting properties (
"strict"
,"noUnusedLocals"
,"noUnusedParameters"
,"noFallthroughCasesInSwitch"
, and"noUncheckedSideEffectImports"
) are configured to enforce high code quality.
Similar to the bundler section, the inline comment (/* Linting */
) on line 18 is not compliant with the JSON standard. If you encounter any validation errors from strict JSON parsers, consider removing these comments or adjusting your tooling to recognize JSONC.🧰 Tools
🪛 Biome (1.9.4)
[error] 18-18: JSON standard does not allow comments.
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 24-24: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/src/typescript/models.gen.ts (2)
64-71
: Consolidate direction representations if possible.Currently,
Direction
andDirectionEnum
overlap in functionality. If feasible, consider unifying them into a single type to reduce confusion.
86-149
: Consider extracting repeated default direction into a shared constant.Multiple sections define default directions. Centralizing them might reduce duplication and facilitate easier changes in the future.
examples/example-predeployed-connector/src/typescript/contracts.gen.ts (1)
23-37
: Error handling is sufficient.Capturing the error, logging, and rethrowing is a straightforward approach. For production, consider a structured logging system if needed.
examples/example-predeployed-connector/README.md (1)
14-26
: Good example of enabling type-aware lint rules.For advanced use, ensure that the project references official ESLint docs to fine-tune rules as needed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
examples/example-predeployed-connector/public/vite.svg
is excluded by!**/*.svg
examples/example-predeployed-connector/src/assets/react.svg
is excluded by!**/*.svg
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (30)
.changeset/early-steaks-perform.md
(1 hunks)examples/example-predeployed-connector/.gitignore
(1 hunks)examples/example-predeployed-connector/README.md
(1 hunks)examples/example-predeployed-connector/dojoConfig.ts
(1 hunks)examples/example-predeployed-connector/eslint.config.js
(1 hunks)examples/example-predeployed-connector/index.html
(1 hunks)examples/example-predeployed-connector/package.json
(1 hunks)examples/example-predeployed-connector/src/App.css
(1 hunks)examples/example-predeployed-connector/src/App.tsx
(1 hunks)examples/example-predeployed-connector/src/index.css
(1 hunks)examples/example-predeployed-connector/src/main.tsx
(1 hunks)examples/example-predeployed-connector/src/starknet-provider.tsx
(1 hunks)examples/example-predeployed-connector/src/typescript/contracts.gen.ts
(1 hunks)examples/example-predeployed-connector/src/typescript/models.gen.ts
(1 hunks)examples/example-predeployed-connector/src/vite-env.d.ts
(1 hunks)examples/example-predeployed-connector/tsconfig.app.json
(1 hunks)examples/example-predeployed-connector/tsconfig.json
(1 hunks)examples/example-predeployed-connector/tsconfig.node.json
(1 hunks)examples/example-predeployed-connector/vite.config.ts
(1 hunks)examples/example-vite-react-sdk/package.json
(1 hunks)examples/example-vite-react-sdk/src/DojoContext.tsx
(0 hunks)examples/example-vite-react-sdk/src/main.tsx
(1 hunks)examples/example-vite-react-sdk/src/starknet-provider.tsx
(2 hunks)examples/example-vite-react-sdk/src/typescript/contracts.gen.ts
(3 hunks)examples/example-vite-react-sdk/tsconfig.app.tsbuildinfo
(1 hunks)examples/example-vite-react-sdk/tsconfig.node.tsbuildinfo
(1 hunks)packages/core/src/provider/DojoProvider.ts
(1 hunks)packages/core/src/utils/index.ts
(1 hunks)packages/predeployed-connector/src/index.ts
(4 hunks)pnpm-workspace.yaml
(1 hunks)
💤 Files with no reviewable changes (1)
- examples/example-vite-react-sdk/src/DojoContext.tsx
🚧 Files skipped from review as they are similar to previous changes (19)
- examples/example-predeployed-connector/dojoConfig.ts
- examples/example-predeployed-connector/vite.config.ts
- examples/example-predeployed-connector/src/vite-env.d.ts
- examples/example-predeployed-connector/tsconfig.json
- packages/core/src/utils/index.ts
- examples/example-vite-react-sdk/tsconfig.app.tsbuildinfo
- examples/example-predeployed-connector/src/App.css
- examples/example-vite-react-sdk/src/main.tsx
- examples/example-predeployed-connector/index.html
- examples/example-predeployed-connector/.gitignore
- .changeset/early-steaks-perform.md
- packages/core/src/provider/DojoProvider.ts
- examples/example-predeployed-connector/package.json
- examples/example-predeployed-connector/src/index.css
- examples/example-vite-react-sdk/package.json
- examples/example-vite-react-sdk/src/starknet-provider.tsx
- examples/example-vite-react-sdk/tsconfig.node.tsbuildinfo
- pnpm-workspace.yaml
- examples/example-predeployed-connector/eslint.config.js
🧰 Additional context used
🪛 Biome (1.9.4)
examples/example-predeployed-connector/src/typescript/models.gen.ts
[error] 3-8: Some named imports are only used as types.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.
(lint/style/useImportType)
examples/example-predeployed-connector/src/App.tsx
[error] 12-12: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.
(lint/a11y/noBlankTarget)
[error] 15-15: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.
(lint/a11y/noBlankTarget)
[error] 25-25: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset
(lint/a11y/useButtonType)
examples/example-predeployed-connector/src/main.tsx
[error] 7-7: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
examples/example-predeployed-connector/src/starknet-provider.tsx
[error] 19-19: This hook does not specify all of its dependencies: retries
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
(lint/correctness/useExhaustiveDependencies)
examples/example-predeployed-connector/src/typescript/contracts.gen.ts
[error] 1-1: All these imports are only used as types.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.
(lint/style/useImportType)
[error] 2-9: Some named imports are only used as types.
This import is only used as a type.
This import is only used as a type.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.
(lint/style/useImportType)
examples/example-predeployed-connector/tsconfig.app.json
[error] 10-10: JSON standard does not allow comments.
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 15-15: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: JSON standard does not allow comments.
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 24-24: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 25-26: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
examples/example-predeployed-connector/tsconfig.node.json
[error] 9-9: JSON standard does not allow comments.
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-11: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 12-12: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 13-13: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-14: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 14-16: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 16-16: JSON standard does not allow comments.
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 17-17: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 18-18: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 19-19: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 20-20: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 21-21: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 22-22: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 23-24: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
examples/example-vite-react-sdk/src/typescript/contracts.gen.ts
[error] 21-21: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
[error] 42-42: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: check
- GitHub Check: build
🔇 Additional comments (30)
examples/example-predeployed-connector/src/main.tsx (1)
7-7
: Handle potential null case for root element.The non-null assertion (
!
) assumes the root element always exists, which could lead to runtime errors if the element is not found.Apply this safer approach:
-createRoot(document.getElementById("root")!).render( +const rootElement = document.getElementById("root"); +if (!rootElement) throw new Error("Failed to find root element"); +createRoot(rootElement).render(🧰 Tools
🪛 Biome (1.9.4)
[error] 7-7: Forbidden non-null assertion.
(lint/style/noNonNullAssertion)
examples/example-predeployed-connector/src/App.tsx (2)
12-14
: Add security attributes to external links.Links with
target="_blank"
should includerel="noreferrer"
to prevent potential security vulnerabilities (reverse tabnabbing).Apply this fix:
- <a href="https://vite.dev" target="_blank"> + <a href="https://vite.dev" target="_blank" rel="noreferrer"> <img src={viteLogo} className="logo" alt="Vite logo" /> </a> - <a href="https://react.dev" target="_blank"> + <a href="https://react.dev" target="_blank" rel="noreferrer">Also applies to: 15-21
🧰 Tools
🪛 Biome (1.9.4)
[error] 12-12: Avoid using target="_blank" without rel="noreferrer".
Opening external links in new tabs without rel="noreferrer" is a security risk. See the explanation for more details.
Safe fix: Add the rel="noreferrer" attribute.(lint/a11y/noBlankTarget)
25-27
: Add explicit button type for accessibility.Buttons should have an explicit type for better accessibility and to prevent unintended form submissions.
Apply this fix:
- <button onClick={() => setCount((count) => count + 1)}> + <button type="button" onClick={() => setCount((count) => count + 1)}>🧰 Tools
🪛 Biome (1.9.4)
[error] 25-25: Provide an explicit type prop for the button element.
The default type of a button is submit, which causes the submission of a form when placed inside a
form
element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset(lint/a11y/useButtonType)
examples/example-predeployed-connector/src/starknet-provider.tsx (1)
19-28
: Fix missing dependency in useEffect hook.The
retries
state is used inside the effect but not included in the dependency array, which could lead to stale closures.Apply this fix:
- }, [connectors]); + }, [connectors, retries]);🧰 Tools
🪛 Biome (1.9.4)
[error] 19-19: This hook does not specify all of its dependencies: retries
This dependency is not specified in the hook dependency list.
This dependency is not specified in the hook dependency list.
(lint/correctness/useExhaustiveDependencies)
examples/example-vite-react-sdk/src/typescript/contracts.gen.ts (2)
1-2
: LGTM! Good use of type-only imports.Converting imports to type-only imports is a good practice as it helps reduce bundle size since these types are removed during compilation.
21-21
: Avoid usingany
type casting.Using
any
bypasses TypeScript's type checking and can hide potential issues. Instead of type casting toany
, consider:
- Upgrading dependencies to resolve version mismatches
- Using a more specific type that matches both versions
- Creating a type union if specific incompatibilities need to be handled
- snAccount as any, // Type cast to avoid version mismatch + snAccount as Account | AccountInterface,Also applies to: 42-42
🧰 Tools
🪛 Biome (1.9.4)
[error] 21-21: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
packages/predeployed-connector/src/index.ts (3)
4-6
: LGTM! Good use of type-only imports.Converting imports to type-only imports is a good practice as it helps reduce bundle size since these types are removed during compilation.
Also applies to: 9-10, 13-20
73-73
: LGTM! Proper initialization of parent class.The super constructor call now includes all required parameters for proper initialization.
257-263
: LGTM! Proper account initialization with transaction version.The Account constructor now includes all required parameters and explicitly sets the transaction version to V3.
examples/example-predeployed-connector/tsconfig.app.json (2)
1-9
: Configuration Setup Looks GoodThe compiler options (e.g.,
"tsBuildInfoFile"
,"target"
,"useDefineForClassFields"
,"lib"
,"module"
, and"skipLibCheck"
) are correctly defined and align with modern TypeScript practices. This block is well-structured for the intended compilation output.
25-26
: Project Source Inclusion is CorrectThe
"include": ["src"]
configuration properly designates the source directory for compilation. This is standard and helps ensure that only the intended files are processed.🧰 Tools
🪛 Biome (1.9.4)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-25: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 25-26: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
examples/example-predeployed-connector/src/typescript/models.gen.ts (12)
3-8
: Ignore the type-only import hint from static analysis.These imports are used at runtime (e.g., instantiating
CairoCustomEnum
,CairoOption
, etc.). Converting them toimport type
would break the code.🧰 Tools
🪛 Biome (1.9.4)
[error] 3-8: Some named imports are only used as types.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.(lint/style/useImportType)
10-14
: Looks good!The
DirectionsAvailable
interface is clear and descriptive.
16-19
: No concerns here.
21-27
: No issues identified.
29-34
: All good.
36-40
: Interface is straightforward.
42-45
: No further notes.
47-51
: Vector fields are well-specified.
53-57
: Interface for movement is fine.
59-62
: Clear minimal struct.
73-85
: Schema type references look consistent.
150-161
: Mapping enum is consistent and transparent.examples/example-predeployed-connector/src/typescript/contracts.gen.ts (5)
1-9
: Validate usage of imports before converting to type-only.Static analysis flags these imports as type-only, but they're passed at runtime (
snAccount
,direction
, etc.). Ensure each is truly type-only before usingimport type
.🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: All these imports are only used as types.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.(lint/style/useImportType)
[error] 2-9: Some named imports are only used as types.
This import is only used as a type.
This import is only used as a type.
This import is only used as a type.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Add inline type keywords.(lint/style/useImportType)
12-21
: Calldata builder is concise and clear.
39-45
: Spawn calldata generation looks good.
47-58
: Similar remarks on error handling.
60-68
: Exporting a structured object is intuitive.examples/example-predeployed-connector/README.md (2)
1-4
: Intro is clear.
28-50
: Recommended approach is well-documented.
Closes #
Introduced changes
Checklist
Summary by CodeRabbit
New Features
StarknetProvider
component for improved context management.App
component showcasing essential features and interactivity..gitignore
file to manage ignored files and directories effectively.dojoConfig.ts
file for application configuration.Bug Fixes
Documentation