Fix Linting Issues

Signed-off-by: Brett Logan <lindluni@github.com>
This commit is contained in:
Brett Logan 2021-02-08 10:00:05 -05:00 committed by denyeart
parent 2907329c20
commit 41bb1d0b5c
2 changed files with 33 additions and 32 deletions

View file

@ -1,36 +1,37 @@
/* /*
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
'use strict';
module.exports = { module.exports = {
env: { env: {
node: true, node: true,
mocha: true mocha: true
}, },
parserOptions: { parserOptions: {
ecmaVersion: 8, ecmaVersion: 8,
sourceType: 'script' sourceType: 'script'
}, },
extends: "eslint:recommended", extends: 'eslint:recommended',
rules: { rules: {
indent: ['error', 'tab'], indent: ['error', 'tab'],
'linebreak-style': ['error', 'unix'], 'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'], quotes: ['error', 'single'],
semi: ['error', 'always'], semi: ['error', 'always'],
'no-unused-vars': ['error', { args: 'none' }], 'no-unused-vars': ['error', { args: 'none' }],
'no-console': 'off', 'no-console': 'off',
curly: 'error', curly: 'error',
eqeqeq: 'error', eqeqeq: 'error',
'no-throw-literal': 'error', 'no-throw-literal': 'error',
strict: 'error', strict: 'error',
'no-var': 'error', 'no-var': 'error',
'dot-notation': 'error', 'dot-notation': 'error',
'no-trailing-spaces': 'error', 'no-trailing-spaces': 'error',
'no-use-before-define': 'error', 'no-use-before-define': 'error',
'no-useless-call': 'error', 'no-useless-call': 'error',
'no-with': 'error', 'no-with': 'error',
'operator-linebreak': 'error', 'operator-linebreak': 'error',
yoda: 'error', yoda: 'error',
'quote-props': ['error', 'as-needed'] 'quote-props': ['error', 'as-needed']
} }
}; };

View file

@ -129,7 +129,7 @@ async function main() {
console.log('*** Result: committed'); console.log('*** Result: committed');
} catch (initError) { } catch (initError) {
// this is error is OK if we are rerunning this app without restarting // this is error is OK if we are rerunning this app without restarting
console.log(`******** initLedger failed :: ${initError}`) console.log(`******** initLedger failed :: ${initError}`);
} }
} else { } else {
console.log('*** not executing "InitLedger'); console.log('*** not executing "InitLedger');
@ -179,7 +179,7 @@ async function main() {
console.log('\n--> Evaluate Transaction: AssetExists, function returns "false" if an asset with ID(asset7) does not exist'); console.log('\n--> Evaluate Transaction: AssetExists, function returns "false" if an asset with ID(asset7) does not exist');
result = await contract.evaluateTransaction('AssetExists', 'asset7'); result = await contract.evaluateTransaction('AssetExists', 'asset7');
console.log(`*** Result: ${prettyJSONString(result.toString())}`) console.log(`*** Result: ${prettyJSONString(result.toString())}`);
console.log('\n--> Submit Transaction: TransferAsset, transfer asset(asset2) to new owner(Tom)'); console.log('\n--> Submit Transaction: TransferAsset, transfer asset(asset2) to new owner(Tom)');
await contract.submitTransaction('TransferAsset', 'asset2', 'Tom'); await contract.submitTransaction('TransferAsset', 'asset2', 'Tom');