-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SDK] Feature: Adds tsdoc parsing and other eslint rules (#5622)
<!-- start pr-codex --> ## PR-Codex overview This PR focuses on improving TypeScript typings, updating ESLint configurations, and refining package dependencies across various files in the `thirdweb` package. ### Detailed summary - Changed parameter name from `uri` to `_uri` in `onDisplayUri` callback. - Updated `WalletCreationOptions` type definition. - Modified listener type to use `_event`. - Added ESLint rules for better coding practices. - Removed outdated TSDoc tags and added `@example` tag. - Updated package dependencies in `pnpm-lock.yaml`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
1 parent
43fbcac
commit 8234dba
Showing
7 changed files
with
281 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
module.exports = { | ||
rules: { | ||
"no-restricted-syntax": [ | ||
"warn", | ||
{ | ||
selector: "CallExpression[callee.name='useEffect']", | ||
message: | ||
'Are you *sure* you need to use "useEffect" here? If you loading any async function prefer using "useQuery".', | ||
}, | ||
{ | ||
selector: "CallExpression[callee.name='createContext']", | ||
message: | ||
'Are you *sure* you need to use a "Context"? In almost all cases you should prefer passing props directly.', | ||
}, | ||
{ | ||
selector: "CallExpression[callee.name='defineChain']", | ||
message: "Use getCachedChain instead for all internal usage", | ||
}, | ||
], | ||
"no-unused-vars": [ | ||
"warn", | ||
{ | ||
argsIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
caughtErrorsIgnorePattern: "^_", | ||
destructuredArrayIgnorePattern: "^_", | ||
ignoreRestSiblings: true, | ||
args: "none", // Ignore variables used in type definitions | ||
}, | ||
], | ||
"tsdoc/syntax": "warn", | ||
}, | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["@typescript-eslint", "eslint-plugin-tsdoc"], | ||
parserOptions: { | ||
ecmaVersion: 2019, | ||
ecmaFeatures: { | ||
impliedStrict: true, | ||
jsx: true, | ||
}, | ||
warnOnUnsupportedTypeScriptVersion: false, | ||
}, | ||
overrides: [ | ||
// THIS NEEDS TO GO LAST! | ||
{ | ||
files: ["*.ts", "*.js", "*.tsx", "*.jsx"], | ||
extends: ["biome"], | ||
}, | ||
], | ||
env: { | ||
browser: true, | ||
node: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,122 @@ | ||
{ | ||
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", | ||
"tagDefinitions": [ | ||
{ | ||
"tagName": "@contract", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@wallet", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@extension", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@rpc", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@transaction", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@connectWallet", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@theme", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@locale", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@component", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@walletConfig", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@walletConnection", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@walletUtils", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@buyCrypto", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@storage", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@auth", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@utils", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@chain", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@modules", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@social", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@client", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@nft", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@account", | ||
"syntaxKind": "block" | ||
} | ||
], | ||
"supportForTags": { | ||
"@contract": true, | ||
"@wallet": true, | ||
"@extension": true, | ||
"@rpc": true, | ||
"@transaction": true, | ||
"@connectWallet": true, | ||
"@theme": true, | ||
"@locale": true, | ||
"@component": true, | ||
"@walletConfig": true, | ||
"@walletConnection": true, | ||
"@walletUtils": true, | ||
"@buyCrypto": true, | ||
"@storage": true, | ||
"@auth": true, | ||
"@utils": true, | ||
"@chain": true, | ||
"@modules": true, | ||
"@social": true, | ||
"@client": true, | ||
"@nft": true, | ||
"@account": true, | ||
"@beta": true | ||
} | ||
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json", | ||
"tagDefinitions": [ | ||
{ | ||
"tagName": "@example", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@contract", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@wallet", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@extension", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@rpc", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@transaction", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@connectWallet", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@theme", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@locale", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@component", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@walletConfig", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@walletConnection", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@walletUtils", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@buyCrypto", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@storage", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@auth", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@utils", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@chain", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@modules", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@social", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@client", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@nft", | ||
"syntaxKind": "block" | ||
}, | ||
{ | ||
"tagName": "@account", | ||
"syntaxKind": "block" | ||
} | ||
], | ||
"supportForTags": { | ||
"@contract": true, | ||
"@wallet": true, | ||
"@extension": true, | ||
"@rpc": true, | ||
"@transaction": true, | ||
"@connectWallet": true, | ||
"@theme": true, | ||
"@locale": true, | ||
"@component": true, | ||
"@walletConfig": true, | ||
"@walletConnection": true, | ||
"@walletUtils": true, | ||
"@buyCrypto": true, | ||
"@storage": true, | ||
"@auth": true, | ||
"@utils": true, | ||
"@chain": true, | ||
"@modules": true, | ||
"@social": true, | ||
"@client": true, | ||
"@nft": true, | ||
"@account": true, | ||
"@beta": true | ||
} | ||
} |
Oops, something went wrong.