You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by kxepal <gi...@git.apache.org> on 2014/11/10 15:27:54 UTC

[GitHub] couchdb-jquery-couch pull request: Tolerate JSlint

GitHub user kxepal opened a pull request:

    https://github.com/apache/couchdb-jquery-couch/pull/4

    Tolerate JSlint

    COUCHDB-561
    
    The only errors left are:
    ```
    ./node_modules/jslint/bin/jslint.js --maxerr=100 jquery.couch.js                                                                                                *[master] [17:22:19] ▸▸▸▸▸▸▸▸▸▸
    
    jquery.couch.js
     #1 Unexpected TODO comment.
        // todo: can we use commonjs require here? // Line 312, Pos 13
     #2 Unexpected 'typeof'. Use '===' to compare directly with undefined.
        if (typeof Base64 === "undefined") { // Line 313, Pos 15
     #3 Expected exactly one space between 'return' and '{'.
        return /** @lends $.couch.db */ { // Line 326, Pos 39
     #4 Unnecessary 'else' after disruption.
        } else { // Line 618, Pos 13
     #5 Unused '_'.
        function (_, doc) { // Line 781, Pos 23
     #6 Unused 'ajax'.
        function ajax(obj, options, errorMessage, ajaxOptions) { // Line 1081, Pos 12
     #7 Unused 'fullCommit'.
        function fullCommit(options) { // Line 1154, Pos 12
     #8 Unused 'encodeOptions'.
        function encodeOptions(options) { // Line 1171, Pos 12
     #9 Unused 'toJSON'.
        function toJSON(obj) { // Line 1194, Pos 12
    #10 Unused 'maybeUseCache'.
        function maybeUseCache() { // Line 1201, Pos 12
    ```
    
    Unused are happens because of globals workaround; TODO remains TODO; typeof have to compare with undefined since Base64 is a browser's global thing; else is better to keep for readability.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kxepal/couchdb-jquery-couch 561-jslint

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-jquery-couch/pull/4.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4
    
----
commit 883de0a3e5cab6bd49454fa621690b48c9adda25
Author: Alexander Shorin <kx...@apache.org>
Date:   2014-11-10T14:23:42Z

    Tolerate JSlint
    
    COUCHDB-561

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-jquery-couch pull request: Tolerate JSlint

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb-jquery-couch/pull/4#discussion_r20753549
  
    --- Diff: jquery.couch.js ---
    @@ -1084,13 +1200,7 @@
        * @private
        */
       function maybeUseCache() {
    -    if (!navigator){
    -      return true;
    -    }
    -    else if (/(MSIE|Trident)/.test(navigator.userAgent)){
    -      return false;
    -    }
    -    return true;
    +    return !navigator || !(/(MSIE|Trident)/.test(navigator.userAgent));
       }
     
    -})(jQuery);
    +}(jQuery));
    --- End diff --
    
    haha that's a typical crockford


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-jquery-couch pull request: Tolerate JSlint

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb-jquery-couch/pull/4#issuecomment-64064745
  
    +1 - Great work!
    
    Trivia: JSLint (from Douglas Crockford) is very opinionated  - a good example is the `}(jQuery));` which is a style issue Crockford has with a different writing. JSHint is very happy with the code now!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---