Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: azatoth/jshint
base: master
head fork: jshint/jshint
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
This comparison is big! We're only showing the most recent 250 commits
Commits on Dec 15, 2014
@rwaldron rwaldron Merge pull request #2003 from XhmikosR/readme
Add dependency badges.
@rwaldron rwaldron Merge pull request #2018 from jugglinmike/options-3
Move Options
@rwaldron rwaldron Merge pull request #2026 from jugglinmike/2022-concise-method-names
Fix bug in parsing of concise method names
Commits on Dec 16, 2014
@caitp caitp Don't warn fat arrow params used out of scope. Fixes #1983
This is a hack, but I couldn't find a quicker fix.
@jugglinmike jugglinmike Account for all parenthesis c6b693b
@jugglinmike jugglinmike Re-use code to parse "fat arrow" function params
Prior to this commit, JSHint parsed "fat arrow" function parameters as
though they were expressions in a list. This had unintended side-effects
relating to:

1. the scope of the declared variables. This problem was only partially
   addressed through manual modification of the data structure for
   global variables.
2. the syntax accepted within the arguments list. Most significantly,
   "default parameters" expressions were misinterpreted.

By re-using the `doFunction` function, the same logic can be used when
parsing parameters of both "traditional" functions and "fat arrow

This change requires supplying additional context to `doFunction`
because the parser may have already consumed certain tokens depending on
the form of the expression.

Fixes gh-1983
@jugglinmike jugglinmike Add regression test
Effectively testing for this regression requires making the parser more
lenient (the test would otherwise have to specify many additional errors
that described unspecified parsing behavior in an invalid state).

In addition, remove assertoions from existing tests that suffer from
overspecified errors.
@zpao zpao Support escaped backticks in template literals
This is a totally valid use but since the lexar just looks for the next
backtick as a marker for the end of the literal, things fall apart
@zpao zpao Process all escape sequences in template literals
This repurposes the code the that was previously only for StringLiterals.

Closes #2001
@caitp caitp Stop sending W044 ("Unnecessary escape sequences")
It's not a very useful warning
Commits on Dec 17, 2014
@jugglinmike jugglinmike Implement automated code coverage reporting
- Collect unit test coverage using the Istanbul module.
- Update the CI scripts to report this data to the Coveralls service so
  it can be automatically incorporated into pull requests.
- Remove legacy code coverage file and dependency.
@caitp caitp Use SVG badge for coverage report
Closes #2041
Commits on Dec 18, 2014
@rwaldron rwaldron Merge pull request #2039 from caitp/nope
Stop sending W044 ("Unnecessary escape sequences")
@rwaldron rwaldron v2.5.11 29bda11
Commits on Dec 19, 2014
@jugglinmike jugglinmike Fix typo in options documentation 825ce01
@caitp caitp [[DOCS]] Document proposed commit message guidelines ef6b99b
Commits on Dec 23, 2014
@rickychien rickychien Add suiteSetup and suiteTeardown for mocha vars 39250d0
Commits on Jan 02, 2015
@hpshelton hpshelton Add additional number tests to increase coverage 7bd00ff
@rwaldron rwaldron Merge pull request #2046 from caitp/contrib
[[DOCS]] Document proposed commit message guidelines
@rwaldron rwaldron Merge pull request #1989 from jugglinmike/fat-arrow-args-5
Fat arrow args 5
@rwaldron rwaldron Merge pull request #2052 from RickyChien/add-mocha-tdd-vars
Add suiteSetup and suiteTeardown for mocha vars
Commits on Jan 03, 2015
@hpshelton hpshelton [[FEAT]] Add new Jasmine 2.1 globals to "jasmine" option
Adds the following global variables exposed by Jasmine 2.1
to the "jasmine" environment option:

Closes #2023
@hpshelton hpshelton [[TEST]] Add additional string and number tests
Adds additional string values and numerical values to unit tests
that hit additional corner cases in lex.js, increasing code
coverage in scanNumericLiteral() and scanEscapeSequence().
@jugglinmike jugglinmike [[FIX]] Revert unnecessary commit
This reverts commit 248e40b.

The issue which motivated this change related to the modification of the
environment record of ES6 concise methods. That issue was addressed in a
more comprehensive and concise manner via commit
b95f669 and verified with an equivalent
unit test.
@jugglinmike jugglinmike [[DOCS]] Automatically clean up test stubs 62589b4
@jugglinmike jugglinmike [[DOCS]] Create clean state for each test case
Remove extraneous test stubs that were previously included to work
around problems of shared state.
@jugglinmike jugglinmike [[DOCS]] Reduce repetition in tests 694a10b
@jugglinmike jugglinmike [[DOCS]] Document new commit type for tests 2d7666d
@jugglinmike jugglinmike [[DOCS]] Fix URL in contribution guidelines 2334adc
@rwaldron rwaldron Merge pull request #2037 from jugglinmike/revert-1929
Revert "Formal parameter names can be the same as function name. Fixes g...
@rwaldron rwaldron Merge pull request #2049 from jugglinmike/test-cleanup
Test cleanup
@rwaldron rwaldron Merge pull request #2068 from hpshelton/jshint-2023
Add new Jasmine 2.1 globals to Jasmine option
@rwaldron rwaldron Merge pull request #2069 from hpshelton/numbercoverage
Add additional test cases to increase code coverage
@rwaldron rwaldron Add [[TESTS]] to c07679b
@rwaldron rwaldron Merge branch 'new-commit-tag' of
# By Mike Pennisi
# Via Mike Pennisi
* 'new-commit-tag' of
  [[DOCS]] Fix URL in contribution guidelines
  [[DOCS]] Document new commit type for tests

Commits on Jan 04, 2015
@rwaldron rwaldron [[FIX]] Allow array, grouping and string form to follow spread operat…
…or in function call args.

Fixes gh-2060

Squashed commit of the following:

commit cb9d868bc084bc1c4a25b105ce13e044f1cdec39
Author: Rick Waldron <>
Date:   Wed Dec 31 11:06:30 2014 -0500

    String condition, Additional tests

commit 6c1bb47ac9539b521083409079e8a0dbbf10944d
Author: Rick Waldron <>
Date:   Tue Dec 30 18:20:56 2014 -0500

    Removes unnecessary conditions

