Commits on Jan 16, 2016
  1. @gtanner @jugglinmike

    [[FIX]] Do not crash on invalid input

    fip renaming of comma var
    
    - function is now called parseComma
    - local var has be switched back to just comma
    
    Fixes the bug where we would overwrite the parseComma function (when
    they were both named comma)
    gtanner committed with jugglinmike Oct 13, 2015
  2. @nicolo-ribaudo @jugglinmike

    [[FIX]] Allow regex inside template literal

    Fixes gh-2791
    nicolo-ribaudo committed with jugglinmike Dec 5, 2015
  3. @nicolo-ribaudo @jugglinmike
  4. @nicolo-ribaudo @jugglinmike

    [[CHORE]] Pass correct parameter to state.inES6

    nicolo-ribaudo committed with jugglinmike Jan 15, 2016
  5. @jugglinmike

    [[FIX]] Improve reporting of "Bad assignment."

    When an assignment expression has an invalid left-hand side, JSHint
    previously issued error E013 ("Bad assignment."), bailed out of
    assignment interpretation and instead interpreted the left-hand side as
    an ExpressionStatement.
    
    In issuing E013, JSHint interprets the invalid JavaScript as an
    assignment expression. Failing to parse the invalid target as the
    left-hand side of the expression is inconsistent with this
    interpretation. The inconsistency commonly triggers inappropriate (and
    potentially confusing) errors such as "Missing semicolon," and "Expected
    an assignment or function call and instead saw an expression."
    
    Instead, JSHint should warn about the faulty assignment but continue
    parsing as though the expression were a valid assignment target. Doing
    so avoids emitting those errors that suggest that the left-hand side
    were written as an ExpressionStatement.
    
    1. Interpret faulty assignment targets as the left-hand side of
       assignment expressions in all cases, issuing error E013 and moving on
    2. Remove inappropriate errors from affected unit tests (noting that the
       underlying "Bad assignment." error remains unchanged)
    jugglinmike committed Jan 16, 2016
Commits on Jan 14, 2016
  1. @jugglinmike

    v2.9.1

    jugglinmike committed Jan 14, 2016
Commits on Jan 12, 2016
  1. @rwaldron

    v2.9.1-rc3

    rwaldron committed Jan 12, 2016
Commits on Jan 11, 2016
  1. @rwaldron

    Merge pull request #2822 from jugglinmike/strict-envs

    [[FIX]] Do not require global USD for any envs
    rwaldron committed Jan 11, 2016
Commits on Jan 3, 2016
  1. @jugglinmike

    [[FIX]] Do not require global USD for any envs

    In web browsers, enabling ES5 "strict mode" at a global level effects
    all scripts executed in the same context. For this reason, the `strict`
    option was originally implemented to enforce the directive's use in
    function scope only.  However: the Browserify, Node.js, and PhantomJS
    environments do not suffer from this problem.
    
    Recent improvements to the option's behavior included making JSHint's
    interpretation of `strict: true` to be contextual: in those environments
    where a global `use strict` directive is "safe," enabling the option
    would require the global directive.
    
    Although this change is an improvement (because it encourages more code
    to be written in strict mode), it is backwards incompatible. Moreover,
    the option's documentation in JSHint 2.8.0 explicitly described the
    sub-optimal behavior:
    
    > *Note:* This option enables strict mode for function scope only. It
    > *prohibits* the global scoped strict mode because it might break
    > third-party widgets on your page. If you really want to use global
    > strict mode, see the *globalstrict* option.
    
    For this reason, `strict: true` should continue to trigger the "legacy"
    behavior. The change brings that configuration completely in-line with
    the recently-introduced `strict: func`, and because `strict: func` has
    not been released in a stable version, it can safely be removed.
    jugglinmike committed Jan 1, 2016
Commits on Dec 22, 2015
  1. @jugglinmike

    v2.9.1-rc2

    jugglinmike committed Dec 22, 2015
Commits on Dec 21, 2015
  1. @rwaldron

    Merge pull request #2803 from jugglinmike/more-bad-options

    [[Fix]] Disallow ambiguous configuration values
    rwaldron committed Dec 21, 2015
