New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ESLint and compatible with .jshintrc
#1338
base: master
Are you sure you want to change the base?
Conversation
.jshintrc
.jshintrc
.jshintrc
.jshintrc
.jshintrc
.jshintrc
# Conflicts: # generate/templates/templates/nodegit.js
This PR provides a smooth transition from |
Right now it is the most popular ES linter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer not to bring in gulp for this. Doesn't eslint provide good, descriptive output without gulp-reporter? Can we not use eslint via cmd line?
@@ -1,3 +1,5 @@ | |||
/* eslint no-unused-vars: "off" */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be worried about linting this generated file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is your plan about this? How about just remove this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disable lint from the entire file imo. Perhaps we could have a post generate linter?
So I have no qualms with using eslint, but I don't want to bring in any gulp packages. You'll need to update your push to use eslint on the CLI. |
$ eslint lib test/tests test/utils examples lifecycleScripts
E:\work\nodegit\lib\commit.js
28:66 error 'callback' is defined but never used no-unused-vars
E:\work\nodegit\lib\repository.js
640:65 error 'callback' is defined but never used no-unused-vars
1156:53 error 'payload' is defined but never used no-unused-vars
E:\work\nodegit\lib\tree_entry.js
92:37 error 'callback' is defined but never used no-unused-vars
E:\work\nodegit\lib\tree.js
126:32 error 'blobsOnly' is defined but never used no-unused-vars
162:45 error 'entryIndex' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\branch.js
115:22 error 'branch' is defined but never used no-unused-vars
118:19 error 'error' is defined but never used no-unused-vars
153:22 error 'branch' is defined but never used no-unused-vars
156:19 error 'error' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\checkout.js
31:20 error 'blob' is defined but never used no-unused-vars
126:20 error 'branch' is defined but never used no-unused-vars
149:20 error 'commit' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\clone.js
67:38 error 'progress' is defined but never used no-unused-vars
108:40 error 'progress' is defined but never used no-unused-vars
146:34 error 'progress' is defined but never used no-unused-vars
346:23 error 'reason' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\commit.js
33:52 error 'commitMessage' is defined but never used no-unused-vars
391:35 error 'commit' is defined but never used no-unused-vars
402:34 error 'err' is defined but never used no-unused-vars
464:41 error 'entry' is defined but never used no-unused-vars
472:39 error 'entries' is defined but never used no-unused-vars
679:9 error 'signature' is assigned a value but never used no-unused-vars
E:\work\nodegit\test\tests\config.js
51:24 error 'e' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\diff.js
232:33 error 'payload' is defined but never used no-unused-vars
265:33 error 'payload' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\filter.js
160:24 error 'result' is defined but never used no-unused-vars
270:23 error 'error' is defined but never used no-unused-vars
464:35 error 'source' is defined but never used no-unused-vars
510:35 error 'source' is defined but never used no-unused-vars
512:28 error 'buf' is defined but never used no-unused-vars
516:30 error 'attr' is defined but never used no-unused-vars
551:35 error 'source' is defined but never used no-unused-vars
553:28 error 'buf' is defined but never used no-unused-vars
557:30 error 'attr' is defined but never used no-unused-vars
593:35 error 'source' is defined but never used no-unused-vars
595:28 error 'buf' is defined but never used no-unused-vars
599:30 error 'attr' is defined but never used no-unused-vars
621:24 error 'oid' is defined but never used no-unused-vars
650:35 error 'source' is defined but never used no-unused-vars
652:28 error 'buf' is defined but never used no-unused-vars
656:30 error 'attr' is defined but never used no-unused-vars
679:24 error 'oid' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\merge.js
146:9 error 'theirCommit' is assigned a value but never used no-unused-vars
147:9 error 'ourBranch' is assigned a value but never used no-unused-vars
262:9 error 'theirCommit' is assigned a value but never used no-unused-vars
263:9 error 'ourBranch' is assigned a value but never used no-unused-vars
384:9 error 'ourCommit' is assigned a value but never used no-unused-vars
385:9 error 'theirCommit' is assigned a value but never used no-unused-vars
534:11 error 'ourCommit' is assigned a value but never used no-unused-vars
535:11 error 'theirCommit' is assigned a value but never used no-unused-vars
691:11 error 'ourCommit' is assigned a value but never used no-unused-vars
692:11 error 'theirCommit' is assigned a value but never used no-unused-vars
844:9 error 'theirCommit' is assigned a value but never used no-unused-vars
845:9 error 'ourBranch' is assigned a value but never used no-unused-vars
963:9 error 'ourCommit' is assigned a value but never used no-unused-vars
964:9 error 'theirCommit' is assigned a value but never used no-unused-vars
1110:9 error 'ourCommit' is assigned a value but never used no-unused-vars
1111:9 error 'theirCommit' is assigned a value but never used no-unused-vars
E:\work\nodegit\test\tests\note.js
62:14 error 'noteSha' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\rebase.js
77:28 error 'branch' is defined but never used no-unused-vars
476:22 error 'oid' is defined but never used no-unused-vars
728:28 error 'branch' is defined but never used no-unused-vars
1341:22 error 'oid' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\remote.js
285:40 error 'userName' is defined but never used no-unused-vars
321:40 error 'userName' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\repository.js
64:28 error 'isBare' is defined but never used no-unused-vars
E:\work\nodegit\test\tests\revwalk.js
111:11 error 'storedCommits' is assigned a value but never used no-unused-vars
E:\work\nodegit\test\tests\signature.js
94:9 error 'time' is assigned a value but never used no-unused-vars
E:\work\nodegit\test\tests\stash.js
148:11 error 'oldContent' is assigned a value but never used no-unused-vars
179:11 error 'oldContent' is assigned a value but never used no-unused-vars
E:\work\nodegit\test\utils\index_setup.js
66:22 error 'commitOid' is defined but never used no-unused-vars
E:\work\nodegit\examples\index-add-and-remove.js
91:26 error 'matchedPattern' is defined but never used no-unused-vars |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I'm getting my point across, so here are the packages I don't want to bring into NodeGit. All of the scripts you wrote that are using these packages can be written without the use of any gulp utilities.
@@ -48,11 +48,17 @@ | |||
"clean-for-publish": "~1.0.2", | |||
"combyne": "~0.8.1", | |||
"coveralls": "~2.11.4", | |||
"eslint": "^4.4.1", | |||
"gulp-debug": "^3.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want this package in NodeGit.
@@ -48,11 +48,17 @@ | |||
"clean-for-publish": "~1.0.2", | |||
"combyne": "~0.8.1", | |||
"coveralls": "~2.11.4", | |||
"eslint": "^4.4.1", | |||
"gulp-debug": "^3.1.0", | |||
"gulp-eslint": "^4.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want this package in NodeGit.
"eslint": "^4.4.1", | ||
"gulp-debug": "^3.1.0", | ||
"gulp-eslint": "^4.0.0", | ||
"gulp-reporter": "^2.2.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want this package in NodeGit.
"gulp-debug": "^3.1.0", | ||
"gulp-eslint": "^4.0.0", | ||
"gulp-reporter": "^2.2.1", | ||
"husky": "^0.14.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this package for?
It will make so many error. |
@gucong3000 By saying |
FYI, I didn't notice this PR, I also made one that adds ESLint but without gulp. #1825 |
.eslintrc.json
is compatible with.jshintrc
.generate/templates/templates/nodegit.js