commit c02239ebcb7f9986a725c5d375fa448fd1ec3824
Author: Rick Waldron <>
Date:   Tue Dec 30 18:19:00 2014 -0500

    Cleanup "spread & rest operator support" tests

commit 80728050087907e21739325273915df0ab26b14e
Author: Rick Waldron <>
Date:   Tue Dec 30 17:37:00 2014 -0500

    Allow array literal form to follow spread operator in function call args. Fixes gh-2060
@jugglinmike jugglinmike [[DOCS]] Update contribution guidelines
The JSHint website has some additional details in its version of the
contribution guidelines. Incorporate those details. Additionally,
normalize the Markdown syntax used to designate headlines.
@rwaldron rwaldron Merge pull request #2074 from jugglinmike/update-contributing
[[DOCS]] Update contribution guidelines
@jugglinmike jugglinmike [[DOCS]] Correct Markdown formatting
Code examples that are associated with bullet points should be indented
so the code is rendered as a child of the list element in the markup.
@rwaldron rwaldron Merge pull request #2075 from jugglinmike/update-contributing-2
[[DOCS]] Correct Markdown formatting
@caitp caitp [[FEAT]] `elision` option to relax "Extra comma" warnings
A quick attempt at making it possible to ignore this error, while still enabling it by default.


In projects which do not enable ES3 mode, it is now an error by default to use elision array elements,
also known as empty array elements (such as `[1, , 3, , 5]`)

Fixes gh-2062
Commits on Jan 05, 2015
@rwaldron rwaldron Merge pull request #2063 from caitp/issue-2062
Add option `elision` to prevent warning about empty array elements
Commits on Jan 06, 2015
@foysavas foysavas [[FEAT]] Support generators in class body ee348c3
@rwaldron rwaldron Merge pull request #2066 from foysavas/master
Support generators in class body
Commits on Jan 10, 2015
@silverwind silverwind Add Notification to browser globals d1d5232
Commits on Jan 13, 2015
@mikesherov mikesherov [[TEST]] Introduce jscs for style guide enforcement
Adds JSCS with a set of rules that required minimal changes
to the codebase. Further work to enforce more rules can be done later.

Closes gh-1997
@mikesherov mikesherov [[TEST]] Enforce no spaces between "function" and "(" in functions 8e680e6
Commits on Jan 14, 2015
@jugglinmike jugglinmike [[FIX]] Remove dead code for parameter parsing
The removed code was made superfluous by a recent commit that unified
logic for function parameter parsing [1]. Since then, it has been
unreachable so it is safe to remove.

[1] Title: Re-use code to parse "fat arrow" function params
    Commit: 7430ee5
Commits on Jan 15, 2015
@jugglinmike jugglinmike [[FIX]] Remove dead code
The `_.has` utility method checks for the existence of the provided
properties as "own" values of the given object. The removed code
erroneously uses it to check attributes of an Array. The first branch is
(incorrectly) token when statements begin with identifiers/literals "0",
"1", or "length", and the nested branch depends on the block type which
is never a destructuring assignment in this case.

This code has been unreachable since its original introduction into the
codebase [1]. Removing it has no effect on the behavior of JSHint.

[1] commit fbf34a5
    Author: Guyzmo <>
    Date:   Wed Mar 6 15:12:15 2013 +0100

    fixed destructuring assign in global context. Updated tests. cf #883
@takenspc takenspc [[FIX]] Add missing globals to browser environment
DOM4 defines the constructors for these interfaces:

- Comment
- DocumentFragment
- Range
- Text

Add them to the "browser" environment.

@XhmikosR XhmikosR bin scripts: Cosmetic changes. ecdee12
Commits on Jan 17, 2015
@jugglinmike jugglinmike [[FIX]] Correct bug in enforcement of `singleGroups`
Honor expression binding power when enforcing the `singleGroups` option.

Resolves gh-2064
Commits on Jan 21, 2015
@rwaldron rwaldron Merge pull request #2088 from XhmikosR/master
[[MISC]] bin scripts: Cosmetic changes.
@rwaldron rwaldron Merge pull request #2092 from silverwind/notification-global
[[FEAT]] Add Notification to browser globals
@rwaldron rwaldron Merge pull request #2099 from jugglinmike/remove-dead-code-2
Remove dead code
@rwaldron rwaldron Merge pull request #2105 from jugglinmike/remove-dead-code-3
[[FIX]] Remove dead code for parameter parsing
@rwaldron rwaldron Merge pull request #2109 from jugglinmike/fix-single-groups-5
[[FIX]] Correct bug in enforcement of `singleGroups`
@rwaldron rwaldron v2.6.0 f1fabe3
@jugglinmike jugglinmike [[DOCS]] Document deprecated options
These options have long been considered deprecated by JSHint
maintainers. The intention to remove should be communicated in the
source code itself to give advance notice to end users.
Commits on Jan 22, 2015
@XhmikosR XhmikosR Test node 0.11 on appveyor/windows
* Add Node.js 0.11 like Travis is using.
* Remove global cache since we don't install any global modules.
* Allow 0.11 to fail until it's consistently green

Closes #2084
@XhmikosR XhmikosR [[DOCS]] Switch to for the badges.
Now the badges have a consistent style. Flashy!

[ci ckip]

Closes #2085
Commits on Jan 25, 2015
@jugglinmike jugglinmike [[FIX]] Correct token reported by `singleGroups`
Warnings emitted due to the `singleGroups` option should be in terms of
the opening parenthesis token of the offending grouping operator.
@jugglinmike jugglinmike [[DOCS]] Add details relating to CLA e0f839b
Commits on Jan 29, 2015
@popomore popomore [[FIX]] Miss xdescribe/xit/context/xcontext in mocha 8fe6610
Commits on Jan 31, 2015
@jugglinmike jugglinmike [[FIX]] Correct behavior of `singleGroups`
Parsing logic can generally infer if the current token begins an
expression by referencing the `left` property of the previous token. The
`singleGroups` option relies on this behavior in order to recognize
situations where operator binding power makes the grouping operator

Parsing of the "addition" operator should be made consistent with the
other infix operators: the token's `left` property should be set *prior
to* parsing the right-hand-side expression.
@denis-sokolov denis-sokolov [[FIX]] Fix false positives in 'nocomma' option
- Fix false positives in nocomma in literals and for loops
- Fix false positives in nocomma in arrow function expression
- Add tests for false positives in destructuring with nocomma option
Commits on Feb 03, 2015
@leebyron leebyron [[FIX]] Support more cases of ES6 module usage
The ES6 module parsing is incomplete currently. This adds more cases.

