lint fixes for remix-ui

pull/4771/head
lianahus 7 months ago
parent 866e58c099
commit c8b3f2a8b6
  1. 4
      libs/remix-ui/editor/src/lib/providers/completion/completionGlobals.ts
  2. 4
      libs/remix-ui/editor/src/lib/providers/completionProvider.ts
  3. 2
      libs/remix-ui/editor/src/lib/providers/hoverProvider.ts
  4. 1
      libs/remix-ui/editor/src/lib/providers/inlineCompletionProvider.ts
  5. 2
      libs/remix-ui/editor/src/lib/remix-ui-editor.tsx
  6. 1
      libs/remix-ui/grid-view/src/lib/remix-ui-grid-cell.tsx
  7. 1
      libs/remix-ui/home-tab/src/lib/components/homeTabGetStarted.tsx
  8. 2
      libs/remix-ui/home-tab/src/lib/components/homeTablangOptions.tsx
  9. 1
      libs/remix-ui/run-tab/src/lib/actions/account.ts
  10. 1
      libs/remix-ui/run-tab/src/lib/actions/events.ts
  11. 3
      libs/remix-ui/search/src/lib/components/results/SearchHelper.ts
  12. 2
      libs/remix-ui/search/src/lib/types/index.ts
  13. 1
      libs/remix-ui/solidity-compile-details/src/lib/components/solidityCompile.tsx
  14. 1
      libs/remix-ui/solidity-compiler/src/lib/api/compiler-api.ts
  15. 2
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  16. 1
      libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx
  17. 1
      libs/remix-ui/solidity-compiler/src/lib/types/index.ts
  18. 2
      libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx
  19. 1
      libs/remix-ui/static-analyser/src/staticanalyser.d.ts
  20. 1
      libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx
  21. 1
      libs/remix-ui/vyper-compile-details/src/lib/vyper-compile-details.tsx
  22. 2
      libs/remix-ui/workspace/src/lib/components/electron-menu.tsx
  23. 1
      libs/remix-ui/workspace/src/lib/components/electron-workspace-name.tsx
  24. 4
      libs/remix-ui/workspace/src/lib/components/file-explorer.tsx
  25. 2
      libs/remix-ui/workspace/src/lib/components/flat-tree-drop.tsx
  26. 1
      libs/remix-ui/workspace/src/lib/contexts/index.ts
  27. 1
      libs/remix-ui/workspace/src/lib/providers/FileSystemProvider.tsx
  28. 1
      libs/remix-ui/workspace/src/lib/reducers/workspace.ts
  29. 2
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx
  30. 2
      libs/remix-ui/xterm/src/lib/components/remix-ui-xterminals.tsx
  31. 2
      libs/remix-ui/xterm/src/lib/components/xterm-fit-addOn.ts

