Skip to content
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

Set compilerOptions.jsx = "react" #34

Merged
merged 2 commits into from
Mar 20, 2023
Merged
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeEvent, FC } from 'react';
import React, { ChangeEvent, FC } from 'react';
import { Checkbox, CheckboxProps, Link } from '@reef-knot/ui-react';
import { TermsStyle, TermsTextStyle } from './styles';
import { Metrics } from '../WalletsModal';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactElement } from 'react';
import React, { ReactElement } from 'react';

const LidoModalLogo = (): ReactElement => {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useState } from 'react';
import React, { useCallback, useState } from 'react';
import { Modal } from '@reef-knot/ui-react';
import {
WalletsModalProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnect, useDisconnect } from 'wagmi';
import { ConnectButton } from '../components';
import { capitalize } from '../helpers';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback, useEffect } from 'react';
import React, { FC, useCallback, useEffect } from 'react';
import WalletConnectProvider from '@walletconnect/ethereum-provider';
import { Ambire } from '@reef-knot/wallets-icons/react';
import { useConnect, useDisconnect } from 'wagmi';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import {
Blockchaincom,
BlockchaincomInversion,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorBraveWallet, helpers } from '@reef-knot/web3-react';
import { Brave as WalletIcon } from '@reef-knot/wallets-icons/react';
import { CONFLICTS } from '../constants/conflictChecks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorCoin98 } from '@reef-knot/web3-react';
import { Coin98 } from '@reef-knot/wallets-icons/react';
import { CONFLICTS } from '../constants/conflictChecks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorCoinbase } from '@reef-knot/web3-react';
import { Coinbase } from '@reef-knot/wallets-icons/react';
import { ConnectWalletProps } from './types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorExodus, helpers } from '@reef-knot/web3-react';
import { Link } from '@reef-knot/ui-react';
import { Exodus as WalletIcon } from '@reef-knot/wallets-icons/react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorGamestop, helpers } from '@reef-knot/web3-react';
import { Gamestop as WalletIcon } from '@reef-knot/wallets-icons/react';
import { CONFLICTS } from '../constants/conflictChecks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorImToken } from '@reef-knot/web3-react';
import { ImToken as WalletIcon } from '@reef-knot/wallets-icons/react';
import { ConnectWalletProps } from './types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorLedger } from '@reef-knot/web3-react';
import { Ledger, LedgerInversion } from '@reef-knot/wallets-icons/react';
import { ConnectWalletProps } from './types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import {
MathWallet,
MathWalletInversion,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorMetamask } from '@reef-knot/web3-react';
import {
MetaMaskCircle,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorOperaWallet } from '@reef-knot/web3-react';
import { OperaWallet as WalletIcon } from '@reef-knot/wallets-icons/react';
import { ConnectWalletProps } from './types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorTally } from '@reef-knot/web3-react';
import { Tally } from '@reef-knot/wallets-icons/react';
import { ConnectWalletProps } from './types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorTrust } from '@reef-knot/web3-react';
import { Trust as WalletIcon } from '@reef-knot/wallets-icons/react';
import { ConnectWalletProps } from './types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { WalletConnect } from '@reef-knot/wallets-icons/react';
import { useConnect, useDisconnect } from 'wagmi';
import { RKConnectorWalletConnect } from '@reef-knot/core-react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback } from 'react';
import React, { FC, useCallback } from 'react';
import { useConnectorXdefi } from '@reef-knot/web3-react';
import { XDEFI as WalletIcon } from '@reef-knot/wallets-icons/react';
import { CONFLICTS } from '../constants/conflictChecks';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback, useEffect } from 'react';
import React, { FC, useCallback, useEffect } from 'react';
import { ZenGo as WalletIcon } from '@reef-knot/wallets-icons/react';
import WalletConnectProvider from '@walletconnect/ethereum-provider';
import { useConnect, useDisconnect } from 'wagmi';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback, useEffect } from 'react';
import React, { FC, useCallback, useEffect } from 'react';
import { Zerion as WalletIcon } from '@reef-knot/wallets-icons/react';
import WalletConnectProvider from '@walletconnect/ethereum-provider';
import { useConnect, useDisconnect } from 'wagmi';
Expand Down
16 changes: 15 additions & 1 deletion packages/tsconfig/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# `tsconfig`
# tsconfig

These are base shared `tsconfig.json`s from which all other `tsconfig.json`'s inherit from.

## Notes

### `react-library.json`
#### react-jsx
The legacy `react` option instead of `react-jsx` is being used
for the `compilerOptions.jsx` field.

_Reason:_
reef-knot supports react v17 at the moment of writing.
It has an issue with ESM because it has no `exports`
field in the `package.json`. It is fixed in react v18, and we
can switch to `react-jsx` option after migrating to react v18.
More info: https://github.com/facebook/react/issues/20235
2 changes: 1 addition & 1 deletion packages/tsconfig/react-library.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"compilerOptions": {
"target": "ES6",
"module": "ES2020",
"jsx": "react-jsx",
"jsx": "react",
"lib": ["dom", "dom.iterable", "esnext"],
"noImplicitReturns": true,
"noImplicitThis": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ForwardedRef, forwardRef } from 'react';
import React, { ForwardedRef, forwardRef } from 'react';
import { ButtonStyle, ButtonContentStyle } from './ButtonStyles';
import { ButtonProps } from './types';
import { useRipple } from './useRipple';
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/button/ButtonIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ForwardedRef, forwardRef } from 'react';
import React, { ForwardedRef, forwardRef } from 'react';
import {
ButtonWrapperStyle,
ButtonIconStyle,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ForwardedRef, forwardRef } from 'react';
import React, { ForwardedRef, forwardRef } from 'react';
import styled from '../../utils/styledWrapper.js';
import { CheckboxProps } from './types';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/link/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ForwardedRef, forwardRef } from 'react';
import React, { ForwardedRef, forwardRef } from 'react';
import { LinkStyle } from './LinkStyles';
import { LinkProps } from './types';

Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/modal/ModalExtra.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ForwardedRef, forwardRef } from 'react';
import React, { ForwardedRef, forwardRef } from 'react';

import { ModalExtraStyle } from './ModalExtraStyles';
import { ModalExtraProps } from './types';
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/src/components/modal/ModalOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ForwardedRef, forwardRef } from 'react';
import React, { ForwardedRef, forwardRef } from 'react';
import ReactDOM from 'react-dom';
import modalRoot from './modalRoot';
import { useMergeRefs, useEscape, useLockScroll } from '../../hooks';
Expand Down
1 change: 1 addition & 0 deletions packages/ui-react/src/components/modal/ModalStyles.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import styled, { css } from '../../utils/styledWrapper.js';
import { Close, ArrowBack } from '../../icons';
import { ButtonIcon } from '../button';
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-react/src/context/connectors.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContext, FC, memo, useMemo } from 'react';
import React, { createContext, FC, memo, useMemo } from 'react';
import { InjectedConnector } from '@web3-react/injected-connector';
import { WalletLinkConnector } from '@web3-react/walletlink-connector';
import { SafeAppConnector } from '@gnosis.pm/safe-apps-web3-react';
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-react/src/context/web3.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { memo, FC } from 'react';
import React, { memo, FC } from 'react';
import invariant from 'tiny-invariant';
import {
Web3Provider,
Expand Down