Fixes #2118
Fixes #2143
@rwaldron rwaldron Merge pull request #2144 from leebyron/es6module
[[FIX]] Support more cases of ES6 module usage
Commits on Feb 04, 2015
@leebyron leebyron [[FIX]] ES6 modules respect undef and unused
This adds scoping rules for ES6 modules, ensuring that undef and unused rules accurate reflect
the behavior of ES6 modules on the scope.

This also adds syntax parsing support for `export { foo as bar }` aliasing.

Fixes: #2147
Fixes: #2148
@rwaldron rwaldron Merge pull request #2149 from leebyron/es6module
[[FIX]] ES6 modules respect undef and unused
Commits on Feb 06, 2015
@mikesherov mikesherov [[TEST]] Upgrade JSCS and use it for indentation checking. da57341
@leebyron leebyron [[FIX]] Parse nested templates
ES6 template literals are nestable, jshint's parser is capable, but it's lexer isn't. This patch adds the concept of a stack of contexts to the lexer, replacing the previous boolean flag. This context stack pattern is borrowed from the awesome Acorn parser project, where it's used to enable more than just template literals.

Closes #2151
Closes #2152
@leebyron leebyron [[FIX]] Allow object-literals within template strings
Uses context introduced in previous diff to let lexer be contextually aware when parsing a "}" character.

Closes #2082
@leebyron leebyron [[FIX]] Templates can not be directives
Return a different kind of lexer token for full template strings such that they are not consumed by string directives.
@leebyron leebyron [[FIX]] Handle multi-line tokens after return or yield
This is a slight alteration of #2142 to cleanly rebase atop the previous diffs adding context, allowing it to work with nested templates.

Closes #1814
Closes #2142
@leebyron leebyron [[FIX]] Unfollowable path in lexer.
"}" should always yield a punctuator token, regardless of context.
@leebyron leebyron [[FIX]] Remove quotmark linting for NoSubstTemplates
Remove quote key from template literal token.
@leebyron leebyron [[FIX]] remove unused var
Cleanup lint error from 7e80490 which removed a check using the `esnext` var.

Closes #2156
@mikesherov mikesherov Merge pull request #2155 from mikesherov/jscs3
[[TEST]] Upgrade JSCS and use it for indentation checking.
@leebyron leebyron [[TEST]] Test all bitwise operators
This adds the bitwise assignment operators to the bitwise unit test, ensuring they trigger warnings when the bitwise option is used.

Also fixes a slightly wrong warning message coming specifically from using "~" with bitwise on.
@leebyron leebyron [[TEST]] Add tests for bad unicode
Previously uncovered territory, improves test coverage metrics.

Test results for bad unicode in a string previously churns out tons of warnings that are hard to follow, so added a more clear warning in that case.
@leebyron leebyron [[TEST]] Test escaped regex char ranges
Include test to ensure lexer/parser can handle escaped character ranges `\[\]`. Improves test coverage of lexer.
@leebyron leebyron [[TEST]] Test inline rules for shadow
Adds test case for using the "shadow" rule with the `/* jshint shadow:* */` inline directives.
@leebyron leebyron [[TEST]] Add bad option test for unused 3f1006d
@leebyron leebyron [[TEST]] Test all inline "latedef" options 3b934d4
@leebyron leebyron [[TEST]] Add test for bad option value 5b33e0f
@leebyron leebyron [[TEST]] Improve lexer test coverage
This adds two test cases that were uncovered: numbers that appear to be the beginning of identifiers,
and multi-line comments between ignore directives.

Closes #2160
Commits on Feb 15, 2015
@jugglinmike jugglinmike [[FIX]] Remove tautological condition
The parsing logic for the `(` prefix token returns early if the token is
determined to mark the beginning of an arrow function parameter list.
Logic that follows can safely assume that the token is *not* part of an
arrow function parameter lists, and explicit conditions to verify this
are unnecessary.
@david-gang david-gang informative error when jshintrc is invalid
When jshintrc is incorrect, i want to know what happened. Therefore i am adding the error message to the error and not just saying that the file couldn't be parsed
@david-gang david-gang Fixing automatic tests
Now it should not complain on sticking operator
@david-gang david-gang fix unit tests for adding error message. eliminate space ca7c639
Commits on Feb 16, 2015
@david-gang david-gang fix unit tests for adding error message. eliminate space a10daa1
Commits on Feb 22, 2015
@rwaldron rwaldron Merge pull request #2061 from rwaldron/2060
[[FIX]] Allow array, grouping and string form to follow spread operator in function call args.
@rwaldron rwaldron Merge pull request #2122 from jugglinmike/document-deprecated
[[DOCS]] Document deprecated options
@rwaldron rwaldron Merge pull request #2130 from jugglinmike/single-groups-error-token
[[FIX]] Correct token reported by `singleGroups`
@rwaldron rwaldron Merge pull request #2131 from jugglinmike/cla
[[DOCS]] Add details relating to CLA
@jugglinmike jugglinmike [[FIX]] Refactor `doFunction`
The behavior of the `doFunction` routine is highly dynamic and dependent
on a number of optional arguments. None of these arguments is required,
and invocations of the function have become inconsistent in how these
are specified.

Re-factor `doFunction` to accept a single `options` argument. This
avoids the need to specify null values for irrelevant positional
arguments and makes the call site more legible to human readers.
Additionally, provide documentation for each of the options.
@rwaldron rwaldron Merge pull request #2137 from popomore/patch-1
[[FIX]] Miss xdescribe/xit/context/xcontext in mocha
@jugglinmike jugglinmike [[FIX]] Disambiguate argument
In order to operate for expressions and statements, the `doFunction`
routine requires only a boolean value describing whether the function
under construction is a statement or expression. The previous usage of a
positional argument named `statement` made this unclear, and calling
code differed in its usage.

