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

Commit

Permalink
💅 Update eslint settings to match template
Browse files Browse the repository at this point in the history
  • Loading branch information
shuse2 committed Mar 8, 2018
1 parent a38e376 commit 07d6281
Show file tree
Hide file tree
Showing 41 changed files with 973 additions and 852 deletions.
11 changes: 3 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
{
"extends": ["lisk-base"],
"plugins": ["mocha"],
"globals": {
"naclInstance": true
},
"rules": {
"arrow-parens": ["error", "as-needed"],
"curly": "off",
"indent": "off",
"no-confusing-arrow": "off",
"no-mixed-operators": "off",
"import/no-extraneous-dependencies": [
"error", {
"devDependencies": [
Expand All @@ -21,6 +13,9 @@
}
]
},
"globals": {
"naclInstance": true
},
"settings": {
"import/resolver": {
"node": {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@
"coveralls": "=3.0.0",
"cypress": "=2.0.2",
"eslint": "=4.16.0",
"eslint-config-airbnb-base": "=11.3.1",
"eslint-config-lisk-base": "=0.1.0",
"eslint-plugin-import": "=2.7.0",
"eslint-config-airbnb-base": "=12.1.0",
"eslint-config-lisk-base": "=1.0.0",
"eslint-plugin-import": "=2.8.0",
"eslint-plugin-mocha": "=4.11.0",
"http-server": "=0.10.0",
"husky": "=0.14.3",
Expand Down
2 changes: 1 addition & 1 deletion src/transactions/1_registerSecondPassphrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* Removal or modification of this copyright notice is prohibited.
*
*/
import cryptography from 'cryptography';
import { SIGNATURE_FEE } from 'constants';
import cryptography from 'cryptography';
import { wrapTransactionCreator } from './utils';

const registerSecondPassphrase = ({ secondPassphrase }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/transactions/3_castVotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* Removal or modification of this copyright notice is prohibited.
*
*/
import cryptography from 'cryptography';
import { VOTE_FEE } from 'constants';
import cryptography from 'cryptography';
import {
prependMinusToPublicKeys,
prependPlusToPublicKeys,
Expand Down
2 changes: 1 addition & 1 deletion src/transactions/utils/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* Removal or modification of this copyright notice is prohibited.
*
*/
import { MAX_ADDRESS_NUMBER } from 'constants';
import bignum from 'browserify-bignum';
import { hexToBuffer } from 'cryptography/convert';
import { MAX_ADDRESS_NUMBER } from 'constants';

export const validatePublicKey = publicKey => {
const publicKeyBuffer = hexToBuffer(publicKey);
Expand Down
2 changes: 1 addition & 1 deletion test/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"plugins": ["mocha"],
"env": {
"mocha": true
},
Expand All @@ -24,3 +23,4 @@
}
}
}

3 changes: 2 additions & 1 deletion test/_globalHooks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable mocha/no-top-level-hooks */
afterEach(() => {
sandbox.restore();
return sandbox.restore();
});
4 changes: 4 additions & 0 deletions test/api/apiMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ describe('API method module', () => {
handleRetry: () => {},
};
validationError = new Error('No data');
return Promise.resolve();
});

describe('#apiMethod', () => {
describe('when no parameters are passed', () => {
beforeEach(() => {
handler = apiMethod().bind(resource);
return Promise.resolve();
});

it('should return function', () => {
Expand Down Expand Up @@ -91,6 +93,7 @@ describe('API method module', () => {
},
retry: true,
}).bind(resource);
return Promise.resolve();
});

it('should return function', () => {
Expand Down Expand Up @@ -152,6 +155,7 @@ describe('API method module', () => {
sort: 'id',
},
}).bind(resource);
return Promise.resolve();
});

it('should return a function', () => {
Expand Down
9 changes: 7 additions & 2 deletions test/api/apiResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

import APIResource from 'api/apiResource';

// Require is used for stubbing
const popsicle = require('popsicle');

describe('API resource module', () => {
Expand Down Expand Up @@ -52,6 +52,7 @@ describe('API resource module', () => {
banActiveNodeAndSelect: sandbox.stub(),
};
resource = new APIResource(LiskAPI);
return Promise.resolve();
});

describe('#constructor', () => {
Expand Down Expand Up @@ -94,6 +95,7 @@ describe('API resource module', () => {
use: () => Promise.resolve(sendRequestResult),
});
handleRetryStub = sandbox.stub(resource, 'handleRetry');
return Promise.resolve();
});

it('should make a request to API without calling retry', () => {
Expand Down Expand Up @@ -130,6 +132,7 @@ describe('API resource module', () => {
requestStub = sandbox
.stub(resource, 'request')
.returns(Promise.resolve(sendRequestResult.body));
return Promise.resolve();
});

describe('when there is available node', () => {
Expand All @@ -138,10 +141,11 @@ describe('API resource module', () => {
beforeEach(() => {
clock = sinon.useFakeTimers();
LiskAPI.hasAvailableNodes = () => true;
return Promise.resolve();
});

afterEach(() => {
clock.restore();
return clock.restore();
});

it('should call banActiveNode when randomizeNodes is true', () => {
Expand Down Expand Up @@ -170,6 +174,7 @@ describe('API resource module', () => {
describe('when there is no available node', () => {
beforeEach(() => {
LiskAPI.hasAvailableNodes = () => false;
return Promise.resolve();
});

it('should resolve with failure response', () => {
Expand Down

0 comments on commit 07d6281

Please sign in to comment.