Permalink
Switch branches/tags
Commits on Apr 13, 2017
  1. [[FIX]] Removed warning message W041 (#3115)

    * [[FIX]] Removed warning message W041
    
    This commit removes the warning message W041 altogether from the jshint
    project.
    
    Fixes #3109
    
    * [[FIX]] Removed warning message W041
    
    This commit removes the warning message W041 and the corresponding
    assertions from junits.
    
    Fixes #3109
    sunilkumarc committed with rwaldron Apr 13, 2017
Commits on Apr 3, 2017
  1. [[FEAT]] Add enforcing option: `trailingcomma` (#3090)

    Missing trailing commas in array and object literals can result in
    undetectable visual ambiguities--the same visual ambiguities that lead
    to bugs when a programmer relies on automatic semicolon insertion.
    Therefore, it might be a good practice to always use them, so this
    option provides warnings in their absence.
    
    For example, this code might have worked last Tuesday:
    
        [
            b + c
        ].forEach(print);
    
    But if one adds an element to the array and forgets to compensate for
    the missing comma, no syntax error is thrown, and a linter cannot
    determine if this was a mistake or an intentional function invocation:
    
        [
            b + c
            (d + e)
        ].forEach(print);
    
    If one always appends a list item with a comma, this ambiguity cannot
    occur:
    
        [
            b + c,
        ].forEach(print);
    
        [
            b + c,
            (d + e),
        ].forEach(print);
    
    If this option is `true`, a warning will be thrown if a "," does not
    occur before the closing "]" or "}" in an array or object literal. If
    option `es3` is also `true`, this option does nothing, because otherwise
    the options would contradict each other, and the `es3` mandate is more
    pressing.
    
    There is no inverse of this option, that would warn if an ES5 programmer
    omitted a trailing comma. Omission of a trailing comma in ES5 provides
    no benefit, unlike option `trailingcomma`, which actually helps prevent
    bugs. Such an inverse feature would be considered "stylistic;" do not
    confuse `trailingcomma` as a "style" option, as it is no more
    "stylistic" than the default detection of semicolons is.
    committed with rwaldron Apr 3, 2017
  2. Esversion normalization (#3054)

    * [[CHORE]] Refactor linting directive logic
    
    Rename the internal `doOption` function to `lintingDirective` in order
    to better reflect its purpose. Move the logic dedicated to processing
    the "falls through" directive into this function.
    
    * [[CHORE]] Rename internal function
    
    * [[FIX]] Normalize interpretation of `esversion`
    
    Ensure that configurations containing either `esversion: 6` or
    `esversion: 2015` have identical effects, whether specified via an
    in-line directive, an RC file, or the programmatic API.
    
    * fixup! [[CHORE]] Refactor linting directive logic
    
    * fixup! [[CHORE]] Refactor linting directive logic
    committed with rwaldron Apr 3, 2017
Commits on Mar 18, 2017
  1. [[CHORE]] Improve continuous integration config

    Limit the "browser" test target to the latest version of Node.js only,
    and ensure it is run on the Windows-based CI system as well as the
    Linux-based CI system.
    committed Mar 18, 2017
  2. [[CHORE]] Update browser testing infrastructure

    Update the Node.js dependencies used to run automated browser tests.
    committed Mar 18, 2017
  3. [[TESTS]] Run Test262 tests in Windows CI env.

    Because the Test262 test suite is already being linted in the
    Linux-based CI environment, and because it does not involve the use of
    JSHint's command-line interface, this change is unlikely to uncover
    novel bugs in JSHint itself. However, this configuration helps prevent
    workflow regressions for Windows-based contributors.
    committed Mar 18, 2017
Commits on Feb 26, 2017
  1. [[CHORE]] Correct typo

    committed Feb 26, 2017
Commits on Feb 25, 2017
  1. Merge pull request #3098 from jugglinmike/test262

    [[TEST]] Run Test262 tests
    caitp committed on GitHub Feb 25, 2017
Commits on Feb 19, 2017
  1. [[TEST]] Run Test262 tests

    Include the Test262 project as a submodule and introduce a new test
    script that attempts to parse every test file it contains. Because this
    project currently fails a number of valid tests with both type I and
    type II errors, include a text file temporarily white-listing those
    tests.
    
    Managing the Test262 project repository as a git submodule is somewhat
    cumbersome for general development, so do not integrate this test in the
    default `npm test` command.
    committed Oct 20, 2016
Commits on Feb 5, 2017
  1. [[FIX]] Added missing "Storage" browser variable

    This variable is available globally in browsers, and can be used to
    override the behaviour of localStorage & sessionStorage.
    code-tree committed with Feb 27, 2016
Commits on Jan 28, 2017
  1. [[DOCS]] Remove outdated users

    These links no longer reference the organizations they originally
    described and should therefore be removed from the project
    documentation.
    committed Jan 28, 2017
Commits on Jan 8, 2017
Commits on Jan 7, 2017
  1. [[DOCS]] Fix typo

    committed Jan 7, 2017
Commits on Nov 26, 2016
Commits on Nov 12, 2016
Commits on Oct 20, 2016
  1. v2.9.4

    committed Oct 20, 2016
  2. [[CHORE]] Rename internal function

    The name `addEvalCode` more directly relates to relevant language in the
    ECMA262 specification.
    committed Oct 20, 2016
  3. [[FIX]] Do not duplicate reported warnings/errors

    Extend the testing infrastructure to recognize cases where identical
    warnings/errors are being reported, and address the areas of the code
    base that previously suffered from this problem.
    committed Oct 18, 2016
  4. [[FIX]] Report error for offending token value

    When a "rest" operator is not followed by the identifier, report the
    value of the unexpected token (not the "rest" operator itself).
    committed Oct 18, 2016
Commits on Oct 19, 2016
  1. [[CHORE]] Use project in latest state when linting (#2860)

    * [[CHORE]] Use project in latest state when linting
    
    The latest stable version of JSHint revealed an erroneous configuration:
    when the `console` identifier is listed as a global variable, JSHint
    creates an internal "label" to track references to that binding. The
    local `console` variable in `jshint.js` shadows this global reference,
    meaning the global binding is never referenced.
    
    Lint the in-development codebase with the tool in its current state.
    Update the configuration to avoid the new (valid) warning.
    
    * fixup! [[CHORE]] Use project in latest state when linting
    committed with rwaldron Oct 19, 2016
  2. [[DOCS]] Improve warning message for W040 (#3052)

    Expand the message to describe the rationale for the warning.
    committed with rwaldron Oct 19, 2016
Commits on Oct 18, 2016
  1. Enforce TDZ within initializer of lexical declaration (refactored) (#…

    …2733)
    
    * [[FIX]] Enforce TDZ within initializer of lexical declaration
    
    Fixes #2637
    
    * [[FIX]] Enforce TDZ within class heritage definition
    
    * [[FIX]] Enforce TDZ within for in/of head
    
    Fixes gh-2693
    
    * [[CHORE]] Refactor var initialization tracking
    
    Conceptually, the initialization state of a given variable is a property
    of that variable. Model that relationship in the code organization by
    tracking variable initialization using a dedicated property on the
    representation of the variable itself. Beyond improving code clarity
    (the "label" objects remain the single source of truth for the state of
    each variable), this also reduces memory allocation costs (no new
    objects need to be created).
    committed with rwaldron Oct 18, 2016
  2. [[FIX]] Remove `null` value from `errors` array (#3049)

    When reporting unrecoverable errors, JSHint would insert two elements
    into the global `errors` array: a descriptor for the error itself, and a
    `null` value. Because this behavior is undocumented and inconsistent, it
    is most likely the result of a programming error. Ensure that the
    `JSHINT.errors` collection contains only error descriptor.
    committed with rwaldron Oct 18, 2016
Commits on Oct 17, 2016
  1. [[DOCS]] Document inconsistent behavior (#3048)

    As noted in the in-line comment, the current behavior is a result of a
    programming error. It may not be resolved outside of a major release
    because the project documentation does not describe the more desirable
    consistent behavior.
    committed with rwaldron Oct 17, 2016
  2. [[FIX]] Correct interpretation of ASI (#3045)

    Previously, the following operators were incorrectly interpreted as
    "infix" operators:
    
    - `++`
    - `--`
    - `yield`
    
    The internal `isInfix` function tended to obscure this error because it
    identified "infix" tokens via a boolean logic expression that acted as a
    blacklist. This expression was difficult to understand and hostile to
    future extensions for new language features (because future tokens could
    be mistakenly implemented as "infix" operators).
    
    Update all "infix" operator token definitions to explicitly define the
    `infix` property, obviating the need for the internal `isInfix`
    function. Ensure that the aforementioned tokens are not interpreted as
    "infix" operators, This corrects the behavior of the internal
    `isEndOfExpr` function, which is appreciable when linting code that
    relies on automatic semicolon insertion.
    committed with rwaldron Oct 17, 2016
  3. [[FIX]] Avoid crashing on invalid input (#3046)

    A recent extension to the `instanceof` operator introduced logic that
    performed property access on the result of parsing the operator's
    right-hand expression operand. Because invalid code may not specify such
    an expression, this logic led to program crashes in response to the
    invalid syntax.
    
    Ensure that when the `instanceof` operator appears without a right-hand
    expression operand, JSHint reports a syntax error and exits gracefully.
    committed with rwaldron Oct 17, 2016
Commits on Sep 22, 2016
  1. Merge branch 'patch-1' of https://github.com/thorn0/jshint into thorn…

    …0-patch-1
    
    # By Georgii Dolzhykov
    # Via thorn0
    * 'patch-1' of https://github.com/thorn0/jshint:
      Fix the check if a file is ignored
    
    Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
    
    Conflicts:
    	tests/cli.js
    rwaldron committed Sep 22, 2016
  2. Update README.md (#2739)

    * Update README.md
    
    Fixing grammar, making words more streamline, adding that Google also uses JSHint
    
    * Update README.md
    
    Following caitp's note: "We've been moving away from code style conventions, might be better to leave that out"
    
    * Update README.md
    
    Following line note and adding more edits
    alanyee committed with rwaldron Sep 22, 2016
  3. [[FIX]] Allow RegExp literal as `yield` operand (#3011)

    Extend the lexer to recognize RegExp literals which immediately follow
    the `yield` operator.
    committed with rwaldron Sep 22, 2016