Skip to content
This repository was archived by the owner on Aug 30, 2022. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 35 additions & 8 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = {
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:prettier/recommended",
"plugin:react/recommended",
],
rules: {
// tsdoc
Expand All @@ -30,13 +31,20 @@ module.exports = {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-parameter-properties": "error",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "warn",
// import
"import/first": "error",
"import/newline-after-import": "error",
"import/no-cycle": "warn",
"import/no-cycle": "error",
"import/no-default-export": "off",
"import/no-useless-path-segments": "error",
// react
"react/forbid-dom-props": ["error", { forbid: ["className", "style"] }],
"react/no-children-prop": "off",
"react/prop-types": "off",
// react-hooks
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
// eslint
curly: "error",
eqeqeq: "error",
Expand All @@ -46,7 +54,8 @@ module.exports = {
{ beforeColon: false, afterColon: true, mode: "strict" },
],
"keyword-spacing": ["error", { before: true, after: true }],
"line-comment-position": "off",
"line-comment-position": "error",
"new-cap": "error",
"no-alert": "error",
"no-case-declarations": "off",

Expand Down Expand Up @@ -87,25 +96,34 @@ module.exports = {
"valid-typeof": "error",
semi: ["warn", "always"],
// Inclusive
"inclusive-language/use-inclusive-words": "off",
"inclusive-language/use-inclusive-words": "error",
// turn off deprecated things?
"react/react-in-jsx-scope": "off",
},
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
"import",
"inclusive-language",
"react",
"react-hooks",
"eslint-plugin-tsdoc",
],
parserOptions: {
// project: "./tsconfig.json",
// tsconfigRootDir: __dirname,
ecmaVersion: 2019,
ecmaFeatures: {
impliedStrict: true,
jsx: true,
},
warnOnUnsupportedTypeScriptVersion: true,
},
settings: {},
settings: {
react: {
createClass: "createReactClass",
pragma: "React",
version: "detect",
},
},
overrides: [
// enable rule specifically for TypeScript files
{
Expand All @@ -115,6 +133,16 @@ module.exports = {
},
},

// in test files, allow null assertions and anys and eslint is sometimes weird about the react-scope thing
{
files: ["*test.ts?(x)"],
rules: {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",

"react/display-name": "off",
},
},
// allow requires in non-transpiled JS files and logical key ordering in config files
{
files: [
Expand All @@ -138,6 +166,5 @@ module.exports = {
],
env: {
browser: true,
node: true,
},
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ temp/
.swc/
*.log
.DS_Store
<<<<<<< HEAD
=======
# jns shenanigans
>>>>>>> origin/main
old_src/
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<p align="center"><strong>Ultimate collection of React hooks for your web3 apps</strong></p>
<br />

> ## v2 upgrade is coming!
>
> upcoming v3 features are documented [here](./v3-upgrade.md)

## Installation

You can install this SDK with either `npm` or `yarn`:
Expand Down
10 changes: 10 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
presets: ["@babel/preset-typescript", "@babel/preset-react"],

overrides: [
{
include: ["./src"],
presets: [["@babel/preset-env", { targets: "defaults, not ie 11" }]],
},
],
};
4 changes: 2 additions & 2 deletions config/api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
*/
"mainEntryPointFilePath": "<projectFolder>/dist/index.d.ts",
"mainEntryPointFilePath": "<projectFolder>/dist/thirdweb-dev-react.cjs.d.ts",

/**
* A list of NPM package names whose exports should be treated as part of this package.
Expand All @@ -60,7 +60,7 @@
* This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been
* local files for library1.
*/
"bundledPackages": ["wagmi", "wagmi-core"],
"bundledPackages": [],

/**
* Determines how the TypeScript compiler engine will be invoked by API Extractor.
Expand Down
13 changes: 0 additions & 13 deletions docs/react.dappmetadata.description.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/react.dappmetadata.isdarkmode.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/react.dappmetadata.logourl.md

This file was deleted.

28 changes: 0 additions & 28 deletions docs/react.dappmetadata.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/react.dappmetadata.name.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/react.dappmetadata.url.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@thirdweb-dev/react](./react.md) &gt; [ThirdwebProviderProps](./react.thirdwebproviderprops.md) &gt; [queryClient](./react.thirdwebproviderprops.queryclient.md)
[Home](./index.md) &gt; [@thirdweb-dev/react](./react.md) &gt; [ExposedQueryOptions](./react.exposedqueryoptions.md)

## ThirdwebProviderProps.queryClient property
## ExposedQueryOptions type

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
>

The react-query client to use. (Defaults to a default client.)
Exposed options shared across all query hooks.

<b>Signature:</b>

```typescript
queryClient?: QueryClient;
export declare type ExposedQueryOptions = Pick<UseQueryOptions<any>, "refetchInterval">;
```
Loading