Commit 20337bc1 by Tom MacWright

Add basic eslint configuration

parent 75a06bf9
module.exports = {
"extends": "eslint:recommended",
"env": {
"node": true
},
"rules": {
"indent": ["error", 4],
"linebreak-style": ["error", "unix"],
"semi": ["error", "always"],
"no-cond-assign": ["error", "always"]
}
}
......@@ -19,12 +19,12 @@ function normalizeMethod (fn) {
}
var statement = new Statement(this, sql, errBack);
return fn.call(this, statement, args);
}
};
}
function inherits(target, source) {
for (var k in source.prototype)
target.prototype[k] = source.prototype[k];
for (var k in source.prototype)
target.prototype[k] = source.prototype[k];
}
sqlite3.cached = {
......@@ -34,17 +34,18 @@ sqlite3.cached = {
return new Database(file, a, b);
}
var db;
file = path.resolve(file);
function cb() { callback.call(db, null); }
if (!sqlite3.cached.objects[file]) {
var db =sqlite3.cached.objects[file] = new Database(file, a, b);
db = sqlite3.cached.objects[file] = new Database(file, a, b);
}
else {
// Make sure the callback is called.
var db = sqlite3.cached.objects[file];
db = sqlite3.cached.objects[file];
var callback = (typeof a === 'number') ? b : a;
if (typeof callback === 'function') {
function cb() { callback.call(db, null); }
if (db.open) process.nextTick(cb);
else db.once('open', cb);
}
......@@ -114,7 +115,7 @@ Statement.prototype.map = function() {
} else {
var value = keys[1];
// Value is a plain value
for (var i = 0; i < rows.length; i++) {
for (i = 0; i < rows.length; i++) {
result[rows[i][key]] = rows[i][value];
}
}
......
// Inspired by https://github.com/tlrobinson/long-stack-traces
var EventEmitter = require('events').EventEmitter;
var util = require('util');
function extendTrace(object, property, pos) {
......
{
"name": "sqlite3",
"description": "Asynchronous, non-blocking SQLite3 bindings",
"version": "3.1.7",
"homepage": "http://github.com/mapbox/node-sqlite3",
"author": {
"name": "MapBox",
"url": "https://mapbox.com/"
},
"binary": {
"module_name" : "node_sqlite3",
"module_path" : "./lib/binding/{node_abi}-{platform}-{arch}",
"host" : "https://mapbox-node-binary.s3.amazonaws.com",
"remote_path" : "./{name}/v{version}/{toolset}/",
"package_name": "{node_abi}-{platform}-{arch}.tar.gz"
},
"contributors": [
"Konstantin Käfer <mail@kkaefer.com>",
"Dane Springmeyer <dane@mapbox.com>",
"Will White <will@mapbox.com>",
"Orlando Vazquez <ovazquez@gmail.com>",
"Artem Kustikov <kustikoff@gmail.com>",
"Eric Fredricksen <efredricksen@gmail.com>",
"John Wright <mrjjwright@gmail.com>",
"Ryan Dahl <ry@tinyclouds.org>",
"Tom MacWright <tom@mapbox.com>",
"Carter Thaxton <carter.thaxton@gmail.com>",
"Audrius Kažukauskas <audrius@neutrino.lt>",
"Johannes Schauer <josch@pyneo.org>",
"Nathan Rajlich <nathan@tootallnate.net>",
"AJ ONeal <coolaj86@gmail.com>",
"Mithgol",
"Ben Noordhuis <ben@strongloop.com>"
],
"repository": {
"type": "git",
"url": "git://github.com/mapbox/node-sqlite3.git"
},
"dependencies": {
"nan": "~2.4.0",
"node-pre-gyp": "~0.6.31"
},
"bundledDependencies": [
"node-pre-gyp"
],
"devDependencies": {
"mocha": "3.x",
"aws-sdk": "2.x"
},
"scripts": {
"prepublish":"npm ls",
"install": "node-pre-gyp install --fallback-to-build",
"pretest": "node test/support/createdb.js",
"test": "mocha -R spec --timeout 480000"
},
"license": "BSD-3-Clause",
"keywords": [
"sql",
"sqlite",
"sqlite3",
"database"
],
"main": "./lib/sqlite3"
"name": "sqlite3",
"description": "Asynchronous, non-blocking SQLite3 bindings",
"version": "3.1.7",
"homepage": "http://github.com/mapbox/node-sqlite3",
"author": {
"name": "MapBox",
"url": "https://mapbox.com/"
},
"binary": {
"module_name": "node_sqlite3",
"module_path": "./lib/binding/{node_abi}-{platform}-{arch}",
"host": "https://mapbox-node-binary.s3.amazonaws.com",
"remote_path": "./{name}/v{version}/{toolset}/",
"package_name": "{node_abi}-{platform}-{arch}.tar.gz"
},
"contributors": [
"Konstantin Käfer <mail@kkaefer.com>",
"Dane Springmeyer <dane@mapbox.com>",
"Will White <will@mapbox.com>",
"Orlando Vazquez <ovazquez@gmail.com>",
"Artem Kustikov <kustikoff@gmail.com>",
"Eric Fredricksen <efredricksen@gmail.com>",
"John Wright <mrjjwright@gmail.com>",
"Ryan Dahl <ry@tinyclouds.org>",
"Tom MacWright <tom@mapbox.com>",
"Carter Thaxton <carter.thaxton@gmail.com>",
"Audrius Kažukauskas <audrius@neutrino.lt>",
"Johannes Schauer <josch@pyneo.org>",
"Nathan Rajlich <nathan@tootallnate.net>",
"AJ ONeal <coolaj86@gmail.com>",
"Mithgol",
"Ben Noordhuis <ben@strongloop.com>"
],
"repository": {
"type": "git",
"url": "git://github.com/mapbox/node-sqlite3.git"
},
"dependencies": {
"nan": "~2.3.3",
"node-pre-gyp": "~0.6.28"
},
"devDependencies": {
"aws-sdk": "2.x",
"eslint": "3.5.0",
"mocha": "2.x"
},
"scripts": {
"prepublish": "npm ls",
"preinstall": "npm install node-pre-gyp",
"install": "node-pre-gyp install --fallback-to-build",
"pretest": "node test/support/createdb.js",
"test": "eslint lib && mocha -R spec --timeout 480000"
},
"license": "BSD-3-Clause",
"keywords": [
"sql",
"sqlite",
"sqlite3",
"database"
],
"main": "./lib/sqlite3"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment