Skip to content

Commit

Permalink
Other: More precise linter configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Mar 4, 2017
1 parent 58688c1 commit a7ab103
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 14 deletions.
10 changes: 9 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ engines:
ratings:
paths:
- "src/**.js"
exclude_paths:
- "lib/aspromise/**.js"
- "lib/base64/**.js"
- "lib/eventemitter/**.js"
- "lib/fetch/**.js"
- "lib/inquire/**.js"
- "lib/path/**.js"
- "lib/pool/**.js"
- "lib/utf8/**.js"
exclude_paths:
15 changes: 15 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bench/*
bin/*
cli/*
coverage/*
dist/*
docs/*
gulpfile.js
lib/deep-equal/*
lib/prelude.js
lib/polyfill.js
lib/tape-adapter.js
lib/tsd-jsdoc/*
sandbox/*
scripts/*
**/tests/*
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ addons:
apt:
sources: ubuntu-toolchain-r-test
packages: g++-4.8
code_climate:
repo_token: 20d88c0ad0ae53be53f48ef57cfec8ff6d8fc86381f742b50747335f3cebdc69

matrix:
include:
Expand Down
2 changes: 1 addition & 1 deletion bench/prof.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if (process.execArgv.indexOf("--prof") < 0) {
fs.unlink(file);
});
process.stdout.write("generating profile (may take a while) ...\n");
child_process.execSync("node --prof --trace-deopt " + process.execArgv.join(" ") + " " + process.argv.slice(1).join(' '), {
child_process.execSync("node --prof --trace-deopt " + process.execArgv.join(" ") + " " + process.argv.slice(1).join(" "), {
cwd: process.cwd(),
stdio: "inherit"
});
Expand Down
2 changes: 1 addition & 1 deletion bench/read.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function readString(bytes) {
readString(array);
})
.add("readString buffer", function() {
readString(buffer)
readString(buffer);
})
.add("toString buffer", function() {
buffer.toString("utf8", 0, buffer.length);
Expand Down
2 changes: 1 addition & 1 deletion bench/suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function newSuite(name) {
if (fastest.indexOf(bench) === 0)
return;
var hz = hz = getHz(bench);
var percent = (1 - (hz / fastestHz)) * 100;
var percent = (1 - hz / fastestHz) * 100;
process.stdout.write(chalk.white(pad(bench.name, padSize)) + " was " + chalk.red(percent.toFixed(1) + "% slower") + "\n");
});
}
Expand Down
6 changes: 3 additions & 3 deletions bench/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ buffer = new Buffer(1000);
writeString(array, 0, str);
})
.add("writeString buffer", function() {
writeString(buffer, 0, str)
writeString(buffer, 0, str);
})
.add("write buffer", function() {
buffer.write(str, 0)
buffer.write(str, 0);
})
.add("utf8Write buffer", function() {
buffer.utf8Write(str, 0)
buffer.utf8Write(str, 0);
})
/* .add("byteLength array", function() {
byteLength(str)
Expand Down
1 change: 1 addition & 0 deletions debug.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
"use strict";
module.exports = require("./src/index-debug");
4 changes: 2 additions & 2 deletions examples/streaming-rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ var root = protobuf.Root.fromJSON({
Greeter: {
methods: {
"SayHello": {
requestType: 'Hello',
requestType: "Hello",
requestStream: true,
responseType: 'World',
responseType: "World",
responseStream: true
}
}
Expand Down
1 change: 1 addition & 0 deletions light.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
"use strict";
module.exports = require("./src/index-light");
1 change: 1 addition & 0 deletions minimal.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
"use strict";
module.exports = require("./src/index-minimal");
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js tests/node/*.js",
"coverage-ci": "npm run coverage && cat coverage/lcov.info | coveralls",
"docs": "jsdoc -c jsdoc.docs.json -R README.md --verbose --pedantic",
"lint": "eslint src",
"lint": "eslint **/*.js",
"pages": "node scripts/pages",
"prepublish": "node scripts/prepublish",
"postinstall": "node scripts/postinstall",
Expand Down Expand Up @@ -65,7 +65,7 @@
"bundle-collapser": "^1.2.1",
"chalk": "^1.1.3",
"escodegen": "^1.8.1",
"eslint": "^3.16.1",
"eslint": "^3.17.0",
"espree": "^3.1.3",
"estraverse": "^4.2.0",
"gh-pages": "^0.12.0",
Expand All @@ -87,7 +87,7 @@
"tape": "^4.6.3",
"tmp": "0.0.31",
"typescript": "^2.2.1",
"uglify-js": "^2.8.4",
"uglify-js": "^2.8.5",
"vinyl-buffer": "^1.0.0",
"vinyl-fs": "^2.4.4",
"vinyl-source-stream": "^1.1.0"
Expand Down
1 change: 1 addition & 0 deletions runtime.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// deprecated - compatibility layer for v6.5 and earlier
"use strict";
module.exports = require("./minimal");
7 changes: 5 additions & 2 deletions tests/other_package.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use strict";
var tape = require("tape");

var protobuf = require(".."),
Expand All @@ -8,8 +9,10 @@ tape.test("package.json (reflected)", function(test) {
test.plan(2);

protobuf.load("tests/data/package.proto", function(err, root) {
if (err)
return test.fail(err.message);
if (err) {
test.fail(err.message);
return;
}

var Package = root.lookup("Package"),
Repository = root.lookup("Package.Repository");
Expand Down

0 comments on commit a7ab103

Please sign in to comment.