Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
module.exports = { "extends": "airbnb-base" };
module.exports = {
"extends": "airbnb-base",
env: {
node: true
},
rules: {
// Tweak rules set by airbnb config
'no-console': 'off', // allow console
'import/no-extraneous-dependencies': ["error", {"optionalDependencies": true}], // Allow optional dep import
// Warn unresolved imports ie: idb-connector import will be unresolved when on non IBM i system.
'import/no-unresolved': ['off', { commonjs: true }],
},
};
4 changes: 2 additions & 2 deletions lib/transports/idbTransport.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
const idbCall = (config, xmlInput, cb) => {
const {
dbconn, dbstmt, IN, CLOB, CHAR, SQL_ATTR_DBC_SYS_NAMING, SQL_FALSE,
// eslint-disable-next-line global-require
} = require('idb-connector');

const {
Expand Down Expand Up @@ -67,7 +68,7 @@ const idbCall = (config, xmlInput, cb) => {
conn.close();

cb(err, val);
}
};

stmt.prepare(sql, (prepareError) => {
if (prepareError) {
Expand Down Expand Up @@ -101,7 +102,6 @@ const idbCall = (config, xmlInput, cb) => {
xmlOutput += chunk.OUT151;
});
done(null, xmlOutput);
return;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes

../nodejs-itoolkit/lib/transports/idbTransport.js
  104:11  error  Unnecessary return statement             no-useless-return

});
});
});
Expand Down
1 change: 1 addition & 0 deletions lib/transports/sshTransport.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

function sshCall(config, xmlIn, done) {
// eslint-disable-next-line global-require
const { Client } = require('ssh2');

const {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"scripts": {
"test": "./node_modules/mocha/bin/mocha --recursive test/unit",
"test-integration": "./node_modules/mocha/bin/mocha --timeout 5s test/functional/*.js",
"lint": "./node_modules/eslint/bin/eslint.js lib/ test/",
"release": "standard-version"
},
"repository": {
Expand Down
2 changes: 0 additions & 2 deletions test/functional/checkObjectExists.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const lib = 'NODETKTEST';
const createLib = `CRTLIB LIB(${lib}) TYPE(*TEST) TEXT('Used to test Node.js toolkit')`;
const findLib = `SELECT SCHEMA_NAME FROM qsys2.sysschemas WHERE SCHEMA_NAME = '${lib}'`;
const dataQueue = 'TESTQ';
Copy link
Member Author

@abmusse abmusse Apr 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes

../nodejs-itoolkit/test/functional/checkObjectExists.js
    4:7   error  'dataQueue' is assigned a value but never used          no-unused-vars

    5:7   error  'dataArea' is assigned a value but never used           no-unused-vars

const dataArea = 'TESTDA';

function checkObjectExistsSSH(config, object = {}, callback) {
/* eslint-disable global-require */
Expand Down
1 change: 0 additions & 1 deletion test/functional/deprecated/iProdFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ describe('iProd Functional Tests', () => {
// REST transport currently failing with 414 URI Too Long response code
// The requested URL's length exceeds the capacity limit for this server
describe('getInstalledProducts', () => {
// eslint-disable-next-line func-names
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this.

it('returns info for installed products', (done) => {
const connection = new iConn(database, username, password, restOptions);

Expand Down
4 changes: 2 additions & 2 deletions test/functional/iDataQueueFunctional.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ describe('DataQueue Functional Tests', () => {
checkObjectExists(config, dqName, '*DTAQ', (error) => {
if (error) { throw error; }

checkObjectExists(config, dqName2, '*DTAQ', (error) => {
if (error) { throw error; }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes

../nodejs-itoolkit/test/functional/iDataQueueFunctional.js
  37:52  error  'error' is already declared in the upper scope  no-shadow

checkObjectExists(config, dqName2, '*DTAQ', (error2) => {
if (error2) { throw error2; }
done();
});
});
Expand Down