Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
⬆️ Update eslint related dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
shuse2 committed Jun 30, 2020
1 parent 0b55f22 commit ea513d6
Show file tree
Hide file tree
Showing 100 changed files with 1,800 additions and 1,073 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ examples/
**/*.d.ts
jest.config.js
coverage
benchmark
benchmark
.eslintrc.js
51 changes: 34 additions & 17 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,50 @@ module.exports = {
plugins: ['@typescript-eslint'],
extends: [
'lisk-base/base',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/all',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier/@typescript-eslint',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
rules: {
'max-len': 'off',
'no-underscore-dangle': 'off',
'implicit-arrow-linebreak': 'off',
'no-mixed-spaces-and-tabs': 'off',
'max-len': 'off', // Managed by prettier
'no-underscore-dangle': 'off', // Used for private variables and methods
'implicit-arrow-linebreak': 'off', // Prefered
'no-mixed-spaces-and-tabs': 'off', // Managed by prettier
'operator-linebreak': 'off',
'import/prefer-default-export': 'off',
'lines-between-class-members': 'off', // Off because typescript has members and methods
'@typescript-eslint/typedef': 'off',
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
'@typescript-eslint/method-signature-style': 'off',
'@typescript-eslint/no-type-alias': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-implied-eval': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'no-useless-constructor': 'off',
'no-unused-expressions': 'off',
'@typescript-eslint/consistent-type-assertions': ['error'],
'@typescript-eslint/explicit-member-accessibility': ['error'],
'@typescript-eslint/member-delimiter-style': ['error'],
'@typescript-eslint/member-ordering': ['error'],
'@typescript-eslint/no-confusing-non-null-assertion': ['error'],
'@typescript-eslint/no-extraneous-class': ['error'],
'@typescript-eslint/no-unnecessary-boolean-literal-compare': ['error'],
'@typescript-eslint/no-unnecessary-qualifier': ['error'],
'@typescript-eslint/no-unnecessary-type-arguments': ['error'],
'@typescript-eslint/prefer-for-of': ['error'],
'@typescript-eslint/prefer-function-type': ['error'],
'@typescript-eslint/prefer-includes': ['error'],
'@typescript-eslint/prefer-nullish-coalescing': ['error'],
'@typescript-eslint/prefer-optional-chain': ['error'],
'@typescript-eslint/prefer-readonly': ['error'],
'@typescript-eslint/prefer-reduce-type-parameter': ['error'],
'@typescript-eslint/prefer-string-starts-ends-with': ['error'],
'@typescript-eslint/prefer-ts-expect-error': ['error'],
'@typescript-eslint/promise-function-async': ['error'],
'@typescript-eslint/require-array-sort-compare': ['error'],
'@typescript-eslint/switch-exhaustiveness-check': ['error'],
'@typescript-eslint/type-annotation-spacing': ['error'],
'@typescript-eslint/unified-signatures': ['error'],
'@typescript-eslint/no-unused-expressions': ['error'],
'@typescript-eslint/no-useless-constructor': ['error'],
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars-experimental': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
Expand Down
3 changes: 2 additions & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"*.{js,ts}": ["prettier --write", "eslint"],
"*.{js}": ["prettier --write"],
"*.{ts}": ["prettier --write", "eslint"],
"*.{json,md}": ["prettier --write"]
}
3 changes: 2 additions & 1 deletion commander/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
tmp
coverage
coverage
.eslintrc.js
14 changes: 7 additions & 7 deletions commander/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,22 @@
"@types/sinon-chai": "3.2.3",
"@types/strip-ansi": "5.2.1",
"@types/tar": "4.0.3",
"@typescript-eslint/eslint-plugin": "2.28.0",
"@typescript-eslint/parser": "2.28.0",
"@typescript-eslint/eslint-plugin": "3.5.0",
"@typescript-eslint/parser": "3.5.0",
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"eslint": "6.8.0",
"eslint": "7.3.1",
"eslint-config-lisk-base": "1.2.2",
"eslint-config-prettier": "6.10.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jest": "23.8.2",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jest": "23.17.1",
"mocha": "7.1.0",
"nyc": "15.0.0",
"prettier": "2.0.5",
"rxjs-compat": "6.5.4",
"sinon": "9.0.0",
"sinon-chai": "3.5.0",
"source-map-support": "0.5.16",
"source-map-support": "0.5.19",
"ts-node": "8.6.2",
"tsconfig-paths": "3.9.0",
"typescript": "3.8.3"
Expand Down
2 changes: 1 addition & 1 deletion commander/src/commands/core/upgrade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default class UpgradeCommand extends BaseCommand {
task: () =>
new Listr([
{
title: `Stop Lisk Core`,
title: 'Stop Lisk Core',
task: async () => {
const isRunning = await isCacheRunning(installationPath, name);
if (isRunning) {
Expand Down
2 changes: 1 addition & 1 deletion commander/src/commands/node/forging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class ForgingCommand extends BaseCommand {
},
];

static description = `Update the forging status of a Lisk Core instance.`;
static description = 'Update the forging status of a Lisk Core instance.';

static examples = [
'node:forging enable 647aac1e2df8a5c870499d7ddc82236b1e10936977537a3844a6b05ea33f9ef6',
Expand Down
2 changes: 1 addition & 1 deletion commander/src/commands/node/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import BaseCommand from '../../base';
import { getAPIClient } from '../../utils/api';

export default class GetCommand extends BaseCommand {
static description = `Get the network status from a Lisk Core instance.`;
static description = 'Get the network status from a Lisk Core instance.';

static examples = ['node:get', 'node:get --forging-status'];

Expand Down
1 change: 1 addition & 0 deletions commander/test/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
'arrow-body-style': 'off',
'dot-notation': 'off',
'mocha/no-synchronous-tests': 'off',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/unbound-method': 'off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ describe.skip('transaction:create:multisignature', () => {
});
});

describe(`transaction:create:multisignature nonce fee --member-passphrase=yyy --member-passphrase=zzz`, () => {
describe('transaction:create:multisignature nonce fee --member-passphrase=yyy --member-passphrase=zzz', () => {
setupTest()
.command([
'transaction:create:multisignature',
nonce,
fee,
`--member-passphrase=yyy`,
`--member-passphrase=zzz`,
'--member-passphrase=yyy',
'--member-passphrase=zzz',
])
.it('should create a multisignature transaction', () => {
expect(readerUtils.getPassphraseFromPrompt).to.be.calledWithExactly(
Expand Down
4 changes: 2 additions & 2 deletions commander/test/commands/transaction/sign.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ describe.skip('transaction:sign', () => {
`--passphrase=${anotherUserPassphrase}`,
`--mandatory-key=${KeyOne}`,
`--mandatory-key=${KeyTwo}`,
`--number-of-passphrases=2`,
'--number-of-passphrases=2',
])
.catch(error => {
return expect(error.message).to.contain(
Expand Down Expand Up @@ -258,7 +258,7 @@ describe.skip('transaction:sign', () => {
JSON.stringify(signedTransaction),
`--mandatory-key=${mandatoryKey}`,
`--optional-key=${optionalKey}`,
`--number-of-passphrases=2`,
'--number-of-passphrases=2',
])
.it(
'should take transaction from arg, passphrase from prompt and rest of of the flags mandatoryKey, optionalKey and numberOfSignature to sign',
Expand Down
2 changes: 1 addition & 1 deletion commander/test/utils/core/commons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ describe('commons core utils', () => {
});

it('should not throw error if url is valid', () => {
return expect(validURL(`https://downloads.lisk.io/lisk/`)).not.to.throw;
return expect(validURL('https://downloads.lisk.io/lisk/')).not.to.throw;
});
});

Expand Down
1 change: 1 addition & 0 deletions elements/lisk-api-client/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist-node
jest.config.js
.eslintrc.js
24 changes: 12 additions & 12 deletions elements/lisk-api-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@
"axios": "0.19.2"
},
"devDependencies": {
"@types/jest": "25.1.3",
"@types/jest-when": "2.7.0",
"@typescript-eslint/eslint-plugin": "2.28.0",
"@typescript-eslint/parser": "2.28.0",
"eslint": "6.8.0",
"@types/jest": "26.0.3",
"@types/jest-when": "2.7.1",
"@typescript-eslint/eslint-plugin": "3.5.0",
"@typescript-eslint/parser": "3.5.0",
"eslint": "7.3.1",
"eslint-config-lisk-base": "1.2.2",
"eslint-config-prettier": "6.10.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jest": "23.8.2",
"jest": "25.1.0",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jest": "23.17.1",
"jest": "26.1.0",
"jest-extended": "0.11.5",
"jest-when": "2.7.0",
"jest-when": "2.7.2",
"prettier": "2.0.5",
"source-map-support": "0.5.16",
"ts-jest": "25.2.1",
"source-map-support": "0.5.19",
"ts-jest": "26.1.1",
"ts-node": "8.6.2",
"tsconfig-paths": "3.9.0",
"typescript": "3.8.3"
Expand Down
1 change: 1 addition & 0 deletions elements/lisk-bft/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist-node
jest.config.js
.eslintrc.js
24 changes: 12 additions & 12 deletions elements/lisk-bft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,25 @@
"@liskhq/lisk-dpos": "0.1.0-alpha.0",
"@types/debug": "4.1.5",
"@types/faker": "4.1.10",
"@types/jest": "25.1.3",
"@types/jest-when": "2.7.0",
"@types/jest": "26.0.3",
"@types/jest-when": "2.7.1",
"@types/jquery": "3.3.33",
"@typescript-eslint/eslint-plugin": "2.28.0",
"@typescript-eslint/parser": "2.28.0",
"eslint": "6.8.0",
"@typescript-eslint/eslint-plugin": "3.5.0",
"@typescript-eslint/parser": "3.5.0",
"eslint": "7.3.1",
"eslint-config-lisk-base": "1.2.2",
"eslint-config-prettier": "6.10.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jest": "23.8.2",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jest": "23.17.1",
"faker": "4.1.0",
"jest": "25.1.0",
"jest": "26.1.0",
"jest-extended": "0.11.5",
"jest-when": "2.7.0",
"jest-when": "2.7.2",
"prettier": "2.0.5",
"randomstring": "1.1.5",
"source-map-support": "0.5.16",
"source-map-support": "0.5.19",
"stampit": "4.3.1",
"ts-jest": "25.2.1",
"ts-jest": "26.1.1",
"ts-node": "8.6.2",
"tsconfig-paths": "3.9.0",
"typescript": "3.8.3"
Expand Down
2 changes: 1 addition & 1 deletion elements/lisk-bft/test/utils/state_store_mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Removal or modification of this copyright notice is prohibited.
*/

