Skip to content

Commit

Permalink
fix: eslint errors (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
abmusse committed Apr 17, 2020
1 parent b873a62 commit df40eb0
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 8 deletions.
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;
});
});
});
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';
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 @@ -130,7 +130,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
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; }
checkObjectExists(config, dqName2, '*DTAQ', (error2) => {
if (error2) { throw error2; }
done();
});
});
Expand Down

0 comments on commit df40eb0

Please sign in to comment.