diff --git a/libs/remix-analyzer/.eslintrc b/libs/remix-analyzer/.eslintrc index cc6cabcbcd..e27a064a6d 100644 --- a/libs/remix-analyzer/.eslintrc +++ b/libs/remix-analyzer/.eslintrc @@ -4,7 +4,8 @@ "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-unused-vars": "off", "no-unused-vars": "off", - "dot-notation": "off" + "dot-notation": "off", + "no-use-before-define": "off" }, "ignorePatterns": ["!**/*"] } diff --git a/libs/remix-astwalker/.eslintrc b/libs/remix-astwalker/.eslintrc index 592e8bc3e9..60e5336d5c 100644 --- a/libs/remix-astwalker/.eslintrc +++ b/libs/remix-astwalker/.eslintrc @@ -3,7 +3,8 @@ "rules": { "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/prefer-namespace-keyword": "off", - "no-unused-vars": "off" + "no-unused-vars": "off", + "no-use-before-define": "off" }, "ignorePatterns": ["!**/*"] } diff --git a/libs/remix-astwalker/src/astWalker.ts b/libs/remix-astwalker/src/astWalker.ts index d784a6f378..853ff647b5 100644 --- a/libs/remix-astwalker/src/astWalker.ts +++ b/libs/remix-astwalker/src/astWalker.ts @@ -39,6 +39,7 @@ export function isYulAstNode (node: Record): boolean { * in each case, if the event emits false it does not descend into children. * If no event for the current type, children are visited. */ +// eslint-disable-next-line no-redeclare export class AstWalker extends EventEmitter { manageCallback ( node: AstNode, diff --git a/libs/remix-astwalker/src/sourceMappings.ts b/libs/remix-astwalker/src/sourceMappings.ts index 275b90f394..1246eb387b 100644 --- a/libs/remix-astwalker/src/sourceMappings.ts +++ b/libs/remix-astwalker/src/sourceMappings.ts @@ -58,6 +58,7 @@ export function sourceLocationFromSrc (src: string): Location { * Routines for retrieving solc AST object(s) using some criteria, usually * includng "src' information. */ +// eslint-disable-next-line no-redeclare export class SourceMappings { readonly source: string; readonly lineBreaks: Array; diff --git a/libs/remix-lib/.eslintrc b/libs/remix-lib/.eslintrc index 6da901f7e1..6ee9d5e4a6 100644 --- a/libs/remix-lib/.eslintrc +++ b/libs/remix-lib/.eslintrc @@ -3,7 +3,8 @@ "rules": { "standard/no-callback-literal": "off", "no-unused-vars": "off", - "dot-notation": "off" + "dot-notation": "off", + "no-use-before-define": "off" }, "env": { "browser": true, diff --git a/libs/remix-solidity/.eslintrc b/libs/remix-solidity/.eslintrc index 35c51f7ae7..f57f93144e 100644 --- a/libs/remix-solidity/.eslintrc +++ b/libs/remix-solidity/.eslintrc @@ -2,7 +2,8 @@ "extends": "../../.eslintrc", "rules": { "dot-notation": "off", - "no-unused-vars": "off" + "no-unused-vars": "off", + "no-use-before-define": "off" }, "env": { "browser": true, diff --git a/libs/remix-tests/.eslintrc b/libs/remix-tests/.eslintrc index 35c51f7ae7..f57f93144e 100644 --- a/libs/remix-tests/.eslintrc +++ b/libs/remix-tests/.eslintrc @@ -2,7 +2,8 @@ "extends": "../../.eslintrc", "rules": { "dot-notation": "off", - "no-unused-vars": "off" + "no-unused-vars": "off", + "no-use-before-define": "off" }, "env": { "browser": true, diff --git a/libs/remix-tests/src/types.ts b/libs/remix-tests/src/types.ts index b0d4145dbf..fb52c56bae 100644 --- a/libs/remix-tests/src/types.ts +++ b/libs/remix-tests/src/types.ts @@ -58,13 +58,12 @@ export interface CompilerConfiguration { usingWorker?: boolean, runs: number } - export interface CompilationErrors { name: string, errors: Array, message: string } - +// eslint-disable-next-line no-redeclare export class CompilationErrors extends Error { constructor (errors: Array) { const mapError = errors.map((e) => { return e.formattedMessage || e.message }) diff --git a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts index 5fa07cb4e8..86476a195d 100644 --- a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts +++ b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts @@ -1,10 +1,6 @@ import type { CompilationResult, CompilationSource } from '@remix-project/remix-solidity-ts' // eslint-disable-line -export interface DebuggerUIProps { - debuggerAPI: IDebuggerApi -} - export interface LineColumnLocation { start: { line: number, column: number @@ -68,3 +64,7 @@ export interface IDebuggerApi { web3: () => any // returns an instance of web3.js showMessage (title: string, message: string): void } + +export interface DebuggerUIProps { + debuggerAPI: IDebuggerApi +} diff --git a/libs/remix-ui/debugger-ui/src/types/index.ts b/libs/remix-ui/debugger-ui/src/types/index.ts index 9d13aab883..ee5e02a85f 100644 --- a/libs/remix-ui/debugger-ui/src/types/index.ts +++ b/libs/remix-ui/debugger-ui/src/types/index.ts @@ -1,3 +1,5 @@ +/* eslint-disable no-undef */ + export interface ExtractData { children?: Array<{key: number | string, value: ExtractData}> self?: string | number, @@ -13,7 +15,7 @@ export interface ExtractData { } export type ExtractFunc = (json: any, parent?: any) => ExtractData - +export type FormatSelfFunc = (key: string | number, data: ExtractData) => JSX.Element export interface DropdownPanelProps { dropdownName: string, dropdownMessage?: string, @@ -32,5 +34,3 @@ export interface DropdownPanelProps { headStyle?: React.CSSProperties, hexHighlight?: boolean // highlight non zero value of hex value } - -export type FormatSelfFunc = (key: string | number, data: ExtractData) => JSX.Element diff --git a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx index 66d9886a48..a758a25e7e 100644 --- a/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx +++ b/libs/remix-ui/file-explorer/src/lib/file-explorer.tsx @@ -636,7 +636,7 @@ export const FileExplorer = (props: FileExplorerProps) => { return { ...prevState, focusModal: { ...state.focusModal, hide: true } } }) } - + // eslint-disable-next-line no-undef const modal = (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => { setState(prevState => { return { diff --git a/libs/remix-ui/file-explorer/src/lib/types/index.ts b/libs/remix-ui/file-explorer/src/lib/types/index.ts index c0c27b765f..69ca02db74 100644 --- a/libs/remix-ui/file-explorer/src/lib/types/index.ts +++ b/libs/remix-ui/file-explorer/src/lib/types/index.ts @@ -1,4 +1,5 @@ import { customAction } from '@remixproject/plugin-api/lib/file-system/file-panel' +export type MenuItems = action[] // eslint-disable-line no-use-before-define /* eslint-disable-next-line */ export interface FileExplorerProps { @@ -34,7 +35,6 @@ export interface FileExplorerMenuProps { export type action = { name: string, type: string[], path: string[], extension: string[], pattern: string[], id: string, multiselect: boolean, label: string } -export type MenuItems = action[] export interface FileExplorerContextMenuProps { actions: action[], createNewFile: (folder?: string) => void, diff --git a/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx b/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx index 2e43962fb3..6e5eb36723 100644 --- a/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx +++ b/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx @@ -4,6 +4,7 @@ import { ModalDialogProps } from './types' // eslint-disable-line import './remix-ui-modal-dialog.css' declare global { + // eslint-disable-next-line no-unused-vars interface Window { testmode: boolean; } } diff --git a/libs/remix-ui/modal-dialog/src/lib/types/index.ts b/libs/remix-ui/modal-dialog/src/lib/types/index.ts index ee2746e3d6..db848f299e 100644 --- a/libs/remix-ui/modal-dialog/src/lib/types/index.ts +++ b/libs/remix-ui/modal-dialog/src/lib/types/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ export interface ModalDialogProps { id?: string title?: string, diff --git a/libs/remix-ui/plugin-manager/src/lib/components/ActivePluginCard.tsx b/libs/remix-ui/plugin-manager/src/lib/components/ActivePluginCard.tsx index 59e4490f6e..593c6a2edd 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/ActivePluginCard.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/ActivePluginCard.tsx @@ -1,4 +1,4 @@ -// eslint-disable-next-line @typescript-eslint/no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-use-before-define import React from 'react' import '../remix-ui-plugin-manager.css' interface PluginCardProps { diff --git a/libs/remix-ui/plugin-manager/src/lib/components/ActivePluginCardContainer.tsx b/libs/remix-ui/plugin-manager/src/lib/components/ActivePluginCardContainer.tsx index f3fab13d10..4c8f3dc58c 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/ActivePluginCardContainer.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/ActivePluginCardContainer.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { Profile } from '@remixproject/plugin-utils' -import React from 'react' +import React from 'react' // eslint-disable-line no-use-before-define import { PluginManagerComponent } from '../../types' import ActivePluginCard from './ActivePluginCard' import ModuleHeading from './moduleHeading' diff --git a/libs/remix-ui/plugin-manager/src/lib/components/InactivePluginCard.tsx b/libs/remix-ui/plugin-manager/src/lib/components/InactivePluginCard.tsx index 07a416c840..8c4d72d20c 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/InactivePluginCard.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/InactivePluginCard.tsx @@ -1,5 +1,5 @@ import { Profile } from '@remixproject/plugin-utils' -// eslint-disable-next-line @typescript-eslint/no-unused-vars +// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-use-before-define import React from 'react' import '../remix-ui-plugin-manager.css' interface PluginCardProps { diff --git a/libs/remix-ui/plugin-manager/src/lib/components/InactivePluginCardContainer.tsx b/libs/remix-ui/plugin-manager/src/lib/components/InactivePluginCardContainer.tsx index c076f5b2b0..26ffee6476 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/InactivePluginCardContainer.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/InactivePluginCardContainer.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { Profile } from '@remixproject/plugin-utils' -import React from 'react' +import React from 'react' // eslint-disable-line no-use-before-define import { PluginManagerComponent, PluginManagerProfile } from '../../types' import InactivePluginCard from './InactivePluginCard' import ModuleHeading from './moduleHeading' diff --git a/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx b/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx index c8b4f8fbcd..7182930737 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import React, { useEffect, useReducer, useState } from 'react' +import React, { useEffect, useReducer, useState } from 'react' // eslint-disable-line no-use-before-define import { ModalDialog } from '@remix-ui/modal-dialog' import { Toaster } from '@remix-ui/toaster' import { IframePlugin, WebsocketPlugin } from '@remixproject/engine-web' diff --git a/libs/remix-ui/plugin-manager/src/lib/components/moduleHeading.tsx b/libs/remix-ui/plugin-manager/src/lib/components/moduleHeading.tsx index b77102bb5c..0fe2534bca 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/moduleHeading.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/moduleHeading.tsx @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable @typescript-eslint/no-unused-vars,no-use-before-define */ import React from 'react' interface ModuleHeadingProps { diff --git a/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx b/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx index 6dba54afc5..dd41957fbe 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/permissionsSettings.tsx @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import React, { Fragment, useState } from 'react' +import React, { Fragment, useState } from 'react' // eslint-disable-line no-use-before-define /* eslint-disable-line */ import { ModalDialog } from '@remix-ui/modal-dialog' import useLocalStorage from '../custom-hooks/useLocalStorage' diff --git a/libs/remix-ui/plugin-manager/src/lib/components/rootView.tsx b/libs/remix-ui/plugin-manager/src/lib/components/rootView.tsx index c889aad285..0e6d377146 100644 --- a/libs/remix-ui/plugin-manager/src/lib/components/rootView.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/components/rootView.tsx @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import React, { Fragment, ReactNode, useEffect, useState } from 'react' +import React, { Fragment, ReactNode, useEffect, useState } from 'react' // eslint-disable-line no-use-before-define import { PluginManagerComponent, PluginManagerSettings } from '../../types' import PermisssionsSettings from './permissionsSettings' import { Profile } from '@remixproject/plugin-utils' diff --git a/libs/remix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx b/libs/remix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx index 56d042685c..873b37f611 100644 --- a/libs/remix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx +++ b/libs/remix-ui/plugin-manager/src/lib/remix-ui-plugin-manager.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { Profile } from '@remixproject/plugin-utils' -import React, { useState } from 'react' +import React, { useState } from 'react' // eslint-disable-line no-use-before-define import { RemixUiPluginManagerProps } from '../types' import ActivePluginCardContainer from './components/ActivePluginCardContainer' import InactivePluginCardContainer from './components/InactivePluginCardContainer' diff --git a/libs/remix-ui/plugin-manager/src/types.d.ts b/libs/remix-ui/plugin-manager/src/types.d.ts index d8563caad6..d30ae31457 100644 --- a/libs/remix-ui/plugin-manager/src/types.d.ts +++ b/libs/remix-ui/plugin-manager/src/types.d.ts @@ -32,7 +32,7 @@ export class RemixAppManager extends PluginManager { constructor() event: EventEmitter pluginsDirectory: string - pluginLoader: PluginLoader + pluginLoader: PluginLoader // eslint-disable-line no-use-before-define permissionHandler: PermissionHandler getAll(): import('@remixproject/plugin-utils').Profile[] getIds(): string[] @@ -70,11 +70,11 @@ export class PluginManagerComponent extends ViewPlugin extends Plugin implements constructor(appManager: RemixAppManager, engine: Engine) appManager: RemixAppManager pluginSettings: PluginManagerSettings - app: PluginApi + app: PluginApi // eslint-disable-line no-undef engine: Engine htmlElement: HTMLDivElement views: { root: null, items: {} } - localPlugin: LocalPlugin + localPlugin: LocalPlugin // eslint-disable-line no-use-before-define pluginNames: string[] inactivePlugins: Profile[] activePlugins: Profile[] @@ -133,7 +133,7 @@ declare class LocalPlugin { } export interface PluginManagerContextProviderProps { - children: React.ReactNode + children: React.ReactNode // eslint-disable-line no-undef pluginComponent: PluginManagerComponent } @@ -153,7 +153,7 @@ declare class PluginLoader { set(plugin: any, actives: any): void get(): any } - +// eslint-disable-next-line no-redeclare export type PluginManagerSettings = { openDialog: () => void onValidation: () => void @@ -197,6 +197,7 @@ export type PluginManagerProfile = Profile & { type: 'iframe' | 'ws' hash: string } +// eslint-disable-next-line no-redeclare export type LocalPlugin = { create: () => Profile updateName: (target: string) => void diff --git a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx index ed8ca6a65f..f9245dc15e 100644 --- a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx +++ b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx @@ -79,7 +79,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => { resetStorage() } - const modal = async (title: string, message: string | JSX.Element) => { + const modal = async (title: string, message: string | JSX.Element) => { // eslint-disable-line no-undef await setState(prevState => { return { ...prevState, diff --git a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx index 3a1a59cad6..ba0c420702 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx @@ -73,7 +73,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { setCurrentVersion(value) api.setCompilerParameters({ version: value }) } - + // eslint-disable-next-line no-undef const modal = async (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => { await setState(prevState => { return { diff --git a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts index 4932b1456c..83100a0bd5 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts @@ -10,8 +10,8 @@ export interface CompilerContainerProps { api: ICompilerApi, compileTabLogic: CompileTabLogic, isHardhatProject: boolean, - tooltip: (message: string | JSX.Element) => void, - modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, + tooltip: (message: string | JSX.Element) => void, // eslint-disable-line no-undef + modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, // eslint-disable-line no-undef compiledFileName: string, updateCurrentVersion: any, configurationSettings: ConfigurationSettings @@ -21,6 +21,6 @@ export interface ContractSelectionProps { contractMap: { file: string } | Record, - modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, + modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, // eslint-disable-line no-undef contractsDetails: Record } diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index d843123cb9..6b7503af02 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState, useReducer } from 'react' +import React, { useEffect, useState, useReducer } from 'react' // eslint-disable-line import Button from './Button/StaticAnalyserButton' // eslint-disable-line import { util } from '@remix-project/remix-lib' import _ from 'lodash' diff --git a/libs/remix-ui/tree-view/src/types/index.ts b/libs/remix-ui/tree-view/src/types/index.ts index d602367257..1c91934c76 100644 --- a/libs/remix-ui/tree-view/src/types/index.ts +++ b/libs/remix-ui/tree-view/src/types/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ export interface TreeViewProps { children?: React.ReactNode, id?: string diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 49676c2b08..b1e2ade14b 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -292,7 +292,7 @@ export const Workspace = (props: WorkspaceProps) => { return { ...prevState, modal: { ...state.modal, hide: true, message: null } } }) } - + // eslint-disable-next-line no-undef const modal = async (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel: string, cancelFn: () => void) => { await setState(prevState => { return {