Skip to content
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
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
.next
node_modules
*.test.js
test-utils
36 changes: 11 additions & 25 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
module.exports = {
env: {
browser: true,
es6: true,
jest: true
},
extends: [
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'airbnb',
'next/core-web-vitals',
'prettier',
'prettier/react'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: 'module',
allowImportExportEverywhere: false
},
plugins: ['prettier', 'react', 'jsx-a11y', 'react-hooks'],
plugins: ['prettier'],
parser: '@typescript-eslint/parser',
rules: {
'prettier/prettier': 'error',
'react/react-in-jsx-scope': 0,
Expand All @@ -49,6 +28,13 @@ module.exports = {
'jsx-a11y/anchor-is-valid': 0,
'no-shadow': 0,
camelcase: 0,
'import/no-named-as-default': 0
'import/no-named-as-default': 0,
'import/no-anonymous-default-export': 0,
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_'
}
]
}
}
2 changes: 2 additions & 0 deletions components/Msig/AddRmSigners/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,7 @@ exports[`Multisig add & remove flow Adding a signer snapshots it renders step 2
class="c32"
display="inline-block"
height="6"
name=""
placeholder="f1..."
value=""
width="100%"
Expand Down Expand Up @@ -2434,6 +2435,7 @@ exports[`Multisig add & remove flow Adding a signer snapshots it renders step 3
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t0100"
width="100%"
Expand Down
4 changes: 2 additions & 2 deletions components/Msig/AddRmSigners/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ describe('Multisig add & remove flow', () => {
})

test('it allows the user to set the max transaction fee', async () => {
const { Tree, store, walletProvider } = composeMockAppTree('postOnboard')
const { Tree, store } = composeMockAppTree('postOnboard')
const msigAddress = 't034066'
const msigBalance = new FilecoinNumber('1', 'fil')

Expand Down Expand Up @@ -416,7 +416,7 @@ describe('Multisig add & remove flow', () => {
})

test('it allows the user to save the max transaction fee', async () => {
const { Tree, store, walletProvider } = composeMockAppTree('postOnboard')
const { Tree, store } = composeMockAppTree('postOnboard')
const msigAddress = 't034066'
const msigBalance = new FilecoinNumber('1', 'fil')

Expand Down
4 changes: 2 additions & 2 deletions components/Msig/ChangeOwner/Preface.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ const Preface = () => {
/>
</Box>
)
};
}

export default Preface;
export default Preface
2 changes: 2 additions & 0 deletions components/Msig/ChangeOwner/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,7 @@ exports[`Change owner flow snapshots it renders step 2 correctly 1`] = `
class="c32"
display="inline-block"
height="6"
name=""
placeholder="f1..."
value=""
width="100%"
Expand Down Expand Up @@ -2449,6 +2450,7 @@ exports[`Change owner flow snapshots it renders step 3 correctly 1`] = `
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t0100"
width="100%"
Expand Down
7 changes: 7 additions & 0 deletions components/Msig/Create/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,7 @@ exports[`Create msig flow Creating multisig snapshots it renders multiple signer
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t1z225tguggx4onbauimqvxzutopzdr2m4s6z6wgi"
width="100%"
Expand Down Expand Up @@ -1027,6 +1028,7 @@ exports[`Create msig flow Creating multisig snapshots it renders multiple signer
class="c36"
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t0100"
width="100%"
Expand Down Expand Up @@ -2027,6 +2029,7 @@ exports[`Create msig flow Creating multisig snapshots it renders step 1 correctl
class="c34"
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t1z225tguggx4onbauimqvxzutopzdr2m4s6z6wgi"
width="100%"
Expand Down Expand Up @@ -3129,6 +3132,7 @@ exports[`Create msig flow Creating multisig snapshots it renders step 2 correctl
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t1z225tguggx4onbauimqvxzutopzdr2m4s6z6wgi"
width="100%"
Expand Down Expand Up @@ -4373,6 +4377,7 @@ exports[`Create msig flow Creating multisig snapshots it renders step 3 correctl
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t1z225tguggx4onbauimqvxzutopzdr2m4s6z6wgi"
width="100%"
Expand Down Expand Up @@ -5699,6 +5704,7 @@ exports[`Create msig flow Creating multisig snapshots it renders step 4 correctl
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t1z225tguggx4onbauimqvxzutopzdr2m4s6z6wgi"
width="100%"
Expand Down Expand Up @@ -7191,6 +7197,7 @@ exports[`Create msig flow Creating multisig snapshots it renders step 5 correctl
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t1z225tguggx4onbauimqvxzutopzdr2m4s6z6wgi"
width="100%"
Expand Down
6 changes: 6 additions & 0 deletions components/Msig/Withdraw/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,7 @@ exports[`Multisig withdraw flow Withdrawing FIL it restricts a user from continu
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t0100"
width="100%"
Expand Down Expand Up @@ -2647,6 +2648,7 @@ exports[`Multisig withdraw flow Withdrawing FIL it restricts a user from continu
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t0100"
width="100%"
Expand Down Expand Up @@ -3738,6 +3740,7 @@ exports[`Multisig withdraw flow snapshots it renders correctly 1`] = `
class="c35"
display="inline-block"
height="6"
name=""
placeholder="f1..."
value=""
width="100%"
Expand Down Expand Up @@ -4836,6 +4839,7 @@ exports[`Multisig withdraw flow snapshots it renders step 2 correctly 1`] = `
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t0100"
width="100%"
Expand Down Expand Up @@ -6208,6 +6212,7 @@ exports[`Multisig withdraw flow snapshots it renders step 3 correctly 1`] = `
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t0100"
width="100%"
Expand Down Expand Up @@ -7719,6 +7724,7 @@ exports[`Multisig withdraw flow snapshots it renders step 4 correctly 1`] = `
disabled=""
display="inline-block"
height="6"
name=""
placeholder="f1..."
value="t0100"
width="100%"
Expand Down
6 changes: 1 addition & 5 deletions components/Onboarding/Choose/Import.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ const Import = ({
glyphAcronym,
glyphColor,
title,
description,
Icon,
tag,
...props
}) => (
<>
Expand Down Expand Up @@ -58,9 +56,7 @@ Import.propTypes = {
glyphAcronym: PropTypes.string,
glyphColor: PropTypes.string,
Icon: PropTypes.object,
title: PropTypes.string.isRequired,
description: PropTypes.string,
tag: PropTypes.string
title: PropTypes.string.isRequired
}

export default Import
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ exports[`Import seed phrase configuration it renders correctly 1`] = `
class="c18"
display="inline-block"
height="6"
name=""
placeholder="Your seed phrase"
type="password"
value=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ exports[`Import private key configuration it renders correctly 1`] = `
class="c16"
display="inline-block"
height="6"
name=""
placeholder="Your private key"
type="password"
value=""
Expand Down
8 changes: 6 additions & 2 deletions components/Onboarding/Configure/Ledger/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ describe('Ledger configuration', () => {

test('it pushes to the right url', async () => {
const { Tree } = composeMockAppTree('preOnboard')
const { container } = render(
const {
/* container */
} = render(
<Tree>
<Step2 msig={false} setStep={() => {}} />
</Tree>
Expand All @@ -305,7 +307,9 @@ describe('Ledger configuration', () => {

test('it pushes to the right url for msig', async () => {
const { Tree } = composeMockAppTree('preOnboard')
const { container } = render(
const {
/*container*/
} = render(
<Tree>
<Step2 msig={true} setStep={() => {}} />
</Tree>
Expand Down
2 changes: 1 addition & 1 deletion components/Shared/Button/index.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cleanup, render, screen, act, fireEvent } from '@testing-library/react'
import { cleanup, render, act, fireEvent } from '@testing-library/react'
import Button from '.'
import composeMockAppTree from '../../../test-utils/composeMockAppTree'
import theme from '../theme'
Expand Down
2 changes: 1 addition & 1 deletion components/Shared/Error/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('Error', () => {

test.skip('clicking "Back" takes you back to onboarding', () => {
const useRouter = jest.spyOn(require('next/router'), 'useRouter')
const mockRouterReplace = jest.fn(() => { })
const mockRouterReplace = jest.fn(() => {})
useRouter.mockImplementationOnce(() => ({
replace: mockRouterReplace,
query: 'network=t'
Expand Down
2 changes: 1 addition & 1 deletion components/Shared/Glyph/index.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cleanup, render, act, fireEvent } from '@testing-library/react'
import { cleanup, render } from '@testing-library/react'
import composeMockAppTree from '../../../test-utils/composeMockAppTree'
import Glyph from '.'
import theme from '../theme'
Expand Down
18 changes: 5 additions & 13 deletions components/Shared/Input/Address.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@ import React, { forwardRef } from 'react'
import { func, string, bool } from 'prop-types'
import TextInput from './Text'

const Address = forwardRef(
({ value, label, error, setError, ...props }, ref) => {
return (
<TextInput
ref={ref}
label={label}
value={value}
error={error}
{...props}
/>
)
}
)
const Address = forwardRef(({ value, label, error, ...props }, ref) => {
return (
<TextInput ref={ref} label={label} value={value} error={error} {...props} />
)
})

Address.propTypes = {
onChange: func,
Expand Down
6 changes: 2 additions & 4 deletions components/Shared/Input/Funds.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,8 @@ describe('Funds input', () => {
const { Tree } = composeMockAppTree('postOnboard')
const value = new FilecoinNumber('0', 'fil')
const balance = new FilecoinNumber('2', 'fil')
let res
await act(async () => {
res = render(
render(
<Tree>
<Funds
name='amount'
Expand Down Expand Up @@ -245,9 +244,8 @@ describe('Funds input', () => {
const { Tree } = composeMockAppTree('postOnboard')
const value = new FilecoinNumber('0', 'fil')
const balance = new FilecoinNumber('2', 'fil')
let res
await act(async () => {
res = render(
render(
<Tree>
<Funds
name='amount'
Expand Down
2 changes: 1 addition & 1 deletion components/Shared/Input/Text.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import InputWrapper from './InputWrapper'
import { DenomTag } from './Number'

const TextInput = React.forwardRef(
({ denom, label, error, disabled, name, ...props }, ref) => (
({ denom, label, error, disabled, ...props }, ref) => (
<>
<InputWrapper>
<Box display='flex' alignItems='center'>
Expand Down
2 changes: 1 addition & 1 deletion components/Shared/Link/index.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cleanup, render, screen, act, fireEvent } from '@testing-library/react'
import { cleanup, render } from '@testing-library/react'
import { StyledATag } from '.'
import composeMockAppTree from '../../../test-utils/composeMockAppTree'

Expand Down
10 changes: 6 additions & 4 deletions components/Shared/LoaderGlyph/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ const LoaderGlyphChild = styled.span`
animation-iteration-count: infinite;
`

const Index = () => <LoaderGlyphParent>
<LoaderGlyphChild />
</LoaderGlyphParent>;
const Index = () => (
<LoaderGlyphParent>
<LoaderGlyphChild />
</LoaderGlyphParent>
)

export default Index;
export default Index
Loading