Commits on Dec 13, 2015
  1. @jugglinmike

    [[Chore]] Organize logic for inferring ES version

    jugglinmike committed Dec 13, 2015
  2. @jugglinmike

    [[Fix]] Disallow ambiguous configuration values

    In the presence of the recently-introduced `esversion` option, JSHint
    should reject any occurrence of the equivalent legacy options: `es3`,
    `es5`, and `esnext`.
    
    Previous implementation conflated the user-specified option values and
    the state of the linter itself. Without a formal distinction between
    these two concepts, it was not possible to consistently enforce this
    constraint. For example, the value of `state.option.esversion` could be
    set to `5` directly (i.e. `esversion: 5`) or indirectly (i.e. `es5:
    true`), but only in the former case would a later in-line configuration
    of `esversion: 6` be acceptable.
    
    Achieve this by making an explicit distinction between user-specified
    option values (in other words, the `es3`, `es5`, `esnext`, and
    `esversion` properties of the `state.option` object) and the state of
    the linter itself (the new `state.esVersion` property).
    jugglinmike committed Dec 13, 2015
Commits on Dec 10, 2015
  1. @rwaldron

    Merge pull request #2801 from jugglinmike/2760-quit-on-bad-options-2

    [[Fix]] Abort in the presence of invalid config
    rwaldron committed Dec 10, 2015
  2. @rwaldron

    Merge pull request #2795 from jugglinmike/2784-unused-redeclaration-6

    [[Fix]] Correct `unused` for function-scoped vars
    rwaldron committed Dec 10, 2015
  3. @rwaldron

    Merge pull request #2796 from jugglinmike/2785-moz-and-es6

    [[Fix]] Do not disable ES6 when `moz` is set
    rwaldron committed Dec 10, 2015
  4. @jugglinmike

    fixup! [[Chore]] Enable expansion of `quit` messages

    jugglinmike committed Dec 10, 2015
Commits on Dec 9, 2015
  1. @jugglinmike

    [[Fix]] Abort in the presence of invalid config

    When an invalid set of configuration values is encountered, linting
    cannot continue because the expectations are ambiguous. In this event,
    report the error and cease linting.
    jugglinmike committed Dec 6, 2015
  2. @jugglinmike

    [[Chore]] Enable expansion of `quit` messages

    Extend the `quit` function to expand error message strings using the
    same mechanism used by the `error` and `warning` functions. This will
    allow future `quit` to be expanded with context-specific information.
    jugglinmike committed Dec 6, 2015
