Sfoglia il codice sorgente

Add typescript/no-unused-vars rule and noUnusedLocals in tsconfig

Leszek Wiesner 4 anni fa
parent
commit
12005b446a

+ 4 - 0
cli/.eslintrc.js

@@ -10,4 +10,8 @@ module.exports = {
     // "oclif",
     // "oclif-typescript",
   ],
+  rules: {
+    "no-unused-vars": "off", // Required by the typescript rule below
+    "@typescript-eslint/no-unused-vars": ["error"]
+  }
 }

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

@@ -1,6 +1,5 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
 import { displayCollapsedRow, displayHeader } from '../../helpers/display'
-import _ from 'lodash'
 import chalk from 'chalk'
 
 export default class WorkingGroupsApplication extends WorkingGroupsCommandBase {

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

@@ -1,12 +1,10 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { apiModuleByGroup } from '../../Api'
 import { WorkerId } from '@joystream/types/working-group'
 import { Balance } from '@polkadot/types/interfaces'
 import { formatBalance } from '@polkadot/util'
 import { minMaxInt } from '../../validators/common'
 import chalk from 'chalk'
-import ExitCodes from '../../ExitCodes'
 import { createParamOptions } from '../../helpers/promptOptions'
 
 export default class WorkingGroupsDecreaseWorkerStake extends WorkingGroupsCommandBase {

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

@@ -1,5 +1,4 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { apiModuleByGroup } from '../../Api'
 import { WorkerId } from '@joystream/types/working-group'
 import { bool } from '@polkadot/types/primitive'

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

@@ -1,5 +1,4 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { OpeningStatus } from '../../Types'
 import { apiModuleByGroup } from '../../Api'
 import { OpeningId } from '@joystream/types/hiring'

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

@@ -1,5 +1,4 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { apiModuleByGroup } from '../../Api'
 import { Balance } from '@polkadot/types/interfaces'
 import { formatBalance } from '@polkadot/util'

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

@@ -1,5 +1,4 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { apiModuleByGroup } from '../../Api'
 import { minMaxStr } from '../../validators/common'
 import chalk from 'chalk'

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

@@ -1,12 +1,10 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { apiModuleByGroup } from '../../Api'
 import { WorkerId } from '@joystream/types/working-group'
 import { Balance } from '@polkadot/types/interfaces'
 import { formatBalance } from '@polkadot/util'
 import { minMaxInt } from '../../validators/common'
 import chalk from 'chalk'
-import ExitCodes from '../../ExitCodes'
 import { createParamOptions } from '../../helpers/promptOptions'
 
 export default class WorkingGroupsSlashWorker extends WorkingGroupsCommandBase {

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

@@ -1,5 +1,4 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { OpeningStatus } from '../../Types'
 import { apiModuleByGroup } from '../../Api'
 import { OpeningId } from '@joystream/types/hiring'

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

@@ -1,5 +1,4 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { OpeningStatus } from '../../Types'
 import { apiModuleByGroup } from '../../Api'
 import { OpeningId } from '@joystream/types/hiring'

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

@@ -1,6 +1,4 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
-import ExitCodes from '../../ExitCodes'
 import { apiModuleByGroup } from '../../Api'
 import { ApplicationStageKeys, ApplicationId } from '@joystream/types/hiring'
 import chalk from 'chalk'

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

@@ -1,5 +1,4 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { apiModuleByGroup } from '../../Api'
 import { validateAddress } from '../../helpers/validation'
 import { GenericAccountId } from '@polkadot/types'

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

@@ -1,5 +1,4 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { apiModuleByGroup } from '../../Api'
 import { validateAddress } from '../../helpers/validation'
 import { GenericAccountId } from '@polkadot/types'

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

@@ -1,5 +1,4 @@
 import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
-import _ from 'lodash'
 import { apiModuleByGroup } from '../../Api'
 import { WorkerId } from '@joystream/types/working-group'
 import { formatBalance } from '@polkadot/util'

+ 2 - 1
cli/tsconfig.json

@@ -8,7 +8,8 @@
     "strict": true,
     "target": "es2017",
     "esModuleInterop": true,
-	  "types" : [ "node" ]
+    "types" : [ "node" ],
+    "noUnusedLocals": true
   },
   "include": [
     "src/**/*"