-
Notifications
You must be signed in to change notification settings - Fork 3
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
Perform jshint checks within the "npm test" command, fix warnings #16
Open
prantlf
wants to merge
9
commits into
amodrojs:master
Choose a base branch
from
prantlf:call-jshint
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add method `parse` to "amodro-trace/parse" ------------------------------------------ Add method `parseFileContents` to "lib/parse" as a thin wrapper of `esprima.parse`. Saves the client from having a direct dependency on `esprima`. Add method `traverse` to "amodro-trace/parse" --------------------------------------------- Pass parent node to visitors of traverse and traverseBroad too. Help scenarios, when just knowing the parent is enough and generating the parent link in every node is not needed. Add method `findDependencies` to "amodro-trace/parse" ----------------------------------------------------- Make method `findDependencies` accept an already parsed astRoot too. If the astRot has been already parsed for other purposes, no need to do it again.
…ing a file with the single wrapping require() statement too Only files wrapped by define() worked earlier.
Look up the dependent module by `a` in {a: require('a')}.
Use the same input and output parameters as for findDependencies. Return variable names, which contain results of the require() statements, in addition to the required module paths. Reuse the method "findRequireDepNames", which looks for the dependencies in simple CJS wrappers of AMD modules.
* Remove documentation unit tests for it. Suggest using an ESTree Spec compliant parser - Esprima. * Remove the private method "parseFileContents".
* Include `traverseBorad` in public methods exported from this module. * Fix undeclared identifier in `traverseBroad` in `lib/parse`. JSHint should really be used regularly... * Update documentation and unit tests of `traverse` and `traverseBroad`.
* Code fixes meant mostly breaking too long lines and forcing single quotes. * Make npm test" execute "npm run lint" and "npm run check". The former calls JSHint and the latter Mocha. * Relax the "use strict" check. It complained about files, which chould have the "use strict" pragma only inside module callbacks; not outside in the whole file. Usage of the undefined "key" identifier in "traverseBroad" showed, that it is worth to run it regularly. See https://github.com/amodrojs/amodro-trace/blob/1.0.2/lib/parse.js#L68.
They may not appear usual, but parseNode must not crash with them: * define({...}) * define([], function (...) {...}); * require({...}) * require([], function (...) {...});
I will wait to review this until we get #14 landed and then this branch can be rebased with those changes, to make it clearer what is new in this PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Usage of the undefined "key" identifier in "traverseBroad" showed, that it is worth to run it regularly. See https://github.com/amodrojs/amodro-trace/blob/1.0.2/lib/parse.js#L68.
This is based on the code proposed with #14, which includes also the fix for the bug above; not on the current master.