Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies, fix new eslint errors #3339

Merged
merged 2 commits into from
Jul 10, 2019
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
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"commander": "^2.20.0",
"debug": "4.1.1",
"getopts": "2.2.4",
"inherits": "~2.0.3",
"inherits": "~2.0.4",
"interpret": "^1.2.0",
"liftoff": "3.1.0",
"lodash": "^4.17.11",
Expand All @@ -50,20 +50,20 @@
]
},
"devDependencies": {
"@types/node": "^10.14.9",
"@types/node": "^10.14.12",
"JSONStream": "^1.3.5",
"chai": "^4.2.0",
"chai-subset-in-order": "^2.1.3",
"cli-testlab": "^1.7.0",
"coveralls": "^3.0.4",
"cross-env": "^5.2.0",
"dtslint": "^0.8.0",
"eslint": "5.16.0",
"eslint-config-prettier": "^5.0.0",
"eslint-plugin-import": "^2.17.3",
"husky": "^2.4.1",
"eslint": "^6.0.1",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.18.0",
"husky": "^3.0.0",
"jake": "^8.1.1",
"lint-staged": "^8.2.1",
"lint-staged": "^9.1.0",
"mocha": "^6.1.4",
"mock-fs": "^4.10.1",
"mssql": "^5.1.0",
Expand All @@ -79,10 +79,10 @@
"source-map-support": "^0.5.12",
"sqlite3": "^4.0.9",
"tap-spec": "^5.0.0",
"tape": "^4.10.2",
"tape": "^4.11.0",
"toxiproxy-node-client": "^2.0.6",
"typescript": "^3.5.2",
"webpack-cli": "^3.3.4"
"webpack-cli": "^3.3.5"
},
"buildDependencies": [
"rimraf"
Expand Down
7 changes: 3 additions & 4 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ function containsUndefined(mixed) {
argContainsUndefined = this.containsUndefined(mixed[i]);
}
} else if (isPlainObject(mixed)) {
for (const key in mixed) {
if (mixed.hasOwnProperty(key)) {
if (argContainsUndefined) break;
Object.keys(mixed).forEach((key) => {
if (!argContainsUndefined) {
argContainsUndefined = this.containsUndefined(mixed[key]);
}
}
});
} else {
argContainsUndefined = isUndefined(mixed);
}
Expand Down
2 changes: 1 addition & 1 deletion src/query/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ assign(QueryCompiler.prototype, {
while (++i < wheres.length) {
const stmt = wheres[i];
if (
stmt.hasOwnProperty('value') &&
Object.prototype.hasOwnProperty.call(stmt, 'value') &&
helpers.containsUndefined(stmt.value)
) {
this._undefinedInWhereClause = true;
Expand Down
2 changes: 1 addition & 1 deletion src/raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function replaceKeyBindings(raw, formatter) {
const value = values[part];

if (value === undefined) {
if (values.hasOwnProperty(part)) {
if (Object.prototype.hasOwnProperty.call(values, part)) {
formatter.bindings.push(value);
}

Expand Down
7 changes: 5 additions & 2 deletions src/schema/columncompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ColumnCompiler.prototype._defaultMap = {
};

ColumnCompiler.prototype.defaults = function(label) {
if (this._defaultMap.hasOwnProperty(label)) {
if (Object.prototype.hasOwnProperty.call(this._defaultMap, label)) {
return this._defaultMap[label].bind(this)();
} else {
throw new Error(
Expand Down Expand Up @@ -154,7 +154,10 @@ ColumnCompiler.prototype.defaultTo = function(value) {
} else if (this.type === 'bool') {
if (value === 'false') value = 0;
value = `'${value ? 1 : 0}'`;
} else if ((this.type === 'json' || this.type === 'jsonb') && isObject(value)) {
} else if (
(this.type === 'json' || this.type === 'jsonb') &&
isObject(value)
) {
value = `'${JSON.stringify(value)}'`;
} else {
value = `'${value}'`;
Expand Down
2 changes: 0 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*global describe*/

'use strict';

require('source-map-support').install();
Expand Down
14 changes: 8 additions & 6 deletions test/integration/builder/additional.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, expect, it*/
/*global expect*/
/*eslint no-var:0, max-len:0 */
'use strict';

Expand Down Expand Up @@ -679,7 +679,7 @@ module.exports = function(knex) {
},
};

if (!testQueries.hasOwnProperty(driverName)) {
if (!Object.prototype.hasOwnProperty.call(testQueries, driverName)) {
throw new Error('Missing test query for driver: ' + driverName);
}

Expand Down Expand Up @@ -732,7 +732,7 @@ module.exports = function(knex) {
},
};

if (!testQueries.hasOwnProperty(driverName)) {
if (!Object.prototype.hasOwnProperty.call(testQueries, driverName)) {
throw new Error('Missing test query for driverName: ' + driverName);
}

Expand Down Expand Up @@ -765,7 +765,9 @@ module.exports = function(knex) {
},
};

if (!getProcessesQueries.hasOwnProperty(driverName)) {
if (
!Object.prototype.hasOwnProperty.call(getProcessesQueries, driverName)
) {
throw new Error('Missing test query for driverName: ' + driverName);
}

Expand Down Expand Up @@ -849,7 +851,7 @@ module.exports = function(knex) {
},
};

if (!testQueries.hasOwnProperty(driverName)) {
if (!Object.prototype.hasOwnProperty.call(testQueries, driverName)) {
throw new Error('Missing test query for dialect: ' + driverName);
}

Expand Down Expand Up @@ -891,7 +893,7 @@ module.exports = function(knex) {
pg: (sleepSeconds) => `SELECT pg_sleep(${sleepSeconds})`,
};

if (!rawTestQueries.hasOwnProperty(driverName)) {
if (!Object.prototype.hasOwnProperty.call(rawTestQueries, driverName)) {
throw new Error('Missing test query for driverName: ' + driverName);
}

Expand Down
2 changes: 0 additions & 2 deletions test/integration/builder/aggregate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*global describe, it*/

'use strict';

module.exports = function(knex) {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/builder/deletes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, d, it*/
/*global d*/

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/integration/builder/inserts.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, expect, it, d*/
/*global expect, d*/

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/integration/builder/joins.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, it, d*/
/*global d*/

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/integration/builder/selects.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, expect, it, d*/
/*global expect, d*/
'use strict';

const _ = require('lodash');
Expand Down
2 changes: 1 addition & 1 deletion test/integration/builder/transaction.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, expect, it*/
/*global expect*/

'use strict';

Expand Down
2 changes: 0 additions & 2 deletions test/integration/builder/unions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*global describe, it*/

'use strict';

const expect = require('chai').expect;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/builder/updates.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, expect, it, d*/
/*global expect, d*/

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/integration/datatype/bigint.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global it, expect*/
/*global expect*/

'use strict';

Expand Down
2 changes: 0 additions & 2 deletions test/integration/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*global after*/

'use strict';

const knex = require('../../knex');
Expand Down
2 changes: 1 addition & 1 deletion test/integration/migrate/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global after, before, describe, expect, it*/
/*global expect*/
'use strict';

const equal = require('assert').equal;
Expand Down
24 changes: 13 additions & 11 deletions test/integration/schema/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, it, expect, before, after*/
/*global expect*/

'use strict';

Expand Down Expand Up @@ -473,24 +473,26 @@ module.exports = function(knex) {
'alter table "test_table_three" add constraint "test_table_three_pkey" primary key ("main")',
]);
tester('mssql', [
'CREATE TABLE [test_table_three] ([main] int not null, [paragraph] nvarchar(max) default \'Lorem ipsum Qui quis qui in.\', [metadata] text default \'{"a":10}\', CONSTRAINT [test_table_three_pkey] PRIMARY KEY ([main]))',
"CREATE TABLE [test_table_three] ([main] int not null, [paragraph] nvarchar(max) default 'Lorem ipsum Qui quis qui in.', [metadata] text default '{\"a\":10}', CONSTRAINT [test_table_three_pkey] PRIMARY KEY ([main]))",
]);
})
.then(function () {
return knex('test_table_three').insert([{
main: 1
}])
.then(function() {
return knex('test_table_three').insert([
{
main: 1,
},
]);
})
.then(function() {
return knex('test_table_three').where({main: 1}).first()
return knex('test_table_three')
.where({ main: 1 })
.first();
})
.then(function(result) {
expect(result.main).to.equal(1);
if (!knex.client.driverName.match(/^mysql/)) {
// MySQL doesn't support default values in text columns
expect(result.paragraph).to.eql(
'Lorem ipsum Qui quis qui in.'
);
expect(result.paragraph).to.eql('Lorem ipsum Qui quis qui in.');
return;
}
if (knex.client.driverName === 'pg') {
Expand All @@ -501,7 +503,7 @@ module.exports = function(knex) {
} else {
expect(result.metadata).to.eql(defaultMetadata);
}
})
});
});

it('handles numeric length correctly', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/seed/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, it, expect*/
/*global expect*/
'use strict';

const path = require('path');
Expand Down
2 changes: 1 addition & 1 deletion test/integration/suite.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global expect, describe, it*/
/*global expect*/

'use strict';

Expand Down
1 change: 0 additions & 1 deletion test/unit/interface.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/*global describe, it*/
const _interface = require('../../src/interface');
const chai = require('chai');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/knex.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ describe('knex', () => {

it('supports accessing execution promise from transaction with a callback', async () => {
const knex = Knex(sqliteConfig);
const trxPromise = new Promise(async (resolve, reject) => {
const trxPromise = new Promise((resolve, reject) => {
knex.transaction((transaction) => {
resolve(transaction);
});
Expand Down
1 change: 0 additions & 1 deletion test/unit/migrate/migration-list-resolver.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*global after, before, describe, it*/
/*eslint no-var:0, indent:0, max-len:0 */
'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/unit/query/builder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global expect, describe, it*/
/*global expect*/
/*eslint no-var:0, indent:0, max-len:0 */
'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/unit/schema/mssql.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, expect, it*/
/*global expect*/

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/unit/schema/mysql.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, expect, it*/
/*global expect*/

const sinon = require('sinon');
const MySQL_Client = require('../../../src/dialects/mysql');
Expand Down
2 changes: 1 addition & 1 deletion test/unit/schema/oracle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global it, describe, expect*/
/*global expect*/

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/unit/schema/oracledb.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global it, describe, expect*/
/*global expect*/

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/unit/schema/postgres.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, expect, it*/
/*global expect*/

let tableSql;

Expand Down
2 changes: 1 addition & 1 deletion test/unit/schema/redshift.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, expect, it*/
/*global expect*/
/* eslint max-len:0 */

'use strict';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/schema/sqlite3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global describe, expect, it*/
/*global expect*/

'use strict';

Expand Down
2 changes: 1 addition & 1 deletion test/unit/seed/seeder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global after, before, beforeEach, expect, describe, it*/
/*global expect*/
/*eslint no-var:0, indent:0, max-len:0 */
'use strict';

Expand Down
1 change: 0 additions & 1 deletion test/unit/util/save-async-stack.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/*global describe, it*/
const saveAsyncStack = require('../../../src/util/save-async-stack');
const chai = require('chai');

Expand Down