Rename the option to `isStatement` to more clearly describe its expected
type and update calling code to consistently specify a boolean value.
@rwaldron rwaldron Merge pull request #2140 from jugglinmike/fix-single-groups-again
[[FIX]] Correct behavior of `singleGroups`
@rwaldron rwaldron Merge pull request #2157 from leebyron/bitwisetest
[[TEST]] Test all bitwise operators
@rwaldron rwaldron Merge pull request #2158 from leebyron/unicodetest
[[TEST]] Add tests for bad unicode
@rwaldron rwaldron Merge pull request #2159 from leebyron/regexptest
[[TEST]] Test escaped regex char ranges
@rwaldron rwaldron Merge pull request #2161 from leebyron/shadowinline
[[TEST]] Test inline rules
@jugglinmike jugglinmike [[FEAT]] Implement new option `futurehostile`
A recent change to JSHint included the ECMAScript 6 global identifiers
in JSHint's collection of "predefined" variables. This disallowed the
definition of those global values even in contexts that did not
implement them.

The intent of this change was to help users avoid bugs when migrating to
the new version of the language. Re-using an existing warning mechanism
caused confusion among many users [1][2][3] for two reasons:

1. The generated warning messages were somewhat misleading (i.e. the
   warning "Redefinition of 'Promise'." is inaccurate in ES5
2. The method of disabling the warnings did not accurately communicate
   the intent of the developer (i.e. setting `predef: -Promise` does not
   prompt the user to consider the user to consider if creating their
   own global variable named `Promise` is appropriate)

A dedicated warning message more clearly describes the best practice
that motivates this particular constraint on global variable names. An
explicit option makes it less likely that users will disable this
warning without understanding the motivation.

Intoduce a new option, `futurehostile`, and dedicated warning message to
better communicate the intent of restricting usage of future-reserved

[1] GH-1747 redefinition of Promise (W079)
[2] GH-1995 ES6 globals are activated even though esnext=false
[3] GH-2171 Remove Set from the ECMAScript5 reserved words
@leebyron leebyron [[TEST]] Test linting JSON
Previously untested area, improve test coverage and fixed an error reporter.
@jugglinmike jugglinmike [[FIX]] Simulate class scope for class expr names
As per the ES6 specification draft:

> # 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
> With parameter className.
> ClassTail : ClassHeritage[opt] { ClassBody[opt] }
> 1. Let lex be the LexicalEnvironment of the running execution context.
> 2. Let classScope be NewDeclarativeEnvironment(lex).
> 3. Let classScopeEnvRec be classScope’s environment record.
> 4. If className is not undefined, then
>    a. Perform classScopeEnvRec.CreateImmutableBinding(className,
>       true).

Commits on Feb 23, 2015
@mbildner mbildner [[FIX]] Permit "eval" as object key
Makes it possible to use "eval" as a key in an object. Previously this
would have emitted a "W061" warning. "eval" used as the key for a
presumed global ("window" in "browser:true" and "global" in
"node:true") will still emit the warning.

Fixes jshint#738

Adds unit tests for permitting using "eval" as object key
@mbildner mbildner Use double quotes in test code 0ec9e03
@rwaldron rwaldron Merge pull request #2172 from jugglinmike/futurehostile
[[FEAT]] Implement new option `futurehostile`
@mbildner mbildner splits eval as key tests into browser and node test runs. b9b3a43
@jugglinmike jugglinmike [[FIX]] Do not crash on improper use of `delete`
In valid JavaScript code, when the `delete` token is parsed as a prefix,
it will be followed by an expression of some kind. Invalid code may
include any sequence of characters after the `delete` token, and JSHint
should be capable of gracefully warning about the syntax error.

Avoid crashing in cases where the `delete` appears as a "prefix" token
but is not followed by an expression.
@jugglinmike jugglinmike [[DOCS]] Update link to CLA
The project now uses the CLAHub service to assist in the process of
verifying contributor agreements.
Commits on Feb 24, 2015
@XhmikosR XhmikosR Add node.js 0.12 in CI. 278ad75
Commits on Feb 26, 2015
@caitp caitp [[TEST]] fix typo in test case cc8ccd7
@caitp caitp [[FEAT]] parse and lint tagged template literals
Closes #2000
@rwaldron rwaldron Merge pull request #2189 from jugglinmike/update-cla-info
[[DOCS]] Update link to CLA
@rwaldron rwaldron Merge pull request #2185 from jugglinmike/class-expr-identifier
Class expr identifier
@rwaldron rwaldron Merge pull request #2186 from jugglinmike/remove-tautology
[[FIX]] Remove tautological condition
@rwaldron rwaldron Merge pull request #2187 from jugglinmike/fix-delete-crash
[[FIX]] Do not crash on improper use of `delete`
@rwaldron rwaldron Merge pull request #2188 from mbildner/eval-key-not-harmful
[[FIX]] Permit "eval" as object key
@rwaldron rwaldron Merge pull request #2176 from david-gang/master
informative error when jshintrc is invalid
@rwaldron rwaldron Merge pull request #2162 from leebyron/json
[[TEST]] Test linting JSON
@rwaldron rwaldron Merge pull request #1784 from Rob--W/per-line-w117-unused
[[Fix]] Allow W117 and undef to be toggled per line.
@rwaldron rwaldron [[Fix]] export default * are defined in lexical module scope. Fixes g… ff7228e
Commits on Feb 27, 2015
@mbildner mbildner [[FIX]] Prevent beginning array from being confused for JSON
src/jshint.js was reading an array at the beginning of a file as JSON instead
of a code block. The parser read the '(begin)' token and then looped 15 times
looking for an end to the block, didn't find it, and considered itself to be
parsing JSON. JSON must use *only* double quotes to be valid, so single quotes
caused warnings.
@rwaldron rwaldron Merge pull request #2196 from caitp/issue-2000
[[FEAT]] parse and lint tagged template literals
@rwaldron rwaldron Merge pull request #2198 from rwaldron/gh-2197
[[Fix]] export default * are defined in lexical module scope. Fixes gh-2197
@rwaldron rwaldron Merge pull request #2200 from mbildner/array-json-confusion
[[FIX]] Prevent beginning array from being confused for JSON
@rwaldron rwaldron [[Fix]] JSCS issue
$ npm test

> jshint@2.6.0 pretest /Users/rwaldron/clonez/jshint
> jshint src && jscs src

Expected indentation of 10 characters at src/jshint.js :
  4143 |          if (!funct["(blockscope)"].getlabel(ident) &&
  4144 |              !(scope[ident] || {})[ident])
  4145 |            warning("W088",,;
  4146 |        }
  4147 |        advance();
@rwaldron rwaldron v2.6.1 02c2628
@niligulmohar niligulmohar [[FIX]] Make let variables in the closure shadow predefs
There was a problem when parsing an identifier that would resolve to a
predefined read-only global through the function scope chain.

When checking the block scope for the same identifier only the innermost
block was considered, so while this worked:

    /* global foo: false */
    function x() {
      let foo;
      foo = {};

... a W020 read only warning was generated when moving the assignment
into a subscope:

    /* global foo: false */
    function x() {
      let foo;
        foo = {};

By checking the entire block scope chain for the identifier the
assignment generates no warning, as is expected.
Commits on Feb 28, 2015
@jugglinmike jugglinmike [[FIX]] Disable `futurehostile` option by default
When enabled, this option generates a new warning for code that would
otherwise pass. Therefore, it should not be enabled by default until the
next major release of this library.
@rwaldron rwaldron Merge pull request #2216 from jugglinmike/disable-futurehostile-by-de…

[[FIX]] Disable `futurehostile` option by default
@rwaldron rwaldron v2.6.2 d82cf19
@jugglinmike jugglinmike Allow `this` in class expression methods
Commit d75ef69 oversimplified the
information passed to the `doFunction` method.

Prior to that commit, `doFunction` was invoked inconsistently (with a
token and with an object literal). This was incorrectly simplified to a
boolean value, which caused the helper function `isMethod` to stop

    function isMethod() {
      return funct["(statement)"] && funct["(statement)"].type === "class" ||
             funct["(context)"] && funct["(context)"]["(verb)"] === "class";

Re-implement the option to be a token and specify consistently at each
invocation of `doFunction`.
@caitp caitp [[FIX]] parse trailing comma in ObjectBindingPattern
Closes #2220
@rwaldron rwaldron Merge pull request #2219 from jugglinmike/allow-this-in-class-expr
Allow `this` in class expression methods
@rwaldron rwaldron Merge pull request #2221 from caitp/issue-2220
[[FIX]] parse trailing comma in ObjectBindingPattern
@rwaldron rwaldron v2.6.3 983fc8d
@caitp caitp [[FIX]] templates are operands, not operators
Closes #2223
Closes #2224
@caitp caitp [[FIX]] allow trailing comma in ArrayBindingPattern
Also, disallow commas after rest elements in ArrayBindingPattern.

Closes #2222
@caitp caitp [[FIX]] disallow 'lone' rest operator in identifier()
Closes #2222
@caitp caitp [[TEST]] improve test coverage for lone/extra rest operators
Closes #2222
Commits on Mar 01, 2015
@XhmikosR XhmikosR [[CHORE]] update dependencies
Closes #2086
@caitp caitp [[DOCS]] add `[[CHORE]]` commit tag for dev-ops/CI/dependencies commits
Closes #2226
Commits on Mar 02, 2015
@mbildner mbildner [[FIX]] Correctly enforce maxparams:0
Previously setting maxparams:0 would cause the check to short-circuit,
permitting any number of parameters without issuing a warning. This PR
fixes the bug by testing whether maxparams is a number, instead of
whether it is truthy.
Commits on Mar 04, 2015
@caitp caitp [[FEAT]] add `varstmt` enforcement option to disallow use of Variable…

Closes #1549
Commits on Mar 05, 2015
@amZotti amZotti Update README
While reading the documentation for JsHint I noticed two pluralization errors in the README. This pull request contains the corrections for these grammatical errors.
@rwaldron rwaldron Merge pull request #2235 from amZotti/patch-2
Commits on Mar 06, 2015
@julienw julienw Fix issue #1825: use of `!` with `instanceof` should require parentheses 448a6f2
Commits on Mar 07, 2015
@XhmikosR XhmikosR Lint more stuff. 92e1a60
Commits on Mar 08, 2015
@thejameskyle thejameskyle [[FIX]] allow typeof symbol === "symbol"
Closes #2241
Closes #2242
@jugglinmike jugglinmike [[Fix]] Only accept "symbol" as a type in ES6 envs
The ES6 specification extended the `typeof` operator to return the
string "symbol" when when applied to Symbol instances. In pre-ES6
environments, the operator will never return this value, so comparisons
that involve it cannot possibly evaluate to `true`.

Update the internal `isTypoTypeof` function to allow a different set of
values for different language versions.
@jugglinmike jugglinmike fixup! Remove duplicate value 81f1690
@jugglinmike jugglinmike fixup! Document legacy values for `typeof` f52da98
Commits on Mar 09, 2015
@caitp caitp [[FIX]] predefine HTMLTemplateElement in browser
Closes #2246
Commits on Mar 13, 2015
@lukeapage lukeapage [[FIX]] export all names for var/let/const declarations
Closes #2248
Closes #2253
Closes #2252
@caitp caitp [[TEST]] also test uninitialized var/let/const exports 12811e7
Commits on Mar 17, 2015
@myshov myshov [[DOC]] Added more consistency among options file and config example
Options regarding PhantomJS was placed in the Relaxed section.
There was no sample options: typed, phantom in example config.
Commits on Mar 18, 2015
@jacksonmj jacksonmj [[FIX]] Incorrect 'Unclosed string' when the closing quote is the fir…
…st character after a newline

Previously, the end-of-line loop was immediately followed by the non-quote character code. This
meant that the first character after an EOL was always treated as a non-quote character.

Control flow now returns to the quote character check in the while loop condition immediately
after each EOL or character has been handled, so that this check also runs for the first character
on a line.

Closes #1532. (This commit includes the test case provided in #1532 by DelvarWorld.)
Closes #1319.
Commits on Mar 19, 2015
@stringparser stringparser [[FIX]] default to empty string in src/cli.js loadIgnores 0eeba14
Commits on Mar 21, 2015
@jugglinmike jugglinmike [[FIX]] Relax restrictions on `singleGroups`
These operators are not specified as associative, so a grouping operator
may be necessary when they appear in a larger expression.

Update the binding power of these operators to accurately reflect the
way they are evaluated at runtime.

Remove invalid test cases that fail as a result of this correction.
@jugglinmike jugglinmike [[FIX]] Prevent incorrect warnings for relations
Denote relation operator tokens as binary operators by attaching a
reference to the left-hand expression *prior* to parsing the right-hand

This allows the logic for the `singleGroups` option to correctly infer
that a grouping operator does not begin an expression when it follows a
relation operator. This in turn ensures that the `singleGroups` option
does not trigger warnings when the grouping operator is necessary and
involves a relation operator.
Commits on Apr 05, 2015
@karlhorky karlhorky Add missing options for `unused` 3be589a
@jugglinmike jugglinmike [[FIX]] Accept `get` and `set` as ID properties
`get` and `set` are both valid identifiers, so they may appear as
PropertyDefinitions within a PropertyDefintionList.
Commits on Apr 07, 2015
@strille strille Added xdescribe to list of jasmine vars 4973ab7
Commits on Apr 10, 2015
@rwaldron rwaldron Merge pull request #2214 from ModioAB/make-let-variables-in-closure-s…

[[FIX]] Make let variables in the closure shadow predefs
@rwaldron rwaldron Merge pull request #2227 from XhmikosR/update-check
[[CHORE]] Lint more stuff.
@rwaldron rwaldron Merge pull request #2230 from mbildner/zero-params-bug
[[FIX]] Correctly enforce maxparams:0
@rwaldron rwaldron Merge pull request #2234 from caitp/issue-1549
[[FEAT]] add `varstmt` enforcement option to disallow use of VariableStatements
@rwaldron rwaldron Merge pull request #2237 from julienw/1825-instanceof
Fix issue #1825: use of `!` with `instanceof` should require parentheses
@rwaldron rwaldron Merge pull request #2243 from jugglinmike/es6typeof
[[Fix]] Only accept "symbol" as a type in ES6 envs
@caitp caitp [[FIX]] emit I003 more carefully and less annoyingly
- Allows toggling es5 mode on/off if anyone needs that
- Only warns if the es5 option is explicitly set

Closes #2251
@rwaldron rwaldron Merge pull request #2263 from myshov/master
[[DOC]] Added more consistency among options file and config example
@rwaldron rwaldron Merge pull request #2264 from jacksonmj/newline-quote
[[FIX]] Incorrect 'Unclosed string' when the closing quote is the first character after a newline
@rwaldron rwaldron Merge pull request #2266 from stringparser/iojs-v1.6.0/lib/path.js-ty…

[[FIX]] default to empty string in src/cli.js loadIgnores
@rwaldron rwaldron [[CHORE]] Nit picking the quotes 63d9a46
@rwaldron rwaldron Merge pull request #2270 from jugglinmike/single-groups-fixes
Fix singleGroups bugs
@rwaldron rwaldron Merge pull request #2289 from karlhorky/patch-1
Add missing options for `unused`
@rwaldron rwaldron Merge pull request #2290 from jugglinmike/2288-get-as-ident-prop
[[FIX]] Accept `get` and `set` as ID properties
@rwaldron rwaldron Merge pull request #2291 from strille/master
Added xdescribe to list of jasmine vars
@arikon arikon Extends overrides section of base config
It was overwritten before
@arikon arikon Replace underscore with lodash 2fc1e23
@arikon arikon Add more tests for extends config option 928f19d
@rwaldron rwaldron v2.7.0 da0e77f
@rwaldron rwaldron [[DOCS]] output markdown from changelog script dd768c2
Commits on Apr 21, 2015
@jugglinmike jugglinmike [[Fix]] Update Lodash
When the 3.6.0 release of Lodash is included in a script using
Browserify, the resulting file cannot be executed in a browser web
worker context. This is how the homepage includes JSHint,
meaning that the website cannot be updated to demonstrate the latest

The 3.7.0 release of Lodash addresses this problem [1].

Update to Lodash version 3.7.0 so the next release can be published on
the JSHint homepage.

Commits on Apr 24, 2015
@caitp caitp [[FIX]] parse `const` declarations in ForIn/Of loops
Closes #2334
Closes #2335
Commits on Apr 29, 2015
@jugglinmike jugglinmike [[FIX]] Parse semicolons in class bodies
Although the semicolon token may appear in class bodies in valid ES6
code, it serves no purpose. Extend the parser to accept this token, but
emit the same warning used for unnecessary semicolons appearing
elsewhere. This warning may be disabled by the end user if desired.
@jugglinmike jugglinmike [[FIX]] Relax singleGroups restrictions: IIFEs
Although not technically necessary, the grouping operator is commonly
used to "wrap" function expressions in cases where it is the left-hand
side of some operator (typically as the target of invocation). This
pattern affords readers a hint that the function object in question is
the target of some further operation--likely many lines after the
initial `function` keyword.

Update the behavior of the `singleGroups` option to allow for such
usages since they serve a beneficial purpose beyond modifying expression
execution order.
@jugglinmike jugglinmike [[FIX]] Relax singleGroups restrictions: arrow fns
Because arrow functions are AssignmentExpressions but *not* primary
expressions, they cannot appear directly as the left-hand side of an
operator. Extend the behavior of the singleGroups option to allow the
grouping operator to wrap arrow functions, provided they do not end the
current statement.
Commits on May 02, 2015
@julienw julienw [[FIX]] add the "fetch" global for "browser" environment
Closes #2355
Commits on May 04, 2015
@keradus keradus src/options.js - toggle strict and globalstrict 2f5e5e6
Commits on May 05, 2015
@lukeapage lukeapage [[Fix]] Make const have block scope
Detect ++/-- on a const. Fixes gh-2271
@rwaldron rwaldron Merge pull request #2329 from jugglinmike/update-lodash
[[Fix]] Update Lodash
Commits on May 09, 2015
@caitp caitp [[FEAT]] support destructuring in ForIn/Of loops, lint bad ForIn/Of LHS
Adds support for destructuring bindings in for loops

Closes #2341
@jugglinmike jugglinmike [[FIX]] Distinguish between directive and mode
All code within a class body is interpreted as "strict mode" code. This
can be simulated by explicitly setting the internal mechanism for the
"use strict" directive, but that approach is misleading. In such cases,
the code is in strict mode, but the "use strict" directive is *not* set.

Define a general-purpose `isStrict` method that determines the language
mode according to these two distinct conditions.

This approach enables a more expressive and accurate means for the
internals to control parsing behavior. In addition, it may be re-used
when JSHint is extended to lint module bodies as strict mode code.
@jugglinmike jugglinmike [[FIX]] Move helper methods to `state` object
Declare these helper functions as part of the definition of the `state`
object. This makes these methods easier to discover. There is no need to
re-instantiate the methods when the state object is re-setand, so this
approach is slightly more efficient.

Remove unnecessary parameters and replace necessary boolean parameter
with an options object.
@jugglinmike jugglinmike [[FEAT]] Implement `module` option
As per the ECMAScript 6 specification, all module code is always strict
code. This option allows users to signal when the input code is intended
to be interpreted as a JavaScript module. This enables JSHint's
strict-mode-specific functionality without requiring a "use strict"
directive appear in the source (as this is redundant in compliant

Introduce a new error to restrict this option to code written as
ECMAScript 6 or later.
Commits on May 10, 2015
@rwaldron rwaldron Merge pull request #2354 from jugglinmike/class-body-semicolon
[[FIX]] Parse semicolons in class bodies
@rwaldron rwaldron Merge pull request #2353 from jugglinmike/single-groups-iifes
Relax singleGroups restrictions
@rwaldron rwaldron Merge pull request #2360 from keradus/docs-options
Options: toggle strict and globalstrict
@jugglinmike jugglinmike [[FIX]] Allow lexer to communicate completion
Currently, JSHint's lexer continuously emits new "end-of-file" token
once all input has been consumed. This behavior makes the internal
`advance` function dangerous to use within iteration contexts. Such
usages need to explicitly check for the "end-of-file" token in order to
avoid entering non-terminating states.

Some of JSHint's parsing logic (such as that for template literal
parsing) takes this detail into account. Other areas (i.e. parsing class
bodies and function parameter lists) does not. While it would be
possible to extend each use with explicit safety checks, the possibility
for error in future feature additions would remain.

Update the lexer to consistently emit `null` after producing the
"end-of-file" token, alleviating the requirement of explicit safety
checks in `advance`-calling code. Update existing unit tests with the
new parsing error information (which is more accurate in many cases).
Commits on May 12, 2015
@nicolo-ribaudo nicolo-ribaudo [[FIX]] Ignore unused arrow-function parameters if unused: vars
Fixes #2345
Commits on May 14, 2015
@nicolo-ribaudo nicolo-ribaudo [[FIX]] Don't throw "Duplicate class method" with computed method names
Fixes #2350
Commits on May 15, 2015
@arai-a arai-a [[FIX]] Reset generator flag for each method definition
This patch fixes the handling of non-generator method after generator method.
For examle:

    var a = {
      *gen() {
        yield 1;
      non_gen() {

Here, non_gen was treated as a generator function, since generator flag `g`
wasn't reset to false when `*` wasn't found before method name.

Closes #2388
Closes #2389
Commits on May 29, 2015
@travishorn travishorn Update license in package.json
Following the latest spec at

Include the identifier for the previously-omitted JSON License
Commits on May 31, 2015
@jugglinmike jugglinmike [[FIX]] Prevent regression in `enforceall`
Ensure that a recent change to option organization does not effect the
behavior of the `enforceall` option. Update the documentation to more
accurately describe the behavior of `enforceall`.
@jugglinmike jugglinmike v2.8.0 e6611af
Commits on Jun 03, 2015
@BYK BYK Add `mocha` to `mocha` environment
Mocha exposes the global name `mocha` too for configuration etc. This adds that to the `mocha` environment.
Commits on Jun 12, 2015
@nicolo-ribaudo nicolo-ribaudo [[FIX]] Add `window.performance` to browser vars
Fixes #2461
Commits on Jun 13, 2015
@jugglinmike jugglinmike [[CHORE]] Allow failures in coverage report
The Coveralls service occasionally fails to respond within the
continuous integration service's timeout interval. When invoked as part
of the test script, these timeouts trigger build failures.

Move coverage reporting to a task that occurs after build completion [1]
so that these timeouts do not effect build status.

This change also ensures that the project's full set of tests are run in
the continuous integration environment. Previously, only those tests
necessary for generating a code coverage report were executed (omitting
code style and linting checks).

[1] From the TravisCI service's documentation:

> The outcome of any of these commands (except `after_success`,
> `after_failure` or `after_script`) indicates whether or not this build
> has failed or passed.
@jugglinmike jugglinmike [[FIX]] Do not accept empty values for directives
Previously, when an directive was specified without a value, JSHint
would interpret this as the empty string and apply linting rules
accordingly. The empty string is never a valid value for any directive,
so the generated warnings were not appropriate.

If a directive is specified without a value, trigger an explicit error
describing the invalid configuration.
Commits on Jun 14, 2015
@nicolo-ribaudo nicolo-ribaudo [[FIX]] Add `HTMLCollection` to browser environment.
Closes #2443
@jugglinmike jugglinmike [[FIX]] Declare `func` as a property of `state`
The current `funct` object stores stateful information, so it should be
defined as a property of the global variable reserved for that purpose.
This allows other code to more simply operate based on the current
state because it requires one less reference to be managed across
Commits on Jun 20, 2015
@jugglinmike jugglinmike [[DOCS]] Introduce a mail mapping file
Some contributors have authored commits using different e-mail
addresses. Add a `.mailmap` file to allow git to correlate the identity
of these contributors across e-mail addresses.
Commits on Jun 21, 2015
@gintau gintau [[FIX]] Remove bad error E048 in for loop init
Fixes #1862, allowing block scope variables in the for loop initialiser
by not banning block scope variable declarations in a non block if the
statement is a for.
@jugglinmike jugglinmike [[DOCS]] Document `predef` option
Explain the behavior and usage of the option.
@jamestaylr jamestaylr [[FIX]] Remove module import declaration
Removes the deprecated `module x from 'y'` import declaration from the parser.
@nicolo-ribaudo nicolo-ribaudo [[FIX]] The `__iterator__` property is deprecated.
It should be used `Symbol.iterator`.
Now JSHint throws W103 instead of W104.
@lukeapage lukeapage [[Fix]] Scope issues by refactoring
Removes implied, scope and the keeping of variables on funct, by
refactoring all scope management into an expanded block scope manager
which keeps track of variable scope. As part of this it now tracks usages
and resolves them at the end of a scope so that a usage can be resolved to
a hoisted variable. This fixes #2439, fixes #2426, fixes #2410, fixes
 #2409, fixes #2374, fixes #2430, fixes #2368, fixes #2342, fixes #2363,
 fixes #2292, fixes #2199, fixes #2191, fixes #2090, fixes #1996, fixes
 #1775, fixes #1682, fixes #1462, fixes #1061.
@lukeapage lukeapage [[Chore]] Move scope-manager to external file 18a0582
@lukeapage lukeapage [[Test]] Add test for gh-985. Fixes #985 12b1049
@lukeapage lukeapage [[Fix]] Undo fix of bug #2409 as it is breaking b376de7
@lukeapage lukeapage [[Fix]] catch params are scoped to the catch only c3d0a3d
Commits on Jun 23, 2015
@jugglinmike jugglinmike Merge branch 'lukeapage/scope-manager-extract' 6d2cc19
Commits on Jun 24, 2015
@JasonCust JasonCust [[FIX]] Don't warn when Array() is used without 'new'.
Comply with [ECMAScript 5.1
spec]( to
allow `Array` to be called as a function.

Fixes gh-1987
Commits on Jun 27, 2015
@jonnyreeves jonnyreeves [[FIX]] handle no 'home' environment variables
This fixes jshint so it finds project `.jshintrc` files even if
the user does not have one of the defined 'home' environment variables.
@jugglinmike jugglinmike [[FIX]] Honor `ignore` directive more consistently
Ensure that the `ignore` directive applies even to tokens lexed during
lookahead operations.
@tstarling tstarling [[FIX]] labeled break and continue semantics
A labeled break may refer to any statement, it is not required to be
inside a loop or switch. Whereas a labeled continue must refer to a loop,
you cannot continue a switch.

In ECMAScript terminology, the identifier following "continue" must
appear in the label set of an enclosing IterationStatement (do, while,
for). The identifier following "break" must appear in the label set of
an enclosing Statement (which includes a simple Block).
@nicolo-ribaudo nicolo-ribaudo [[FEAT]] Option to assume strict mode
1) Some JavaScript compilers (e.g. Babel) add the "use strict" directive, so
   it isn't needed that it is present in the code.
2) In node.js you can use the --use_strict flag, which runs the code using
   strict mode.

The `strict` option has now five possible values:
- true / func - there must be a `"use strict";` directive at function level
- global      - there must be a `"use strict";` directive at global level
- implied     - JSHint checks the code as if there is the `"use strict";`
- false       - disable warnings about strict mode

The `globalstrict` option is now deprecated, it should be used `strict: global`

Close #924
@nicolo-ribaudo nicolo-ribaudo [[TEST]] Test `strict`'s value parsing a4f4bf4
@nicolo-ribaudo nicolo-ribaudo [[FIX]] Allow default values in destructuring.
    let { a = 1 } = {};
    function b([ c = 1 ] = []) {}
    let d = ({ e: f = 1 } = {}) => {};

Fixes #1941
Commits on Jun 28, 2015
@nicolo-ribaudo nicolo-ribaudo [[FIX]] Allow `__proto__` when using ES6
In EcmaScript 6 `__proto__` is no longer deprecated (but non-browser environments may not
support it).

- If proto option is on, JSHint behaves as before.
- If esnext option is off , JSHint warns: "'__proto__' is available in ES6 (use
esnext option).". (W119)
- If esnext is is on but browser, node, and rhino options are off, JSHint warns: "The '__proto__'
property may not be supported by non-browser environments." (New W135 warning).

Fixes #2371
Commits on Jun 29, 2015
@nicolo-ribaudo nicolo-ribaudo [[FIX]] Allow non-identifier PropertyNames in object destructuring.
Fix #2467
Commits on Jul 02, 2015
@nicolo-ribaudo nicolo-ribaudo [[FIX]] Don't crash on uncomplete typeof expression
Fixes #2506
@nicolo-ribaudo nicolo-ribaudo [[FIX]] Do not parse arrays which contain `for` as array comprehensions.
If an array contains the `for` identifier as a property of an object, it was wrongly detected as
array comprehension:
  var x = [ a.for ];

Fixes #1413
@jugglinmike jugglinmike [[CHORE]] Namespace tests for JSON parsing
This allows for targeted test runs.
@jugglinmike jugglinmike [[FIX]] Allow semicolon as string value in JSON
Previously, any token with the value ";" would trigger JSHint to lint
the input as though it were JavaScript code. Because the token value may
also describe a string, this caused JSHint to incorrectly interpret JSON
input as JavaScript in some cases.

Ensure that only semicolon tokens parsed as punctuators trigger
JavaScript parsing.
Commits on Jul 05, 2015
@lukeapage lukeapage [[TEST]] Test typeof in TDZ
Test that you cannot use typeof on a block scoped variable in the TDZ
Verifies #2455
@lukeapage lukeapage [[DOCS]] Add varstmt to example jshintrc
Fixes #2375
@lukeapage lukeapage [[CHORE]] Remove members variable which is unused
This variable is never used and looks like it was just left behind by
@caitp caitp Don't delete lines following lex'd `ignore:end`. Fixes gh-1879
Previously, lines would be cleared (set to the empty string) even after `ignore:end`
is found, if the comment was not processed first.

This change performs some minor comment processing in the lexer itself in order to
solve this problem.

Closes #1879
@lukeapage lukeapage Move ignore from state b717efd
@lukeapage lukeapage remove ignore from jshint 37174ae
@jugglinmike jugglinmike [[FIX]] Do not mark `ignore` directives as special
These directives can be handled by the lexer, so the directive processor
in jshint.js does not need to be aware of their presence.
@jugglinmike jugglinmike Merge branch 'fix-ignore' 39709b1
@lukeapage lukeapage [[FIX]] Change imported variables to be constants
As per the es6 spec, treat the variables declared via import as
constants, meaning they cannot be re-assigned and cannot be declared
Fixes #2428
@lukeapage lukeapage [[FIX]] Dont warn twice in var redeclaration
When a block scoped variable is declared twice in the same scope it is a
syntax error. If the variable is used between those declarations jshint
should not warn about use before declared and error on re-declaration, so
remove the use before declared warning in this case.

When a function scoped variable is declared twice and used before
2nd declaration, jshint does not warn in 2.8.0 but the scope manager
change regressed this so it started warning twice. This fixes that