@ -33,7 +33,6 @@ export function getBytesCompletionItems(range: monacoTypes.IRange, monaco): mona
] ]
} }
export function getBlockCompletionItems(range: monacoTypes.IRange, monaco): monacoTypes.languages.CompletionItem[] { export function getBlockCompletionItems(range: monacoTypes.IRange, monaco): monacoTypes.languages.CompletionItem[] {
return [ return [
{ {
@ -442,7 +441,6 @@ export function getAbiCompletionItems(range: monacoTypes.IRange, monaco): monaco
]; ];
} }
export function GetCompletionTypes(range: monacoTypes.IRange, monaco): monacoTypes.languages.CompletionItem[] { export function GetCompletionTypes(range: monacoTypes.IRange, monaco): monacoTypes.languages.CompletionItem[] {
const completionItems = []; const completionItems = [];
const types = ['address', 'string', 'bytes', 'byte', 'int', 'uint', 'bool', 'hash']; const types = ['address', 'string', 'bytes', 'byte', 'int', 'uint', 'bool', 'hash'];
@ -510,7 +508,6 @@ export function GetCompletionKeywords(range: monacoTypes.IRange, monaco): monaco
return completionItems; return completionItems;
} }
export function GeCompletionUnits(range: monacoTypes.IRange, monaco): monacoTypes.languages.CompletionItem[] { export function GeCompletionUnits(range: monacoTypes.IRange, monaco): monacoTypes.languages.CompletionItem[] {
const completionItems = []; const completionItems = [];
const etherUnits = ['wei', 'gwei', 'finney', 'szabo', 'ether']; const etherUnits = ['wei', 'gwei', 'finney', 'szabo', 'ether'];
@ -557,7 +554,6 @@ export function GetImports(range: monacoTypes.IRange
} }
})] })]
list = [...list, list = [...list,
...data.files ...data.files
.filter((item) => item.startsWith(word)) .filter((item) => item.startsWith(word))

@ -158,7 +158,6 @@ export class RemixCompletionProvider implements monacoTypes.languages.Completion
return variableDeclaration return variableDeclaration
} }
for (const node of Object.values(filteredNodes) as any[]) { for (const node of Object.values(filteredNodes) as any[]) {
if (!node.name) continue if (!node.name) continue
if (node.nodeType === 'VariableDeclaration') { if (node.nodeType === 'VariableDeclaration') {
@ -348,7 +347,6 @@ export class RemixCompletionProvider implements monacoTypes.languages.Completion
}) })
} }
for (const nodeOfScope of contractCompletions) { for (const nodeOfScope of contractCompletions) {
if (nodeOfScope.name === nameOfLastTypedExpression) { if (nodeOfScope.name === nameOfLastTypedExpression) {
if (nodeOfScope.typeName && nodeOfScope.typeName.nodeType === 'UserDefinedTypeName') { if (nodeOfScope.typeName && nodeOfScope.typeName.nodeType === 'UserDefinedTypeName') {
@ -373,8 +371,6 @@ export class RemixCompletionProvider implements monacoTypes.languages.Completion
} }
return { nodes, suggestions } return { nodes, suggestions }
} }

@ -46,7 +46,6 @@ export class RemixHoverProvider implements monacoTypes.languages.HoverProvider {
return await this.props.plugin.call('codeParser', 'getVariableDeclaration', node) return await this.props.plugin.call('codeParser', 'getVariableDeclaration', node)
} }
const getParamaters = async (node: any) => { const getParamaters = async (node: any) => {
return await this.props.plugin.call('codeParser', 'getFunctionParamaters', node) return await this.props.plugin.call('codeParser', 'getFunctionParamaters', node)
} }
@ -55,7 +54,6 @@ export class RemixHoverProvider implements monacoTypes.languages.HoverProvider {
return await this.props.plugin.call('codeParser', 'getFunctionReturnParameters', node) return await this.props.plugin.call('codeParser', 'getFunctionReturnParameters', node)
} }
const getOverrides = async (node: any) => { const getOverrides = async (node: any) => {
if (node.overrides) { if (node.overrides) {
const overrides = [] const overrides = []

@ -20,7 +20,6 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli
this.completionEnabled = true this.completionEnabled = true
} }
async provideInlineCompletions(model: monacoTypes.editor.ITextModel, position: monacoTypes.Position, context: monacoTypes.languages.InlineCompletionContext, token: monacoTypes.CancellationToken): Promise<monacoTypes.languages.InlineCompletions<monacoTypes.languages.InlineCompletion>> { async provideInlineCompletions(model: monacoTypes.editor.ITextModel, position: monacoTypes.Position, context: monacoTypes.languages.InlineCompletionContext, token: monacoTypes.CancellationToken): Promise<monacoTypes.languages.InlineCompletions<monacoTypes.languages.InlineCompletion>> {
if (context.selectedSuggestionInfo) { if (context.selectedSuggestionInfo) {
return; return;

@ -758,7 +758,6 @@ export const EditorUI = (props: EditorUIProps) => {
}, },
} }
const freeFunctionCondition = editor.createContextKey('freeFunctionCondition', false) const freeFunctionCondition = editor.createContextKey('freeFunctionCondition', false)
let freeFunctionAction let freeFunctionAction
const executeFreeFunctionAction = { const executeFreeFunctionAction = {
@ -824,7 +823,6 @@ export const EditorUI = (props: EditorUIProps) => {
return return
} }
const { nodesAtPosition } = await retrieveNodesAtPosition(props.editorAPI, props.plugin) const { nodesAtPosition } = await retrieveNodesAtPosition(props.editorAPI, props.plugin)
const freeFunctionNode = nodesAtPosition.find((node) => node.kind === 'freeFunction') const freeFunctionNode = nodesAtPosition.find((node) => node.kind === 'freeFunction')
if (freeFunctionNode) { if (freeFunctionNode) {

@ -4,7 +4,6 @@ import './remix-ui-grid-cell.css'
import FiltersContext from "./filtersContext" import FiltersContext from "./filtersContext"
import { CustomTooltip } from '@remix-ui/helper' import { CustomTooltip } from '@remix-ui/helper'
declare global { declare global {
interface Window { interface Window {
_paq: any _paq: any

@ -9,7 +9,6 @@ import 'react-multi-carousel/lib/styles.css'
import CustomNavButtons from './customNavButtons' import CustomNavButtons from './customNavButtons'
import { appPlatformTypes, platformContext } from '@remix-ui/app' import { appPlatformTypes, platformContext } from '@remix-ui/app'
declare global { declare global {
interface Window { interface Window {
_paq: any _paq: any

@ -3,8 +3,6 @@ import { Dropdown, DropdownButton } from 'react-bootstrap'
import DropdownItem from 'react-bootstrap/DropdownItem' import DropdownItem from 'react-bootstrap/DropdownItem'
import { localeLang } from './types/carouselTypes' import { localeLang } from './types/carouselTypes'
export function LanguageOptions({ plugin }: { plugin: any }) { export function LanguageOptions({ plugin }: { plugin: any }) {
const [langOptions, setLangOptions] = useState<string>() const [langOptions, setLangOptions] = useState<string>()

@ -86,7 +86,6 @@ export const createNewBlockchainAccount = async (plugin: RunTab, dispatch: React
) )
} }
export const signMessageWithAddress = (plugin: RunTab, dispatch: React.Dispatch<any>, account: string, message: string, modalContent: (hash: string, data: string) => JSX.Element, passphrase?: string) => { export const signMessageWithAddress = (plugin: RunTab, dispatch: React.Dispatch<any>, account: string, message: string, modalContent: (hash: string, data: string) => JSX.Element, passphrase?: string) => {
plugin.blockchain.signMessage(message, account, passphrase, (err, msgHash, signedData) => { plugin.blockchain.signMessage(message, account, passphrase, (err, msgHash, signedData) => {
if (err) { if (err) {

@ -170,7 +170,6 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch<any>) => {
dispatch(clearRecorderCount()) dispatch(clearRecorderCount())
}) })
setInterval(() => { setInterval(() => {
fillAccountsList(plugin, dispatch) fillAccountsList(plugin, dispatch)
updateInstanceBalance(plugin, dispatch) updateInstanceBalance(plugin, dispatch)

@ -2,7 +2,6 @@ import { EOL } from 'os'
import { SearchResultLineLine } from '../../types' import { SearchResultLineLine } from '../../types'
import { Registry } from '@remix-project/remix-lib' import { Registry } from '@remix-project/remix-lib'
export const getDirectory = async (dir: string, plugin: any) => { export const getDirectory = async (dir: string, plugin: any) => {
let result = [] let result = []
if (Registry.getInstance().get('platform').api.isDesktop()) { if (Registry.getInstance().get('platform').api.isDesktop()) {
@ -113,5 +112,3 @@ export const replaceTextInLine = (str: string, searchResultLine: SearchResultLin
}).join(getEOL(str)) }).join(getEOL(str))
} }

@ -92,8 +92,6 @@ export const SearchingInitialState: SearchState = {
run: false, run: false,
} }
export interface SearchInWorkspaceOptions { export interface SearchInWorkspaceOptions {
pattern: string pattern: string
path: string path: string

@ -6,7 +6,6 @@ import { TreeView, TreeViewItem } from '@remix-ui/tree-view'
import { useIntl } from 'react-intl' import { useIntl } from 'react-intl'
const _paq = (window._paq = window._paq || []) const _paq = (window._paq = window._paq || [])
export default function SolidityCompile({ contractProperties, selectedContract, help, insertValue, saveAs, plugin }: any) { export default function SolidityCompile({ contractProperties, selectedContract, help, insertValue, saveAs, plugin }: any) {
const intl = useIntl() const intl = useIntl()
const downloadFn = () => { const downloadFn = () => {

@ -290,7 +290,6 @@ export const CompilerApiMixin = (Base) => class extends Base {
}) })
this.call('compilerloader', 'getJsonBinData') this.call('compilerloader', 'getJsonBinData')
this.data.eventHandlers.onCompilationFinished = async (success, data, source, input, version) => { this.data.eventHandlers.onCompilationFinished = async (success, data, source, input, version) => {
this.compileErrors = data this.compileErrors = data
if (success) { if (success) {

@ -17,7 +17,6 @@ import './css/style.css'
import { CompilerDropdown } from './components/compiler-dropdown' import { CompilerDropdown } from './components/compiler-dropdown'
const defaultPath = 'compiler_config.json' const defaultPath = 'compiler_config.json'
declare global { declare global {
@ -160,7 +159,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
} }
}, [solJsonBinData]) }, [solJsonBinData])
useEffect(() => { useEffect(() => {
const currentFileName = api.currentFile const currentFileName = api.currentFile
currentFile(currentFileName) currentFile(currentFileName)

@ -181,7 +181,6 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
}) })
} }
const setConfigFilePath = (path: string) => { const setConfigFilePath = (path: string) => {
setState((prevState) => { setState((prevState) => {
return { ...prevState, configFilePath: path } return { ...prevState, configFilePath: path }

@ -24,7 +24,6 @@ export interface CompilerContainerProps {
solJsonBinData: iSolJsonBinData solJsonBinData: iSolJsonBinData
} }
export interface ContractSelectionProps { export interface ContractSelectionProps {
api: ICompilerApi, api: ICompilerApi,
compiledFileName: string, compiledFileName: string,

@ -11,8 +11,6 @@ import './css/style.css'
import { CustomTooltip } from '@remix-ui/helper' import { CustomTooltip } from '@remix-ui/helper'
import { appPlatformTypes, platformContext } from '@remix-ui/app' import { appPlatformTypes, platformContext } from '@remix-ui/app'
const _paq = ((window as any)._paq = (window as any)._paq || []) // eslint-disable-line @typescript-eslint/no-explicit-any const _paq = ((window as any)._paq = (window as any)._paq || []) // eslint-disable-line @typescript-eslint/no-explicit-any
interface TestObject { interface TestObject {

@ -94,7 +94,6 @@ type ErrorRendererOptions = {
} }
} }
type SlitherAnalysisResultType = { type SlitherAnalysisResultType = {
description: string, description: string,
title: string, title: string,

@ -84,7 +84,6 @@ const Icon = ({iconRecord, verticalIconPlugin, contextMenuAction, theme}: IconPr
} }
}, []) }, [])
const stylePC = iconRecord.active ? 'flex-start' : 'center' const stylePC = iconRecord.active ? 'flex-start' : 'center'
return ( return (
<> <>

@ -2,7 +2,6 @@ import React from 'react'
import VyperCompile from './vyperCompile' import VyperCompile from './vyperCompile'
import { ThemeKeys, ThemeObject } from '@microlink/react-json-view' import { ThemeKeys, ThemeObject } from '@microlink/react-json-view'
interface RemixUiVyperCompileDetailsProps { interface RemixUiVyperCompileDetailsProps {
payload: any payload: any
theme?: ThemeKeys | ThemeObject theme?: ThemeKeys | ThemeObject

@ -5,8 +5,6 @@ import { FormattedMessage } from "react-intl"
import '../css/electron-menu.css' import '../css/electron-menu.css'
import { CustomTooltip } from '@remix-ui/helper' import { CustomTooltip } from '@remix-ui/helper'
export const ElectronMenu = () => { export const ElectronMenu = () => {
const platform = useContext(platformContext) const platform = useContext(platformContext)
const global = useContext(FileSystemContext) const global = useContext(FileSystemContext)

@ -2,7 +2,6 @@ import { CustomTooltip } from "@remix-ui/helper"
import React from "react" import React from "react"
import path from 'path' import path from 'path'
interface ElectronWorkspaceNameProps { interface ElectronWorkspaceNameProps {
path: string path: string
plugin: any plugin: any

@ -42,8 +42,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
} }
}, [contextMenuItems]) }, [contextMenuItems])
useEffect(() => { useEffect(() => {
if (removedContextMenuItems) { if (removedContextMenuItems) {
removeMenuItems(removedContextMenuItems) removeMenuItems(removedContextMenuItems)
@ -358,8 +356,6 @@ export const FileExplorer = (props: FileExplorerProps) => {
} }
return ( return (
<div className="h-100 remixui_treeview" data-id="filePanelFileExplorerTree"> <div className="h-100 remixui_treeview" data-id="filePanelFileExplorerTree">
<div ref={treeRef} tabIndex={0} style={{ <div ref={treeRef} tabIndex={0} style={{

@ -19,7 +19,6 @@ export const FlatTreeDrop = (props: FlatTreeDropProps) => {
// folder to open // folder to open
const [folderToOpen, setFolderToOpen] = useState<string>() const [folderToOpen, setFolderToOpen] = useState<string>()
const onDragOver = async (e: SyntheticEvent) => { const onDragOver = async (e: SyntheticEvent) => {
e.preventDefault() e.preventDefault()
const target = await getEventTarget(e) const target = await getEventTarget(e)
@ -77,7 +76,6 @@ export const FlatTreeDrop = (props: FlatTreeDropProps) => {
} }
} }
return (<div return (<div
onDrop={onDrop} onDragOver={onDragOver} onDrop={onDrop} onDragOver={onDragOver}
className="d-flex h-100" className="d-flex h-100"

@ -53,4 +53,3 @@ export const FileSystemContext = createContext<{
dispatchUpdateGitSubmodules: () => Promise<void> dispatchUpdateGitSubmodules: () => Promise<void>
}>(null) }>(null)

@ -249,7 +249,6 @@ export const FileSystemProvider = (props: WorkspaceProps) => {
await removeRecentElectronFolder(path) await removeRecentElectronFolder(path)
} }
const dispatchUpdateGitSubmodules = async () => { const dispatchUpdateGitSubmodules = async () => {
await updateGitSubmodules() await updateGitSubmodules()
} }

@ -862,7 +862,6 @@ export const browserReducer = (state = browserInitialState, action: Actions) =>
} }
} }
case 'SET_ELECTRON_RECENT_FOLDERS': { case 'SET_ELECTRON_RECENT_FOLDERS': {
const payload: string[] = action.payload const payload: string[] = action.payload
return { return {

@ -17,7 +17,6 @@ import { appPlatformTypes, platformContext } from '@remix-ui/app'
import { ElectronMenu } from './components/electron-menu' import { ElectronMenu } from './components/electron-menu'
import { ElectronWorkspaceName } from './components/electron-workspace-name' import { ElectronWorkspaceName } from './components/electron-workspace-name'
const _paq = (window._paq = window._paq || []) const _paq = (window._paq = window._paq || [])
const canUpload = window.File || window.FileReader || window.FileList || window.Blob const canUpload = window.File || window.FileReader || window.FileList || window.Blob
@ -796,7 +795,6 @@ export function Workspace() {
{intl.formatMessage({ id: 'filePanel.uniswapV4HookBookMultiSigSwapHook' })} {intl.formatMessage({ id: 'filePanel.uniswapV4HookBookMultiSigSwapHook' })}
</option> </option>
</optgroup> </optgroup>
</select> </select>
<div id="ozcustomization" data-id="ozCustomization" ref={displayOzCustomRef} style={{ display: 'none' }} className="mb-2"> <div id="ozcustomization" data-id="ozCustomization" ref={displayOzCustomRef} style={{ display: 'none' }} className="mb-2">

@ -38,7 +38,6 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
dispatchXterm({ type: 'ADD_TERMINAL', payload: { pid, queue: '', timeStamp: Date.now(), ref: null, hidden: false } }) dispatchXterm({ type: 'ADD_TERMINAL', payload: { pid, queue: '', timeStamp: Date.now(), ref: null, hidden: false } })
}) })
plugin.on('fs', 'workingDirChanged', (path: string) => { plugin.on('fs', 'workingDirChanged', (path: string) => {
dispatchXterm({ type: 'SET_WORKING_DIR', payload: path }) dispatchXterm({ type: 'SET_WORKING_DIR', payload: path })
dispatchXterm({ type: 'ENABLE_TERMINALS', payload: null }) dispatchXterm({ type: 'ENABLE_TERMINALS', payload: null })
@ -87,7 +86,6 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
}) })
} }
const writeToTerminal = (data: string, pid: number) => { const writeToTerminal = (data: string, pid: number) => {
setTerminals(prevState => { setTerminals(prevState => {
const terminal = prevState.find(xtermState => xtermState.pid === pid) const terminal = prevState.find(xtermState => xtermState.pid === pid)

@ -5,7 +5,6 @@
import { Terminal, ITerminalAddon } from 'xterm'; import { Terminal, ITerminalAddon } from 'xterm';
interface ITerminalDimensions { interface ITerminalDimensions {
/** /**
* The number of rows in the terminal. * The number of rows in the terminal.
@ -68,7 +67,6 @@ export class FitAddon implements ITerminalAddon {
const scrollbarWidth = this._terminal.options.scrollback === 0 ? const scrollbarWidth = this._terminal.options.scrollback === 0 ?
0 : core.viewport.scrollBarWidth; 0 : core.viewport.scrollBarWidth;
const parentElementStyle = window.getComputedStyle(this._terminal.element.parentElement.parentElement); const parentElementStyle = window.getComputedStyle(this._terminal.element.parentElement.parentElement);
const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height')); const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'));
const parentElementWidth = Math.max(0, parseInt(parentElementStyle.getPropertyValue('width'))); const parentElementWidth = Math.max(0, parseInt(parentElementStyle.getPropertyValue('width')));

Loading…
Cancel
Save