import { Account, BlockHeader } from "../../src/types";
import { Account, BlockHeader } from '../../src/types';

interface AccountStoreMock {
get: (address: Buffer) => Promise<Account>;
Expand Down
1 change: 1 addition & 0 deletions elements/lisk-chain/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist-node
jest.config.js
benchmark
.eslintrc.js
24 changes: 12 additions & 12 deletions elements/lisk-chain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,28 @@
"@liskhq/lisk-passphrase": "3.0.1-alpha.0",
"@types/debug": "4.1.5",
"@types/faker": "4.1.10",
"@types/jest": "25.1.3",
"@types/jest-when": "2.7.0",
"@types/jest": "26.0.3",
"@types/jest-when": "2.7.1",
"@types/lodash.clonedeep": "4.5.6",
"@types/lodash.isequal": "4.5.5",
"@types/randomstring": "1.1.6",
"@typescript-eslint/eslint-plugin": "2.28.0",
"@typescript-eslint/parser": "2.28.0",
"eslint": "6.8.0",
"@typescript-eslint/eslint-plugin": "3.5.0",
"@typescript-eslint/parser": "3.5.0",
"eslint": "7.3.1",
"eslint-config-lisk-base": "1.2.2",
"eslint-config-prettier": "6.10.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jest": "23.8.2",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jest": "23.17.1",
"faker": "4.1.0",
"fs-extra": "9.0.0",
"jest": "25.1.0",
"jest": "26.1.0",
"jest-extended": "0.11.5",
"jest-when": "2.7.0",
"jest-when": "2.7.2",
"prettier": "2.0.5",
"randomstring": "1.1.5",
"source-map-support": "0.5.16",
"source-map-support": "0.5.19",
"stampit": "4.3.1",
"ts-jest": "25.2.1",
"ts-jest": "26.1.1",
"ts-node": "8.6.2",
"tsconfig-paths": "3.9.0",
"typescript": "3.8.3"
Expand Down
4 changes: 0 additions & 4 deletions elements/lisk-chain/src/data_access/cache/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ import { BlockHeader } from '../../types';
import { Base } from './base';

export class BlockCache extends Base<BlockHeader> {
public constructor(minCachedItems: number, maxCachedItems: number) {
super(minCachedItems, maxCachedItems);
}

public add(blockHeader: BlockHeader): BlockHeader[] {
if (this.items.length) {
assert(
Expand Down
2 changes: 1 addition & 1 deletion elements/lisk-chain/src/state_store/account_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { BufferMap } from '../utils/buffer_map';
import { BufferSet } from '../utils/buffer_set';
import { DB_KEY_ACCOUNTS_ADDRESS } from '../data_access/constants';
import { keyString } from '../utils';
// eslint-disable-next-line @typescript-eslint/no-require-imports
// eslint-disable-next-line import/order
import cloneDeep = require('lodash.clonedeep');

interface AdditionalInformation {
Expand Down
2 changes: 1 addition & 1 deletion elements/lisk-chain/src/utils/buffer_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Removal or modification of this copyright notice is prohibited.
*/
import { keyString } from './buffer_string';
// eslint-disable-next-line @typescript-eslint/no-require-imports
// eslint-disable-next-line import/order
import cloneDeep = require('lodash.clonedeep');

export class BufferMap<V> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ describe('data_access', () => {

afterEach(() => {
// Clear block cache
// eslint-disable-next-line no-unused-expressions
(dataAccess as any)._blocksCache?.items?.shift();
jest.clearAllMocks();
});
Expand Down
4 changes: 2 additions & 2 deletions elements/lisk-chain/test/unit/process.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ describe('blocks/header', () => {
}),
) as never,
)
.calledWith(`chain:burntFee`)
.calledWith('chain:burntFee')
.mockResolvedValue(Buffer.from(JSON.stringify('100')) as never);
jest.spyOn(stateStore.chain, 'set');

Expand Down Expand Up @@ -699,7 +699,7 @@ describe('blocks/header', () => {
}),
) as never,
)
.calledWith(`chain:burntFee`)
.calledWith('chain:burntFee')
.mockResolvedValue(burntFeeBuffer as never);
await chainInstance.apply(block, stateStore);
});
Expand Down
1 change: 1 addition & 0 deletions elements/lisk-client/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist-node
dist-browser
jest.config.js
.eslintrc.js
Loading

0 comments on commit ea513d6

Please sign in to comment.