X Tutup
The Wayback Machine - https://web.archive.org/web/20200916181521/https://github.com/nodegit/nodegit/pull/1338
Skip to content
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

Open
wants to merge 12 commits into
base: master
from

Conversation

@gucong3000
Copy link

gucong3000 commented Jul 28, 2017

  • .eslintrc.json is compatible with .jshintrc.
  • Fixing lint errors on precommit.
  • All errors written before 2017-8-2 will be ignored.
  • Fixed: generate/templates/templates/nodegit.js
刘祺
@gucong3000 gucong3000 changed the title Use ESLint with compatible with `.jshintrc` Use ESLint and compatible with `.jshintrc` Jul 28, 2017
@gucong3000 gucong3000 changed the title Use ESLint and compatible with `.jshintrc` [WIP] Use ESLint and compatible with `.jshintrc` Jul 28, 2017
刘祺 added 3 commits Jul 28, 2017
刘祺
刘祺
刘祺
@gucong3000 gucong3000 changed the title [WIP] Use ESLint and compatible with `.jshintrc` Use ESLint and compatible with `.jshintrc` Jul 28, 2017
gucong3000 and others added 4 commits Jul 28, 2017
# Conflicts:
#	generate/templates/templates/nodegit.js
@gucong3000 gucong3000 closed this Aug 3, 2017
@gucong3000 gucong3000 reopened this Aug 3, 2017
@gucong3000
Copy link
Author

gucong3000 commented Aug 3, 2017

This PR provides a smooth transition from jshint to eslint solutions.
Then we can gradually enhance the eslint rules without affecting the existing code.

@gucong3000
Copy link
Author

gucong3000 commented Aug 9, 2017

Right now it is the most popular ES linter.

刘祺 added 3 commits Aug 14, 2017
刘祺
刘祺
刘祺
Copy link
Member

implausible left a comment

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" */

This comment has been minimized.

@implausible

implausible Aug 16, 2017

Member

Should we be worried about linting this generated file?

This comment has been minimized.

@gucong3000

gucong3000 Aug 16, 2017

Author

What is your plan about this? How about just remove this line?

This comment has been minimized.

@implausible

implausible Aug 17, 2017

Member

Disable lint from the entire file imo. Perhaps we could have a post generate linter?

@gucong3000
Copy link
Author

gucong3000 commented Aug 17, 2017

刘祺
@implausible
Copy link
Member

implausible commented Aug 17, 2017

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.

@gucong3000
Copy link
Author

gucong3000 commented Aug 17, 2017

$ 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
Copy link
Member

implausible left a comment

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",

This comment has been minimized.

@implausible

implausible Aug 17, 2017

Member

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",

This comment has been minimized.

@implausible

implausible Aug 17, 2017

Member

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",

This comment has been minimized.

@implausible

implausible Aug 17, 2017

Member

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",

This comment has been minimized.

@implausible

implausible Aug 17, 2017

Member

What is this package for?

@gucong3000
Copy link
Author

gucong3000 commented Sep 1, 2017

Can we not use eslint via cmd line?

It will make so many error.

@cjhoward92
Copy link
Collaborator

cjhoward92 commented Dec 20, 2017

@gucong3000 By saying eslint will cause many errors do you mean linter errors or something else breaks? If it is just linter errors the eslint rules should be modified to work with the existing rules, correct?

@implausible implausible force-pushed the nodegit:master branch from c345989 to c67b436 Aug 26, 2019
@implausible implausible force-pushed the nodegit:master branch from 2b7db46 to 69b010a Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.
X Tutup