Skip to content

Commit 4716cfa

Browse files
committed
fixing remix-ide linting
1 parent f80fbfd commit 4716cfa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+311
-349
lines changed

apps/remix-ide/src/app/components/hidden-panel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// eslint-disable-next-line no-use-before-define
22
import React from 'react'
3-
import {AbstractPanel} from './panel'
3+
import { AbstractPanel } from './panel'
44
import * as packageJson from '../../../../../package.json'
5-
import {RemixPluginPanel} from '@remix-ui/panel'
6-
import {PluginViewWrapper} from '@remix-ui/helper'
5+
import { RemixPluginPanel } from '@remix-ui/panel'
6+
import { PluginViewWrapper } from '@remix-ui/helper'
77

88
const profile = {
99
name: 'hiddenPanel',

apps/remix-ide/src/app/components/main-panel.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react' // eslint-disable-line
2-
import {AbstractPanel} from './panel'
3-
import {RemixPluginPanel} from '@remix-ui/panel'
2+
import { AbstractPanel } from './panel'
3+
import { RemixPluginPanel } from '@remix-ui/panel'
44
import packageJson from '../../../../../package.json'
5-
import {PluginViewWrapper} from '@remix-ui/helper'
5+
import { PluginViewWrapper } from '@remix-ui/helper'
66

77
const profile = {
88
name: 'mainPanel',
@@ -60,7 +60,7 @@ export class MainPanel extends AbstractPanel {
6060

6161
render() {
6262
return (
63-
<div style={{height: '100%', width: '100%'}} data-id="mainPanelPluginsContainer">
63+
<div style={{ height: '100%', width: '100%' }} data-id="mainPanelPluginsContainer">
6464
<PluginViewWrapper plugin={this} />
6565
</div>
6666
)

apps/remix-ide/src/app/components/panel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class AbstractPanel extends HostPlugin {
4949
* @param {String} name The name of the plugin to display the content
5050
*/
5151
showContent (name) {
52-
if (!this.plugins[name]) throw new Error(`Plugin ${name} is not yet activated`)
52+
if (!this.plugins[name]) throw new Error(`Plugin ${name} is not yet activated`)
5353
Object.values(this.plugins).forEach(plugin => {
5454
plugin.active = false
5555
})

apps/remix-ide/src/app/components/preload.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {RemixApp} from '@remix-ui/app'
1+
import { RemixApp } from '@remix-ui/app'
22
import axios from 'axios'
3-
import React, {useEffect, useRef, useState} from 'react'
3+
import React, { useEffect, useRef, useState } from 'react'
44
import { createRoot } from 'react-dom/client'
55
import * as packageJson from '../../../../../package.json'
6-
import {fileSystem, fileSystems} from '../files/fileSystem'
7-
import {indexedDBFileSystem} from '../files/filesystems/indexedDB'
8-
import {localStorageFS} from '../files/filesystems/localStorage'
9-
import {fileSystemUtility, migrationTestData} from '../files/filesystems/fileSystemUtility'
6+
import { fileSystem, fileSystems } from '../files/fileSystem'
7+
import { indexedDBFileSystem } from '../files/filesystems/indexedDB'
8+
import { localStorageFS } from '../files/filesystems/localStorage'
9+
import { fileSystemUtility, migrationTestData } from '../files/filesystems/fileSystemUtility'
1010
import './styles/preload.css'
1111
import isElectron from 'is-electron'
1212
const _paq = (window._paq = window._paq || [])
@@ -83,7 +83,7 @@ export const Preload = (props: any) => {
8383
}
8484

8585
useEffect (() => {
86-
if(isElectron()){
86+
if (isElectron()){
8787
loadAppComponent()
8888
return
8989
}
@@ -177,8 +177,8 @@ export const Preload = (props: any) => {
177177
) : null}
178178
{supported && !error && !showDownloader ? (
179179
<div>
180-
<div className='text-center'>
181-
<i className="fas fa-spinner fa-spin fa-2x"></i>
180+
<div className='text-center'>
181+
<i className="fas fa-spinner fa-spin fa-2x"></i>
182182
</div>
183183
{ tip && <div className='remix_tips text-center mt-3'>
184184
<div><b>DID YOU KNOW</b></div>

apps/remix-ide/src/app/components/side-panel.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// eslint-disable-next-line no-use-before-define
22
import React from 'react'
3-
import {AbstractPanel} from './panel'
4-
import {RemixPluginPanel} from '@remix-ui/panel'
3+
import { AbstractPanel } from './panel'
4+
import { RemixPluginPanel } from '@remix-ui/panel'
55
import packageJson from '../../../../../package.json'
6-
import {RemixUIPanelHeader} from '@remix-ui/panel'
7-
import {PluginViewWrapper} from '@remix-ui/helper'
6+
import { RemixUIPanelHeader } from '@remix-ui/panel'
7+
import { PluginViewWrapper } from '@remix-ui/helper'
88
// const csjs = require('csjs-inject')
99

1010
const sidePanel = {

apps/remix-ide/src/app/components/vertical-icons.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// eslint-disable-next-line no-use-before-define
22
import React from 'react'
33
import packageJson from '../../../../../package.json'
4-
import {Plugin} from '@remixproject/engine'
5-
import {EventEmitter} from 'events'
6-
import {IconRecord, RemixUiVerticalIconsPanel} from '@remix-ui/vertical-icons-panel'
7-
import {Profile} from '@remixproject/plugin-utils'
8-
import {PluginViewWrapper} from '@remix-ui/helper'
4+
import { Plugin } from '@remixproject/engine'
5+
import { EventEmitter } from 'events'
6+
import { IconRecord, RemixUiVerticalIconsPanel } from '@remix-ui/vertical-icons-panel'
7+
import { Profile } from '@remixproject/plugin-utils'
8+
import { PluginViewWrapper } from '@remix-ui/helper'
99

1010
const profile = {
1111
name: 'menuicons',

apps/remix-ide/src/app/files/dgitProvider.ts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import JSZip from 'jszip'
1414
import path from 'path'
1515
import FormData from 'form-data'
1616
import axios from 'axios'
17-
import {Registry} from '@remix-project/remix-lib'
17+
import { Registry } from '@remix-project/remix-lib'
1818

1919
const profile = {
2020
name: 'dGitProvider',
@@ -121,7 +121,6 @@ class DGitProvider extends Plugin {
121121
return status
122122
}
123123

124-
125124
const status = await git.statusMatrix({
126125
...await this.getGitConfig(),
127126
...cmd
@@ -189,7 +188,7 @@ class DGitProvider extends Plugin {
189188
return newmodule.name === module.name
190189
})
191190
})
192-
191+
193192
for (const module of toRemove) {
194193
const path = (await this.getGitConfig(module.path)).dir
195194
if (await window.remixFileSystem.exists(path)) {
@@ -224,7 +223,6 @@ class DGitProvider extends Plugin {
224223
return status
225224
}
226225

227-
228226
const status = await git.log({
229227
...await this.getGitConfig(),
230228
...cmd,
@@ -269,8 +267,6 @@ class DGitProvider extends Plugin {
269267

270268
async currentbranch(config) {
271269

272-
273-
274270
if ((Registry.getInstance().get('platform').api.isDesktop())) {
275271
return await this.call('isogit', 'currentbranch')
276272
}
@@ -426,11 +422,11 @@ class DGitProvider extends Plugin {
426422
input
427423
}
428424
this.call('terminal', 'logHtml', `Cloning ${input.url}... please wait...`)
429-
try{
425+
try {
430426
const result = await this.call('isogit', 'clone', cmd)
431427
this.call('fs', 'openWindow', folder)
432428
return result
433-
}catch(e){
429+
} catch (e){
434430
this.call('notification', 'alert', {
435431
id: 'dgitAlert',
436432
message: 'Unexpected error while cloning the repository: \n' + e.toString(),
@@ -516,7 +512,7 @@ class DGitProvider extends Plugin {
516512
for (const module of gitmodules) {
517513
const dir = path.join(currentDir, module.path)
518514
// if url contains git@github.com: convert it
519-
if(module.url && module.url.startsWith('[email protected]:')) {
515+
if (module.url && module.url.startsWith('[email protected]:')) {
520516
module.url = module.url.replace('[email protected]:', 'https://github.com/')
521517
}
522518
try {
@@ -530,7 +526,7 @@ class DGitProvider extends Plugin {
530526
this.call('terminal', 'logHtml', `Cloning submodule ${dir}...`)
531527
await git.clone(cmd)
532528
this.call('terminal', 'logHtml', `Cloned successfully submodule ${dir}...`)
533-
529+
534530
const commitHash = await git.resolveRef({
535531
...await this.getGitConfig(currentDir),
536532
ref: 'HEAD'
@@ -540,12 +536,12 @@ class DGitProvider extends Plugin {
540536
...await this.getGitConfig(currentDir),
541537
trees: [git.TREE({ ref: commitHash })],
542538
map: async function (filepath, [A]) {
543-
if(filepath === module.path) {
539+
if (filepath === module.path) {
544540
return await A.oid()
545541
}
546542
}
547543
})
548-
if(result && result.length) {
544+
if (result && result.length) {
549545
this.call('terminal', 'logHtml', `Checking out submodule ${dir} to ${result[0]} in directory ${dir}`)
550546
await git.fetch({
551547
...await this.parseInput(input),
@@ -558,16 +554,16 @@ class DGitProvider extends Plugin {
558554
...await this.getGitConfig(dir),
559555
ref: result[0]
560556
})
561-
557+
562558
const log = await git.log({
563559
...await this.getGitConfig(dir),
564560
})
565561

566-
if(log[0].oid !== result[0]) {
562+
if (log[0].oid !== result[0]) {
567563
this.call('terminal', 'log', {
568564
type: 'error',
569565
value: `Could not checkout submodule to ${result[0]}`
570-
})} else {
566+
})} else {
571567
this.call('terminal', 'logHtml',`Checked out submodule ${dir} to ${result[0]}`)
572568
}
573569
}

apps/remix-ide/src/app/files/electronProvider.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import FileProvider from "./fileProvider"
22

3-
43
declare global {
54
interface Window {
65
remixFileSystem: any
@@ -50,7 +49,6 @@ export class ElectronProvider extends FileProvider {
5049
}
5150
}
5251

53-
5452
// isDirectory is already included
5553
// this is a more efficient version of the default implementation
5654
async resolveDirectory(path, cb) {

apps/remix-ide/src/app/files/fileManager.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { saveAs } from 'file-saver'
44
import JSZip from 'jszip'
55
import { Plugin } from '@remixproject/engine'
66
import * as packageJson from '../../../../../package.json'
7-
import {Registry} from '@remix-project/remix-lib'
7+
import { Registry } from '@remix-project/remix-lib'
88
import { fileChangedToastMsg, recursivePasteToastMsg, storageFullMessage } from '@remix-ui/helper'
99
import helper from '../../lib/helper.js'
1010
import { RemixAppManager } from '../../remixAppManager'
@@ -251,7 +251,7 @@ class FileManager extends Plugin {
251251
throw new Error(e)
252252
}
253253
}
254-
254+
255255
/**
256256
* Set the content of a specific file, does nnot rewrite file if it exists but creates a new unique name
257257
* @param {string} path path of the file
@@ -265,11 +265,11 @@ class FileManager extends Plugin {
265265
if (await this.exists(path)) {
266266
const newPath = await helper.createNonClashingNameAsync(path, this)
267267
const content = await this.setFileContent(newPath, data)
268-
return {newContent: content, newPath}
268+
return { newContent: content, newPath }
269269
} else {
270270
const ret = await this.setFileContent(path, data)
271271
this.emit('fileAdded', path)
272-
return {newContent: ret, newpath: path}
272+
return { newContent: ret, newpath: path }
273273
}
274274
} catch (e) {
275275
throw new Error(e)
@@ -523,7 +523,7 @@ class FileManager extends Plugin {
523523
this._deps.electronExplorer.event.on('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) })
524524
this._deps.electronExplorer.event.on('fileRemoved', (path) => { this.fileRemovedEvent(path) })
525525
this._deps.electronExplorer.event.on('fileAdded', (path) => { this.fileAddedEvent(path) })
526-
526+
527527
this.getCurrentFile = this.file
528528
this.getFile = this.readFile
529529
this.getFolder = this.readdir
@@ -726,7 +726,7 @@ class FileManager extends Plugin {
726726
}
727727
try {
728728
// This make sure dependencies are loaded in the editor context.
729-
// This ensure monaco is aware of deps artifacts, so it can provide basic features like "go to" symbols.
729+
// This ensure monaco is aware of deps artifacts, so it can provide basic features like "go to" symbols.
730730
await this.editor.handleTypeScriptDependenciesOf(file, content, path => this.readFile(path), path => this.exists(path))
731731
} catch (e) {
732732
console.log('unable to handle TypeScript dependencies of', file)
@@ -927,7 +927,6 @@ class FileManager extends Plugin {
927927
return exists
928928
}
929929

930-
931930
async moveFileIsAllowed (src: string, dest: string) {
932931
try {
933932
src = this.normalize(src)
@@ -970,7 +969,7 @@ class FileManager extends Plugin {
970969
if (provider.isSubDirectory(src, dest)) {
971970
this.call('notification', 'toast', recursivePasteToastMsg())
972971
return false
973-
}
972+
}
974973
return true
975974
} catch (e) {
976975
console.log(e)
@@ -1033,7 +1032,7 @@ class FileManager extends Plugin {
10331032
if (provider.isSubDirectory(src, dest)) {
10341033
this.call('notification', 'toast', recursivePasteToastMsg())
10351034
return false
1036-
}
1035+
}
10371036
await this.inDepthCopy(src, dest, dirName)
10381037
await this.remove(src)
10391038

@@ -1047,7 +1046,7 @@ class FileManager extends Plugin {
10471046
if (provider && provider.copyFolderToJson) {
10481047
return await provider.copyFolderToJson(folder)
10491048
}
1050-
throw new Error('copyFolderToJson not available')
1049+
throw new Error('copyFolderToJson not available')
10511050
}
10521051
}
10531052

apps/remix-ide/src/app/files/fileProvider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import EventManager from 'events'
55
import { Storage } from '@remix-project/remix-lib'
66
import pathModule from 'path'
77

8-
98
export default class FileProvider {
109
event: any
1110
type: any
@@ -189,7 +188,7 @@ export default class FileProvider {
189188
return await this.removeFile(path)
190189
} else {
191190
await window.remixFileSystem.unlink(path)
192-
this.event.emit('fileRemoved', this._normalizePath(path))
191+
this.event.emit('fileRemoved', this._normalizePath(path))
193192
}
194193
} catch (e) {
195194
console.log(e)

0 commit comments

Comments
 (0)