Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-23728

Enable the no-unused-expressions ESLint rule to find dead code

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v3.2
    • Sprint:
      TIG 2017-04-17
    • Linked BF Score:
      0

      Description

      The no-unused-expressions rule can catch bugs like SERVER-23704.

      /Users/kk/code/mongo/mongo/jstests/auth/basic_role_auth.js
        191:5  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      /Users/kk/code/mongo/mongo/jstests/core/covered_index_sort_3.js
        11:1  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      /Users/kk/code/mongo/mongo/jstests/core/distinct_speed1.js
        12:5  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      /Users/kk/code/mongo/mongo/jstests/core/elemMatchProjection.js
        100:5  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      /Users/kk/code/mongo/mongo/jstests/core/group1.js
        103:9  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
        118:9  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      /Users/kk/code/mongo/mongo/jstests/core/js4.js
        19:9  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
        40:9  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      /Users/kk/code/mongo/mongo/jstests/core/ora.js
        20:5  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      /Users/kk/code/mongo/mongo/jstests/noPassthroughWithMongod/indexbg_restart_secondary.js
        65:9  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      /Users/kk/code/mongo/mongo/jstests/replsets/pipelineout.js
        21:5  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
        26:5  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
        30:1  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      /Users/kk/code/mongo/mongo/jstests/sharding/hash_basic.js
        17:1  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      /Users/kk/code/mongo/mongo/jstests/sharding/shard_keycount.js
        2:1  error  Expected an assignment or function call and instead saw an expression  no-unused-expressions
       
      ✖ 15 problems (15 errors, 0 warnings)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: