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

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

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

@ -20,7 +20,6 @@ export class RemixInLineCompletionProvider implements monacoTypes.languages.Inli
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>> {
if (context.selectedSuggestionInfo) {
return;

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

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

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

@ -3,8 +3,6 @@ import { Dropdown, DropdownButton } from 'react-bootstrap'
import DropdownItem from 'react-bootstrap/DropdownItem'
import { localeLang } from './types/carouselTypes'
export function LanguageOptions({ plugin }: { plugin: any }) {
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) => {
plugin.blockchain.signMessage(message, account, passphrase, (err, msgHash, signedData) => {
if (err) {

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

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

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

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

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

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

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

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

@ -11,8 +11,6 @@ import './css/style.css'
import { CustomTooltip } from '@remix-ui/helper'
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
interface TestObject {

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

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

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

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

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

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

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

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

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

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

@ -17,7 +17,6 @@ import { appPlatformTypes, platformContext } from '@remix-ui/app'
import { ElectronMenu } from './components/electron-menu'
import { ElectronWorkspaceName } from './components/electron-workspace-name'
const _paq = (window._paq = window._paq || [])
const canUpload = window.File || window.FileReader || window.FileList || window.Blob
@ -796,7 +795,6 @@ export function Workspace() {
{intl.formatMessage({ id: 'filePanel.uniswapV4HookBookMultiSigSwapHook' })}
</option>
</optgroup>
</select>
<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 } })
})
plugin.on('fs', 'workingDirChanged', (path: string) => {
dispatchXterm({ type: 'SET_WORKING_DIR', payload: path })
dispatchXterm({ type: 'ENABLE_TERMINALS', payload: null })
@ -87,7 +86,6 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
})
}
const writeToTerminal = (data: string, pid: number) => {
setTerminals(prevState => {
const terminal = prevState.find(xtermState => xtermState.pid === pid)

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

Loading…
Cancel
Save