Browse Source

storage-node: cli: Fix linter errors.

Shamil Gadelshin 4 years ago
parent
commit
b9a1149e44

+ 4 - 0
storage-node/packages/cli/.eslintignore

@@ -0,0 +1,4 @@
+**/build/*
+**/dist/*
+**/coverage/*
+**/node_modules/*

+ 1 - 1
storage-node/packages/cli/package.json

@@ -28,7 +28,7 @@
   },
   "scripts": {
     "test": "mocha 'dist/test/**/*.js'",
-    "lint": "eslint --ext .js,.jsx,.ts,.tsx . && tsc --noEmit --pretty",
+    "lint": "eslint --ext .ts,.tsx . && tsc --noEmit --pretty",
     "build": "tsc --build"
   },
   "bin": {

+ 3 - 3
storage-node/packages/cli/src/commands/base.ts

@@ -1,14 +1,14 @@
 import chalk from 'chalk'
 import removeEndingForwardSlash from '@joystream/storage-utils/stripEndingSlash'
-import {ContentId} from "@joystream/types/media";
+import { ContentId } from '@joystream/types/media'
 
 // Commands base abstract class. Contains reusable methods.
 export abstract class BaseCommand {
   // Creates the Colossus asset URL and logs it.
   protected createAndLogAssetUrl(url: string, contentId: string | ContentId): string {
-    let normalizedContentId: string;
+    let normalizedContentId: string
 
-    if (typeof contentId === "string") {
+    if (typeof contentId === 'string') {
       normalizedContentId = contentId
     } else {
       normalizedContentId = contentId.encode()

+ 3 - 3
storage-node/packages/cli/src/commands/upload.ts

@@ -8,7 +8,7 @@ import { BaseCommand } from './base'
 import { discover } from '@joystream/service-discovery/discover'
 import Debug from 'debug'
 import chalk from 'chalk'
-import {aliceKeyPair} from './dev'
+import { aliceKeyPair } from './dev'
 const debug = Debug('joystream:storage-cli:upload')
 
 // Defines maximum content length for the assets (files). Limits the upload.
@@ -172,10 +172,10 @@ export class UploadCommand extends BaseCommand {
   // Loads and unlocks the runtime identity using the key file and pass phrase.
   private async loadIdentity(): Promise<any> {
     const noKeyFileProvided = !this.keyFile || this.keyFile === ''
-    const useAlice = noKeyFileProvided && await this.api.system.isDevelopmentChain()
+    const useAlice = noKeyFileProvided && (await this.api.system.isDevelopmentChain())
 
     if (useAlice) {
-      debug('Discovered \'development\' chain.')
+      debug("Discovered 'development' chain.")
       return aliceKeyPair(this.api)
     }