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
7 changes: 6 additions & 1 deletion packages/neuron-ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ module.exports = {
"react/jsx-filename-extension": [1, {
"extensions": [".ts", ".tsx"]
}],
"react/jsx-props-no-spreading": [0]
"react/jsx-props-no-spreading": [0],
"typescript-eslint/no-angle-bracket-type-assertion": [0],
"no-alert": [0],
"no-console": [2, {
"allow": ["info", "warn", "error", "group", "groupEnd"]
}]
}
}
8 changes: 5 additions & 3 deletions packages/neuron-ui/src/components/ErrorBoundary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ const handleError = (error: Error) => {
}

class ErrorBoundary extends Component<{ children: React.ReactChild }, { hasError: boolean }> {
/* eslint-disable react/state-in-constructor */
state = {
hasError: false,
constructor(props: { children: React.ReactChild }) {
super(props)
this.state = {
hasError: false,
}
}

static getDerivedStateFromError(error: Error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ export const controllerMethodWrapper = (controllerName: string) => (
}
const res = await callControllerMethod(controller)(realParams)
if (process.env.NODE_ENV === 'development' && window.localStorage.getItem('log-response')) {
/* eslint-disable no-console */
console.group(`${controllerName} controller`)
console.info(JSON.stringify(res, null, 2))
console.groupEnd()
/* eslint-enable no-console */
}

if (!res) {
Expand Down
2 changes: 0 additions & 2 deletions packages/neuron-ui/src/services/remote/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ export * from './wallets'
export * from './networks'
export * from './transactions'

/* eslint-disable no-alert */

export const getLocale = () => {
if (!window.remote) {
console.warn('remote is not supported')
Expand Down
2 changes: 0 additions & 2 deletions packages/neuron-ui/src/states/stateProvider/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ export const reducer = (
): State.AppWithNeuronWallet => {
const { app, wallet, settings, chain } = state
if (process.env.NODE_ENV === 'development' && window.localStorage.getItem('log-action')) {
/* eslint-disable no-console */
console.group(`type: ${type}`)
console.info(payload)
console.groupEnd()
/* eslint-enable no-console */
}
switch (type) {
// Actions of Neuron Wallet
Expand Down
3 changes: 0 additions & 3 deletions packages/neuron-ui/src/utils/formatters.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable no-redeclare */
/* global BigInt */

import { CapacityUnit } from './const'

const base = 10e9
Expand Down
2 changes: 0 additions & 2 deletions packages/neuron-ui/src/utils/validators.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { MAX_NETWORK_NAME_LENGTH } from 'utils/const'
/* eslint-disable no-redeclare */
/* global BigInt */
import { ckbCore } from 'services/chain'
import { MIN_PASSWORD_LENGTH, MAX_PASSWORD_LENGTH, MIN_AMOUNT, MAX_DECIMAL_DIGITS, ErrorCode } from './const'

Expand Down