Skip to content

Commit 2f75b2f

Browse files
committed
Merge pull request brianc#256 from booo/jshint
Introduce Jshint
2 parents 0f925f6 + 22764e0 commit 2f75b2f

20 files changed

+484
-433
lines changed

.jshintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"trailing": true,
3+
"indent": 2
4+
}

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ params := $(connectionString)
66

77
node-command := xargs -n 1 -I file node file $(params)
88

9-
.PHONY : test test-connection test-integration bench test-native build/default/binding.node
9+
.PHONY : test test-connection test-integration bench test-native \
10+
build/default/binding.node jshint
1011

1112
help:
1213
@echo "make prepare-test-db [connectionString=pg://<your connection string>]"
1314
@echo "make test-all [connectionString=pg://<your connection string>]"
1415

1516
test: test-unit
1617

17-
test-all: test-unit test-integration test-native test-binary
18+
test-all: test-unit test-integration test-native test-binary jshint
1819

1920
bench:
2021
@find benchmark -name "*-bench.js" | $(node-command)
@@ -50,3 +51,6 @@ prepare-test-db:
5051
@echo "***Preparing the database for tests***"
5152
@find script/create-test-tables.js | $(node-command)
5253

54+
jshint:
55+
@echo "***Starting jshint***"
56+
@./node_modules/.bin/jshint lib

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ I will __happily__ accept your pull request if it:
115115
- _has tests_
116116
- looks reasonable
117117
- does not break backwards compatibility
118+
- satisfies jshint
119+
120+
Information about the testing processes is in the [wiki](https://github.com/brianc/node-postgres/wiki/Testing).
118121

119122
If you need help or have questions about constructing a pull request I'll be glad to help out as well.
120123

lib/arrayParser.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ ArrayParser.prototype.nextChar = function() {
2828
};
2929
}
3030
};
31-
ArrayParser.prototype.record = function(char) {
32-
return this.recorded.push(char);
31+
ArrayParser.prototype.record = function(c) {
32+
return this.recorded.push(c);
3333
};
3434
ArrayParser.prototype.newEntry = function(includeEmpty) {
3535
var entry;
@@ -47,7 +47,7 @@ ArrayParser.prototype.newEntry = function(includeEmpty) {
4747
};
4848
ArrayParser.prototype.parse = function(nested) {
4949
var c, p, quote;
50-
if (nested == null) {
50+
if (nested === null) {
5151
nested = false;
5252
}
5353
quote = false;
@@ -89,4 +89,4 @@ module.exports = {
8989
create: function(source, converter){
9090
return new ArrayParser(source, converter);
9191
}
92-
}
92+
};

0 commit comments

Comments
 (0)