Browse Source

Linter autofix

Leszek Wiesner 4 years ago
parent
commit
bcd2d0ec0e

+ 4 - 4
cli/src/Api.ts

@@ -388,19 +388,19 @@ export default class Api {
       sp.isSome ? unstakingPeriod(sp.unwrap()[key]) : 0
 
     const unstakingPeriods: Partial<UnstakingPeriods> = {
-      ['review_period_expired_application_stake_unstaking_period_length']: spUnstakingPeriod(
+      'review_period_expired_application_stake_unstaking_period_length': spUnstakingPeriod(
         applSP,
         'review_period_expired_unstaking_period_length'
       ),
-      ['crowded_out_application_stake_unstaking_period_length']: spUnstakingPeriod(
+      'crowded_out_application_stake_unstaking_period_length': spUnstakingPeriod(
         applSP,
         'crowded_out_unstaking_period_length'
       ),
-      ['review_period_expired_role_stake_unstaking_period_length']: spUnstakingPeriod(
+      'review_period_expired_role_stake_unstaking_period_length': spUnstakingPeriod(
         roleSP,
         'review_period_expired_unstaking_period_length'
       ),
-      ['crowded_out_role_stake_unstaking_period_length']: spUnstakingPeriod(
+      'crowded_out_role_stake_unstaking_period_length': spUnstakingPeriod(
         roleSP,
         'crowded_out_unstaking_period_length'
       ),

+ 17 - 0
cli/src/Types.ts

@@ -198,9 +198,11 @@ export class HRTJobSpecificsStruct
   get title(): string {
     return this.getField('title').toString()
   }
+
   get description(): string {
     return this.getField('description').toString()
   }
+
   toJSONObj(): JobSpecifics {
     const { title, description } = this
     return { title, description }
@@ -214,6 +216,7 @@ export class HRTEntryInMembershipModukeStruct
   get handle(): string {
     return this.getField('handle').toString()
   }
+
   toJSONObj(): EntryInMembershipModuke {
     const { handle } = this
     return { handle }
@@ -227,6 +230,7 @@ export class HRTCreatorDetailsStruct
   get membership(): EntryInMembershipModuke {
     return this.getField('membership').toJSONObj()
   }
+
   toJSONObj(): CreatorDetails {
     const { membership } = this
     return { membership }
@@ -242,6 +246,7 @@ export class HRTHiringProcessStruct
       .toArray()
       .map((v) => v.toString())
   }
+
   toJSONObj(): HiringProcess {
     const { details } = this
     return { details }
@@ -256,9 +261,11 @@ export class HRTQuestionFieldStruct
   get title(): string {
     return this.getField('title').toString()
   }
+
   get type(): string {
     return this.getField('type').toString()
   }
+
   toJSONObj(): QuestionField {
     const { title, type } = this
     return { title, type }
@@ -278,9 +285,11 @@ export class HRTQuestionSectionStruct
   get title(): string {
     return this.getField('title').toString()
   }
+
   get questions(): QuestionsFields {
     return this.getField('questions').toJSONObj()
   }
+
   toJSONObj(): QuestionSection {
     const { title, questions } = this
     return { title, questions }
@@ -300,6 +309,7 @@ export class HRTApplicationDetailsStruct
   get sections(): QuestionSections {
     return this.getField('sections').toJSONObj()
   }
+
   toJSONObj(): ApplicationDetails {
     const { sections } = this
     return { sections }
@@ -319,24 +329,31 @@ export class HRTStruct
   get version(): number {
     return this.getField('version').toNumber()
   }
+
   get headline(): string {
     return this.getField('headline').toString()
   }
+
   get job(): JobSpecifics {
     return this.getField('job').toJSONObj()
   }
+
   get application(): ApplicationDetails {
     return this.getField('application').toJSONObj()
   }
+
   get reward(): string {
     return this.getField('reward').toString()
   }
+
   get creator(): CreatorDetails {
     return this.getField('creator').toJSONObj()
   }
+
   get process(): HiringProcess {
     return this.getField('process').toJSONObj()
   }
+
   toJSONObj(): GenericJoyStreamRoleSchema {
     const { version, headline, job, application, reward, creator, process } = this
     return { version, headline, job, application, reward, creator, process }

+ 4 - 4
cli/src/base/ApiCommandBase.ts

@@ -3,8 +3,8 @@ import { CLIError } from '@oclif/errors'
 import StateAwareCommandBase from './StateAwareCommandBase'
 import Api from '../Api'
 import { getTypeDef, Option, Tuple, Bytes } from '@polkadot/types'
-import { Registry } from '@polkadot/types/types'
-import { Codec, CodecArg, TypeDef, TypeDefInfo, Constructor } from '@polkadot/types/types'
+import { Registry, Codec, CodecArg, TypeDef, TypeDefInfo, Constructor } from '@polkadot/types/types'
+
 import { Vec, Struct, Enum } from '@polkadot/types/codec'
 import { ApiPromise, WsProvider } from '@polkadot/api'
 import { KeyringPair } from '@polkadot/keyring/types'
@@ -332,8 +332,8 @@ export default abstract class ApiCommandBase extends StateAwareCommandBase {
       typeDef.name = argName
     }
 
-    let isValid = true,
-      jsonText: string
+    let isValid = true
+    let jsonText: string
     do {
       const structVal = await this.promptForStruct(typeDef, createParamOptions(typeDef.name, defaultStruct))
       jsonText = JSON.stringify(structVal.toJSON())

+ 3 - 3
cli/src/base/WorkingGroupsCommandBase.ts

@@ -114,9 +114,9 @@ export default abstract class WorkingGroupsCommandBase extends AccountsCommandBa
   }
 
   async promptForNewOpeningDraftName() {
-    let draftName = '',
-      fileExists = false,
-      overrideConfirmed = false
+    let draftName = ''
+    let fileExists = false
+    let overrideConfirmed = false
 
     do {
       draftName = await this.simplePrompt({

+ 1 - 1
cli/src/commands/api/inspect.ts

@@ -129,7 +129,7 @@ export default class ApiInspect extends ApiCommandBase {
     api: ApiPromise,
     flags: ApiInspectFlags
   ): { apiType: ApiType | undefined; apiModule: string | undefined; apiMethod: string | undefined } {
-    let apiType: ApiType | undefined = undefined
+    let apiType: ApiType | undefined
     const { module: apiModule, method: apiMethod } = flags
 
     if (flags.type !== undefined) {

+ 1 - 0
cli/src/commands/working-groups/application.ts

@@ -11,6 +11,7 @@ export default class WorkingGroupsApplication extends WorkingGroupsCommandBase {
       description: 'Working Group Application ID',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 2 - 2
cli/src/commands/working-groups/createOpening.ts

@@ -53,8 +53,8 @@ export default class WorkingGroupsCreateOpening extends WorkingGroupsCommandBase
       const module = apiModuleByGroup[this.group]
       const method = 'addOpening'
 
-      let saveDraft = false,
-        params: ApiMethodArg[]
+      let saveDraft = false
+      let params: ApiMethodArg[]
       if (flags.createDraftOnly) {
         params = await this.promptForExtrinsicParams(module, method, promptOptions)
         saveDraft = true

+ 2 - 0
cli/src/commands/working-groups/decreaseWorkerStake.ts

@@ -10,6 +10,7 @@ export default class WorkingGroupsDecreaseWorkerStake extends WorkingGroupsComma
   static description =
     'Decreases given worker stake by an amount that will be returned to the worker role account. ' +
     'Requires lead access.'
+
   static args = [
     {
       name: 'workerId',
@@ -17,6 +18,7 @@ export default class WorkingGroupsDecreaseWorkerStake extends WorkingGroupsComma
       description: 'Worker ID',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 1 - 0
cli/src/commands/working-groups/evictWorker.ts

@@ -13,6 +13,7 @@ export default class WorkingGroupsEvictWorker extends WorkingGroupsCommandBase {
       description: 'Worker ID',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 1 - 0
cli/src/commands/working-groups/fillOpening.ts

@@ -13,6 +13,7 @@ export default class WorkingGroupsFillOpening extends WorkingGroupsCommandBase {
       description: 'Working Group Opening ID',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 1 - 0
cli/src/commands/working-groups/opening.ts

@@ -15,6 +15,7 @@ export default class WorkingGroupsOpening extends WorkingGroupsCommandBase {
       description: 'Working Group Opening ID',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 1 - 0
cli/src/commands/working-groups/slashWorker.ts

@@ -15,6 +15,7 @@ export default class WorkingGroupsSlashWorker extends WorkingGroupsCommandBase {
       description: 'Worker ID',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 1 - 0
cli/src/commands/working-groups/startAcceptingApplications.ts

@@ -12,6 +12,7 @@ export default class WorkingGroupsStartAcceptingApplications extends WorkingGrou
       description: 'Working Group Opening ID',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 1 - 0
cli/src/commands/working-groups/startReviewPeriod.ts

@@ -12,6 +12,7 @@ export default class WorkingGroupsStartReviewPeriod extends WorkingGroupsCommand
       description: 'Working Group Opening ID',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 1 - 0
cli/src/commands/working-groups/terminateApplication.ts

@@ -12,6 +12,7 @@ export default class WorkingGroupsTerminateApplication extends WorkingGroupsComm
       description: 'Working Group Application ID',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 1 - 0
cli/src/commands/working-groups/updateRewardAccount.ts

@@ -13,6 +13,7 @@ export default class WorkingGroupsUpdateRewardAccount extends WorkingGroupsComma
       description: 'New reward account address (if omitted, one of the existing CLI accounts can be selected)',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 1 - 0
cli/src/commands/working-groups/updateRoleAccount.ts

@@ -12,6 +12,7 @@ export default class WorkingGroupsUpdateRoleAccount extends WorkingGroupsCommand
       description: 'New role account address (if omitted, one of the existing CLI accounts can be selected)',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 1 - 0
cli/src/commands/working-groups/updateWorkerReward.ts

@@ -16,6 +16,7 @@ export default class WorkingGroupsUpdateWorkerReward extends WorkingGroupsComman
       description: 'Worker ID',
     },
   ]
+
   static flags = {
     ...WorkingGroupsCommandBase.flags,
   }

+ 6 - 0
cli/src/promptOptions/addWorkerOpening.ts

@@ -13,16 +13,20 @@ class OpeningPolicyCommitmentOptions implements ApiParamsOptions {
       locked: true,
     },
   }
+
   // Rename fields containing "curator" (solivg minor UI issue related to flat namespace)
   public terminate_curator_application_stake_unstaking_period: ApiParamOptions = {
     forcedName: 'terminate_application_stake_unstaking_period',
   }
+
   public terminate_curator_role_stake_unstaking_period: ApiParamOptions = {
     forcedName: 'terminate_role_stake_unstaking_period',
   }
+
   public exit_curator_role_application_stake_unstaking_period: ApiParamOptions = {
     forcedName: 'exit_role_application_stake_unstaking_period',
   }
+
   public exit_curator_role_stake_unstaking_period: ApiParamOptions = {
     forcedName: 'exit_role_stake_unstaking_period',
   }
@@ -37,6 +41,7 @@ class AddWrokerOpeningOptions implements ApiParamsOptions {
       locked: true,
     },
   }
+
   // Json schema for human_readable_text
   public human_readable_text: ApiParamOptions<Bytes> = {
     jsonSchema: {
@@ -44,6 +49,7 @@ class AddWrokerOpeningOptions implements ApiParamsOptions {
       struct: HRTStruct,
     },
   }
+
   // Lock value for role_slashing_terms
   public commitment: ApiParamOptions<WorkingGroupOpeningPolicyCommitment> = {
     nestedOptions: new OpeningPolicyCommitmentOptions(),