Commits on Dec 6, 2015
  1. @jugglinmike

    [[Fix]] Do not disable ES6 when `moz` is set

    Although environments implementing Mozilla extensions are not
    necessarily ES6-compliant, they are not mutually exclusive. Ensure that
    for configurations that specify both ES6 and `moz`, the semantics of
    both environments are applied consistently.
    jugglinmike committed Dec 6, 2015
  2. @jugglinmike

    [[Fix]] Correct `unused` for function-scoped vars

    In the absence of the `funcscope` option, JSHint validates
    function-scoped variable references as though they were block scoped.
    JSHint does not apply block-scoping semantics to reference counting,
    however: re-declarations within nested blocks are *not* considered
    distinct when determining whether a given binding is used.
    
    Ensure that when a variable is re-declared within the same function
    scope, usage tracking is "shared" across all identifiers.
    
    This change required correcting two existing tests. Both alterations
    removed warnings, meaning they do not reflect a backwards-incompatible
    change in behavior.
    
    1. In the following source code, the variable `ok` is used, so JSHint
       should not report otherwise:
    
            function(match) {
              var ch = this.string.charAt(this.pos);
              if (typeof match == "string") var ok = ch == match;
              else var ok = ch && (match.test ? match.test(ch) :
              if (ok) {++this.pos; return ch;}
            }
    
    2. In the following source code, the `var` declaration for `d` is not
       technically used, but it is also invalid due to ES2015 block scoping
       semantics. Because JSHint continues to correctly emit an error for
       this code, the removal of the "unused" warning has little practical
       effect.
    
            function sup(a) {
              var b = 4;
              let c = 5;
              let d = 6;
              if (false) {
                var d = 7;
              }
              return b + c + a + d;
            }
    jugglinmike committed Dec 5, 2015
Commits on Nov 28, 2015
  1. @nicolo-ribaudo @jugglinmike

    [[FIX]] Allow ignoring W020 and W021

    Fixes gh-2761
    nicolo-ribaudo committed with jugglinmike Nov 13, 2015
Commits on Nov 21, 2015
  1. @niedzielski @jugglinmike

    [[DOCS]] Remove unsupported indent option

    Indent is no longer supported as of v2.5.0[0].
    
    [0] #655
    niedzielski committed with jugglinmike Nov 12, 2015
Commits on Nov 13, 2015
  1. @nicolo-ribaudo

    fixup! [[FIX]] Don't throw '(NaN% scanned)'

    nicolo-ribaudo committed Nov 13, 2015
Commits on Nov 12, 2015
  1. @jugglinmike

    v2.9.1-rc1

    jugglinmike committed Nov 12, 2015
  2. @nicolo-ribaudo @jugglinmike

    [[CHORE]] Remove unuseful code from lex.js

    nicolo-ribaudo committed with jugglinmike Nov 12, 2015
  3. @nicolo-ribaudo @jugglinmike
  4. @nicolo-ribaudo @jugglinmike
  5. @mohsen1 @jugglinmike

    [[FIX]] Add `File` and `FileList` to browser global variables

    `File` and `FileList` were left out of browser global variables
    
    Fixes #2690
    mohsen1 committed with jugglinmike Sep 21, 2015
  6. @paladox @jugglinmike

    Update .travis.yml

    Allow testing on travis ci new server which are faster.
    paladox committed with jugglinmike Oct 22, 2015
Commits on Nov 10, 2015
  1. @leobalter

    [[FEAT]] Support QUnit's global notOk

    Adds support for notOk exposed to the global object since QUnit 1.18.0
    
    Ref https://github.com/jquery/qunit/releases/tag/1.18.0
    leobalter committed Nov 10, 2015
Commits on Nov 6, 2015
  1. @nicolo-ribaudo @jugglinmike

    [[TEST]] Rename overwritten test.

    nicolo-ribaudo committed with jugglinmike Oct 10, 2015
Commits on Nov 5, 2015
  1. @nicolo-ribaudo

    [[FIX]] Don't throw '(NaN% scanned)'

    nicolo-ribaudo committed Nov 5, 2015
  2. @jugglinmike

    [[FIX]] Do not enable `newcap` within strict mode

    Since the first public release of JSLint (ca120a7), this codebase has
    automatically enabled the `newcap` option for all strict mode code:
    
        function use_strict() {
            if (nexttoken.value === 'use strict') {
                advance();
                advance(';');
                strict_mode = true;
                option.newcap = true;
                option.undef = true;
                return true;
            } else {
                return false;
            }
        }
    
    Commit 8de8247 unified the way JSHint detects and enforces strict mode
    across contexts. Among other modifications, it included the following
    change:
    
        - if (state.tokens.curr.value === "use strict") {
        + if (state.isStrict()) {
            if (!state.option["(explicitNewcap)"]) {
              state.option.newcap = true;
            }
            state.option.undef = true;
          }
    
    This change introduced a regression: it enables the `newcap` option for
    class bodies and ES2015 module code as well.
    
    Because ES5's strict mode and the warnings enabled by the `newcap`
    option are orthogonal (and because as a stylistic concern, the `newcap`
    is deprecated) correct the regression by relaxing the behavior for all
    cases--do not automatically enable `newcap` when entering strict mode,
    for whatever reason.
    
    This change is backward-compatible because it will not cause JSHint to
    produce new warnings. It corrects undocumented and surprising behavior,
    so it should be considered a bug fix (despite the age of the bug in
    question).
    jugglinmike committed Oct 31, 2015
Commits on Oct 25, 2015
  1. @nicolo-ribaudo @jugglinmike

    [[FIX]] Don't throw W080 when the initializer starts with `undefined`

    Example:
       var a = undefined === 0; // a is 'false', not 'undefined'
    
    Fixes gh-2699
    nicolo-ribaudo committed with jugglinmike Sep 29, 2015