Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
migrate jshint to eslint
configuration migration automated using https://github.com/brenolf/polyjuice.
find and replace used to switch jshint ignore comments for eslint disable comments.
  • Loading branch information
ChristianMurphy committed Sep 3, 2020
commit 83f5cfb32516940b283d47a614344c3e378527bc
40 changes: 40 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"env": {
"node": true,
"es6": true
},
"globals": {
"after": true,
"afterEach": true,
"before": true,
"beforeEach": true,
"define": true,
"describe": true,
"global": true,
"it": true
},
"rules": {
"no-cond-assign": [
"error",
"except-parens"
],
"curly": "error",
"no-eq-null": "error",
"no-eval": "error",
"max-len": [
"error",
{
"code": 80,
"ignoreComments": true
}
],
"no-proto": "error",
"quotes": [
"error",
"double"
],
"no-undef": "error",
"no-unused-vars": "error",
"no-invalid-this": "error"
}
}
31 changes: 0 additions & 31 deletions .jshintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

.astylerc
.editorconfig
.eslintrc.json
.gitignore
.gitmodules
.jshintrc
.travis.yml
appveyor.yml

Expand Down
10 changes: 5 additions & 5 deletions generate/templates/templates/nodegit.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ catch (ex) {
rawApi = require("../build/Debug/nodegit.node");
}

var promisify = fn => fn && util.promisify(fn); // jshint ignore:line
var promisify = fn => fn && util.promisify(fn); // eslint-disable-line

// For disccussion on why `cloneDeep` is required, see:
// https://github.com/facebook/jest/issues/3552
Expand All @@ -26,7 +26,7 @@ rawApi = _.cloneDeep(rawApi);

// Native methods do not return an identifiable function, so we
// have to override them here
/* jshint ignore:start */
/* eslint-disable */
{% each . as idef %}
{% if idef.type != "enum" %}

Expand Down Expand Up @@ -75,7 +75,7 @@ _FilterRegistry.register = promisify(_FilterRegistry_register);
var _FilterRegistry_unregister = _FilterRegistry.unregister;
_FilterRegistry.unregister = promisify(_FilterRegistry_unregister);

/* jshint ignore:end */
/* eslint-enable */

// Set the exports prototype to the raw API.
exports.__proto__ = rawApi;
Expand Down Expand Up @@ -110,7 +110,7 @@ importExtension("filter_registry");
importExtension("{{ filename }}");
{% endif %}
{% endeach %}
/* jshint ignore:start */
/* eslint-disable */
{% each . as idef %}
{% if idef.type != "enum" %}
{% each idef.functions as fn %}
Expand All @@ -132,7 +132,7 @@ importExtension("filter_registry");
{% endeach %}
{% endif %}
{% endeach %}
/* jshint ignore:end */
/* eslint-enable */

// Set version.
exports.version = require("../package").version;
Expand Down
4 changes: 2 additions & 2 deletions lib/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -950,11 +950,11 @@ Repository.prototype.discardLines =
.then(function(_filterList) {
filterList = _filterList;
if (filterList) {
/* jshint ignore:start */
/* eslint-disable */
// We need the constructor for the check in NodeGit's C++ layer
// to accept an object, and this seems to be a nice way to do it
return filterList.applyToData(new String(newContent));
/* jshint ignore:end */
/* eslint-enable */
}

return newContent;
Expand Down
Loading