mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Fix eslint and add back standard (#1928)
* lint: Enable standard rules again * lint: Replace hasOwnProperty(...) call * lint: Remove trailing spaces * lint: Remove spaces within array brackets * lint: Disable quote-props to silence linter * lint: Skip linting on older node versions
This commit is contained in:
parent
0894a3ce07
commit
3ead900349
@ -3,6 +3,7 @@
|
||||
"node"
|
||||
],
|
||||
"extends": [
|
||||
"standard",
|
||||
"eslint:recommended",
|
||||
"plugin:node/recommended"
|
||||
],
|
||||
|
||||
4
Makefile
4
Makefile
@ -62,4 +62,6 @@ test-pool:
|
||||
|
||||
lint:
|
||||
@echo "***Starting lint***"
|
||||
node_modules/.bin/eslint lib
|
||||
node -e "process.exit(Number(process.versions.node.split('.')[0]) < 8 ? 0 : 1)" \
|
||||
&& echo "***Skipping lint (node version too old)***" \
|
||||
|| node_modules/.bin/eslint lib
|
||||
|
||||
@ -15,11 +15,11 @@ var parse = require('pg-connection-string').parse // parses a connection string
|
||||
|
||||
var val = function (key, config, envVar) {
|
||||
if (envVar === undefined) {
|
||||
envVar = process.env[ 'PG' + key.toUpperCase() ]
|
||||
envVar = process.env['PG' + key.toUpperCase()]
|
||||
} else if (envVar === false) {
|
||||
// do nothing ... use false
|
||||
} else {
|
||||
envVar = process.env[ envVar ]
|
||||
envVar = process.env[envVar]
|
||||
}
|
||||
|
||||
return config[key] ||
|
||||
|
||||
@ -604,7 +604,7 @@ Connection.prototype.parseE = function (buffer, length) {
|
||||
msg = new Error(fields.M)
|
||||
for (item in input) {
|
||||
// copy input properties to the error
|
||||
if (input.hasOwnProperty(item)) {
|
||||
if (Object.prototype.hasOwnProperty.call(input, item)) {
|
||||
msg[item] = input[item]
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ module.exports = {
|
||||
ssl: false,
|
||||
|
||||
application_name: undefined,
|
||||
|
||||
|
||||
fallback_application_name: undefined,
|
||||
|
||||
parseInputDatesAsUTC: false,
|
||||
|
||||
@ -35,6 +35,7 @@ var NativeQuery = module.exports = function (config, values, callback) {
|
||||
util.inherits(NativeQuery, EventEmitter)
|
||||
|
||||
var errorFieldMap = {
|
||||
/* eslint-disable quote-props */
|
||||
'sqlState': 'code',
|
||||
'statementPosition': 'position',
|
||||
'messagePrimary': 'message',
|
||||
|
||||
@ -31,8 +31,12 @@
|
||||
"async": "0.9.0",
|
||||
"bluebird": "3.5.2",
|
||||
"co": "4.6.0",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-plugin-node": "^6.0.1",
|
||||
"eslint": "^6.0.1",
|
||||
"eslint-config-standard": "^13.0.1",
|
||||
"eslint-plugin-import": "^2.18.1",
|
||||
"eslint-plugin-node": "^9.1.0",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.0",
|
||||
"pg-copy-streams": "0.3.0"
|
||||
},
|
||||
"minNativeVersion": "2.0.0",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user