Skip to content

Commit

Permalink
fix lint errors manually
Browse files Browse the repository at this point in the history
  • Loading branch information
joeizang committed Oct 20, 2023
1 parent 3ee974d commit 7487a5a
Show file tree
Hide file tree
Showing 271 changed files with 3,811 additions and 3,800 deletions.
10 changes: 3 additions & 7 deletions apps/circuit-compiler/src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ import React, { useEffect } from 'react'
import { CircomPluginClient } from './services/circomPluginClient'

function App() {

useEffect(() => {
new CircomPluginClient()
}, [])

return (
<div className="App">
</div>
)

return <div className="App"></div>
}

export default App
export default App
5 changes: 1 addition & 4 deletions apps/circuit-compiler/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ import React from 'react'
import ReactDOM from 'react-dom'
import App from './app/app'

ReactDOM.render(
<App />,
document.getElementById('root')
)
ReactDOM.render(<App />, document.getElementById('root'))
52 changes: 25 additions & 27 deletions apps/circuit-compiler/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { composePlugins, withNx } = require('@nrwl/webpack')
const webpack = require('webpack')
const TerserPlugin = require("terser-webpack-plugin")
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin")
const TerserPlugin = require('terser-webpack-plugin')
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')

// Nx plugins for webpack.
module.exports = composePlugins(withNx(), (config) => {
Expand All @@ -10,25 +10,24 @@ module.exports = composePlugins(withNx(), (config) => {
// add fallback for node modules
config.resolve.fallback = {
...config.resolve.fallback,
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
"path": require.resolve("path-browserify"),
"http": require.resolve("stream-http"),
"https": require.resolve("https-browserify"),
"constants": require.resolve("constants-browserify"),
"os": false, //require.resolve("os-browserify/browser"),
"timers": false, // require.resolve("timers-browserify"),
"zlib": require.resolve("browserify-zlib"),
"fs": false,
"module": false,
"tls": false,
"net": false,
"readline": false,
"child_process": false,
"buffer": require.resolve("buffer/"),
"vm": require.resolve('vm-browserify'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
path: require.resolve('path-browserify'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
constants: require.resolve('constants-browserify'),
os: false, //require.resolve("os-browserify/browser"),
timers: false, // require.resolve("timers-browserify"),
zlib: require.resolve('browserify-zlib'),
fs: false,
module: false,
tls: false,
net: false,
readline: false,
child_process: false,
buffer: require.resolve('buffer/'),
vm: require.resolve('vm-browserify'),
}


// add externals
config.externals = {
Expand Down Expand Up @@ -58,13 +57,12 @@ module.exports = composePlugins(withNx(), (config) => {
// souce-map loader
config.module.rules.push({
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre"
use: ['source-map-loader'],
enforce: 'pre',
})

config.ignoreWarnings = [/Failed to parse source map/] // ignore source-map-loader warnings


// set minimizer
config.optimization.minimizer = [
new TerserPlugin({
Expand All @@ -80,13 +78,13 @@ module.exports = composePlugins(withNx(), (config) => {
extractComments: false,
}),
new CssMinimizerPlugin(),
];
]

config.watchOptions = {
ignored: /node_modules/
ignored: /node_modules/,
}

config.experiments.syncWebAssembly = true

return config;
});
return config
})
6 changes: 3 additions & 3 deletions apps/debugger/src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, {useState, useEffect} from 'react'
import React, { useState, useEffect } from 'react'

import {DebuggerUI} from '@remix-ui/debugger-ui' // eslint-disable-line
import { DebuggerUI } from '@remix-ui/debugger-ui' // eslint-disable-line

import {DebuggerClientApi} from './debugger'
import { DebuggerClientApi } from './debugger'

const remix = new DebuggerClientApi()

Expand Down
20 changes: 10 additions & 10 deletions apps/debugger/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {composePlugins, withNx} = require('@nrwl/webpack')
const { composePlugins, withNx } = require('@nrwl/webpack')
const webpack = require('webpack')
const TerserPlugin = require('terser-webpack-plugin')
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
Expand Down Expand Up @@ -27,13 +27,13 @@ module.exports = composePlugins(withNx(), (config) => {
readline: false,
child_process: false,
buffer: require.resolve('buffer/'),
vm: require.resolve('vm-browserify')
vm: require.resolve('vm-browserify'),
}

// add externals
config.externals = {
...config.externals,
solc: 'solc'
solc: 'solc',
}

// add public path
Expand All @@ -44,15 +44,15 @@ module.exports = composePlugins(withNx(), (config) => {
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
url: ['url', 'URL'],
process: 'process/browser'
process: 'process/browser',
})
)

// souce-map loader
config.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],
enforce: 'pre'
enforce: 'pre',
})

config.ignoreWarnings = [/Failed to parse source map/] // ignore source-map-loader warnings
Expand All @@ -66,16 +66,16 @@ module.exports = composePlugins(withNx(), (config) => {
compress: false,
mangle: false,
format: {
comments: false
}
comments: false,
},
},
extractComments: false
extractComments: false,
}),
new CssMinimizerPlugin()
new CssMinimizerPlugin(),
]

config.watchOptions = {
ignored: /node_modules/
ignored: /node_modules/,
}

return config
Expand Down
4 changes: 2 additions & 2 deletions apps/doc-viewer/src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useEffect, useState} from 'react'
import {DocViewer} from './docviewer'
import React, { useEffect, useState } from 'react'
import { DocViewer } from './docviewer'
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'

Expand Down
18 changes: 9 additions & 9 deletions apps/doc-viewer/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const {composePlugins, withNx} = require('@nrwl/webpack')
const {withReact} = require('@nrwl/react')
const { composePlugins, withNx } = require('@nrwl/webpack')
const { withReact } = require('@nrwl/react')
const webpack = require('webpack')
const TerserPlugin = require('terser-webpack-plugin')
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
Expand All @@ -12,7 +12,7 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
// add externals
config.externals = {
...config.externals,
solc: 'solc'
solc: 'solc',
}

// add public path
Expand All @@ -23,7 +23,7 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
url: ['url', 'URL'],
process: 'process/browser'
process: 'process/browser',
}),
new webpack.DefinePlugin({})
)
Expand All @@ -32,7 +32,7 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
config.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],
enforce: 'pre'
enforce: 'pre',
})

config.ignoreWarnings = [/Failed to parse source map/] // ignore source-map-loader warnings
Expand All @@ -46,12 +46,12 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
compress: false,
mangle: false,
format: {
comments: false
}
comments: false,
},
},
extractComments: false
extractComments: false,
}),
new CssMinimizerPlugin()
new CssMinimizerPlugin(),
]

return config
Expand Down
6 changes: 3 additions & 3 deletions apps/etherscan/src/app/AppContext.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import {PluginClient} from '@remixproject/plugin'
import { PluginClient } from '@remixproject/plugin'

import {Receipt, ThemeType} from './types'
import { Receipt, ThemeType } from './types'

export const AppContext = React.createContext({
apiKey: '',
Expand All @@ -20,5 +20,5 @@ export const AppContext = React.createContext({
themeType: 'dark' as ThemeType,
setThemeType: (themeType: ThemeType) => {
console.log('Calling Set Theme Type')
}
},
})
12 changes: 6 additions & 6 deletions apps/etherscan/src/app/RemixPlugin.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {PluginClient} from '@remixproject/plugin'
import {verify, EtherScanReturn} from './utils/verify'
import {getReceiptStatus, getEtherScanApi, getNetworkName, getProxyContractReceiptStatus} from './utils'
import { PluginClient } from '@remixproject/plugin'
import { verify, EtherScanReturn } from './utils/verify'
import { getReceiptStatus, getEtherScanApi, getNetworkName, getProxyContractReceiptStatus } from './utils'

export class RemixClient extends PluginClient {
loaded() {
Expand Down Expand Up @@ -35,7 +35,7 @@ export class RemixClient extends PluginClient {

async receiptStatus(receiptGuid: string, apiKey: string, isProxyContract: boolean) {
try {
const {network, networkId} = await getNetworkName(this)
const { network, networkId } = await getNetworkName(this)
if (network === 'vm') {
throw new Error('Cannot check the receipt status in the selected network')
}
Expand All @@ -46,13 +46,13 @@ export class RemixClient extends PluginClient {
else receiptStatus = await getReceiptStatus(receiptGuid, apiKey, etherscanApi)
return {
message: receiptStatus.result,
succeed: receiptStatus.status === '0' ? false : true
succeed: receiptStatus.status === '0' ? false : true,
}
} catch (e: any) {
return {
status: 'error',
message: e.message,
succeed: false
succeed: false,
}
}
}
Expand Down
24 changes: 12 additions & 12 deletions apps/etherscan/src/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React, {useState, useEffect, useRef} from 'react'
import React, { useState, useEffect, useRef } from 'react'

import {CompilationFileSources, CompilationResult} from '@remixproject/plugin-api'
import { CompilationFileSources, CompilationResult } from '@remixproject/plugin-api'

import {RemixClient} from './RemixPlugin'
import {createClient} from '@remixproject/plugin-webview'
import { RemixClient } from './RemixPlugin'
import { createClient } from '@remixproject/plugin-webview'

import {AppContext} from './AppContext'
import {DisplayRoutes} from './routes'
import { AppContext } from './AppContext'
import { DisplayRoutes } from './routes'

import {useLocalStorage} from './hooks/useLocalStorage'
import { useLocalStorage } from './hooks/useLocalStorage'

import {getReceiptStatus, getEtherScanApi, getNetworkName, getProxyContractReceiptStatus} from './utils'
import {Receipt, ThemeType} from './types'
import { getReceiptStatus, getEtherScanApi, getNetworkName, getProxyContractReceiptStatus } from './utils'
import { Receipt, ThemeType } from './types'

import './App.css'

Expand Down Expand Up @@ -77,7 +77,7 @@ const App = () => {
timer.current = null
}
timer.current = setInterval(async () => {
const {network, networkId} = await getNetworkName(clientInstanceRef.current)
const { network, networkId } = await getNetworkName(clientInstanceRef.current)
if (!clientInstanceRef.current) {
return
}
Expand All @@ -101,7 +101,7 @@ const App = () => {
if (currentReceipt.guid === item.guid) {
const res = {
...currentReceipt,
status: status.result
status: status.result,
}
if (currentReceipt.isProxyContract) res.message = status.message
return res
Expand Down Expand Up @@ -133,7 +133,7 @@ const App = () => {
contracts,
setContracts,
themeType,
setThemeType
setThemeType,
}}
>
<DisplayRoutes />
Expand Down
Loading

0 comments on commit 7487a5a

Please sign in to comment.