Skip to content

Commit df40eb0

Browse files
authored
fix: eslint errors (#243)
1 parent b873a62 commit df40eb0

File tree

7 files changed

+19
-8
lines changed

7 files changed

+19
-8
lines changed

.eslintrc.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1-
module.exports = { "extends": "airbnb-base" };
1+
module.exports = {
2+
"extends": "airbnb-base",
3+
env: {
4+
node: true
5+
},
6+
rules: {
7+
// Tweak rules set by airbnb config
8+
'no-console': 'off', // allow console
9+
'import/no-extraneous-dependencies': ["error", {"optionalDependencies": true}], // Allow optional dep import
10+
// Warn unresolved imports ie: idb-connector import will be unresolved when on non IBM i system.
11+
'import/no-unresolved': ['off', { commonjs: true }],
12+
},
13+
};

lib/transports/idbTransport.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
const idbCall = (config, xmlInput, cb) => {
1919
const {
2020
dbconn, dbstmt, IN, CLOB, CHAR, SQL_ATTR_DBC_SYS_NAMING, SQL_FALSE,
21+
// eslint-disable-next-line global-require
2122
} = require('idb-connector');
2223

2324
const {
@@ -67,7 +68,7 @@ const idbCall = (config, xmlInput, cb) => {
6768
conn.close();
6869

6970
cb(err, val);
70-
}
71+
};
7172

7273
stmt.prepare(sql, (prepareError) => {
7374
if (prepareError) {
@@ -101,7 +102,6 @@ const idbCall = (config, xmlInput, cb) => {
101102
xmlOutput += chunk.OUT151;
102103
});
103104
done(null, xmlOutput);
104-
return;
105105
});
106106
});
107107
});

lib/transports/sshTransport.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1717

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

2122
const {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"scripts": {
1111
"test": "./node_modules/mocha/bin/mocha --recursive test/unit",
1212
"test-integration": "./node_modules/mocha/bin/mocha --timeout 5s test/functional/*.js",
13+
"lint": "./node_modules/eslint/bin/eslint.js lib/ test/",
1314
"release": "standard-version"
1415
},
1516
"repository": {

test/functional/checkObjectExists.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
const lib = 'NODETKTEST';
22
const createLib = `CRTLIB LIB(${lib}) TYPE(*TEST) TEXT('Used to test Node.js toolkit')`;
33
const findLib = `SELECT SCHEMA_NAME FROM qsys2.sysschemas WHERE SCHEMA_NAME = '${lib}'`;
4-
const dataQueue = 'TESTQ';
5-
const dataArea = 'TESTDA';
64

75
function checkObjectExistsSSH(config, object = {}, callback) {
86
/* eslint-disable global-require */

test/functional/deprecated/iProdFunctional.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ describe('iProd Functional Tests', () => {
130130
// REST transport currently failing with 414 URI Too Long response code
131131
// The requested URL's length exceeds the capacity limit for this server
132132
describe('getInstalledProducts', () => {
133-
// eslint-disable-next-line func-names
134133
it('returns info for installed products', (done) => {
135134
const connection = new iConn(database, username, password, restOptions);
136135

test/functional/iDataQueueFunctional.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ describe('DataQueue Functional Tests', () => {
3434
checkObjectExists(config, dqName, '*DTAQ', (error) => {
3535
if (error) { throw error; }
3636

37-
checkObjectExists(config, dqName2, '*DTAQ', (error) => {
38-
if (error) { throw error; }
37+
checkObjectExists(config, dqName2, '*DTAQ', (error2) => {
38+
if (error2) { throw error2; }
3939
done();
4040
});
4141
});

0 commit comments

Comments
 (0)