JSHint is a tool that helps to detect errors and potential problems in your JavaScript code

Related tags

QA Tools jshint
Overview

JSHint, A Static Code Analysis Tool for JavaScript

[ Use it onlineDocsFAQInstallContributeBlogTwitter ]

NPM version Linux Build Status Windows Build status Dependency Status devDependency Status Coverage Status

JSHint is a community-driven tool that detects errors and potential problems in JavaScript code. Since JSHint is so flexible, you can easily adjust it in the environment you expect your code to execute. JSHint is publicly available and will always stay this way.

Our goal

The project aims to help JavaScript developers write complex programs without worrying about typos and language gotchas.

Any code base eventually becomes huge at some point, so simple mistakes — that would not show themselves when written — can become show stoppers and add extra hours of debugging. So, static code analysis tools come into play and help developers spot such problems. JSHint scans a program written in JavaScript and reports about commonly made mistakes and potential bugs. The potential problem could be a syntax error, a bug due to an implicit type conversion, a leaking variable, or something else entirely.

Only 15% of all programs linted on jshint.com pass the JSHint checks. In all other cases, JSHint finds some red flags that could've been bugs or potential problems.

Please note, that while static code analysis tools can spot many different kind of mistakes, it can't detect if your program is correct, fast or has memory leaks. You should always combine tools like JSHint with unit and functional tests as well as with code reviews.

Reporting a bug

To report a bug simply create a new GitHub Issue and describe your problem or suggestion. We welcome all kinds of feedback regarding JSHint including but not limited to:

  • When JSHint doesn't work as expected
  • When JSHint complains about valid JavaScript code that works in all browsers
  • When you simply want a new option or feature

Before reporting a bug, please look around to see if there are any open or closed tickets that discuss your issue, and remember the wisdom: pull request > bug report > tweet.

Who uses JSHint?

Engineers from these companies and projects use JSHint:

And many more!

License

JSHint is licensed under the MIT Expat license.

Prior to version 2.12.0 (release in August 2020), JSHint was partially licensed under the non-free JSON license. The 2020 Relicensing document details the process maintainers followed to change the license.

The JSHint Team

JSHint is currently maintained by Rick Waldron, Caitlin Potter, Mike Pennisi, and Luke Page. You can reach them via [email protected].

Previous Maintainers

Originating from the JSLint project in 2010, JSHint has been maintained by a number of dedicated individuals. In chronological order, they are: Douglas Crockford, Anton Kovalyov, and Mike Sherov. We appreciate their long-term commitment!

Thank you!

We really appreciate all kinds of feedback and contributions. Thanks for using and supporting JSHint!

Comments
  • Please change jshint.js license, remove bad or evil

    Please change jshint.js license, remove bad or evil

    Hi, could you please modify the jshint.js license to be a real MIT license?

    The "The Software shall be used for Good, not Evil." prevents library to be packaged in Debian and maybe other repo where code should really be free of use (yes, even evil). And honestly, if someone wants to use it for evil... well I don't think he will care about the license :-)

    Thanks

    Olivier

    P2 Proposal 
    opened by osallou 84
  • Option for switch case indentation

    Option for switch case indentation

    It would be great to have an option to customize how switch statements should be indented (i.e. whether to follow Java's style of case statements having same indentation as switch or allowing extra indentation for case statements)

    switch (condition) {
    case ABC:
        statements;
        break;
    case DEF:
        statements;
        break;
    default:
        statements;
        break;
    }
    

    vs.

    switch (condition) {
        case ABC:
            statements;
            break;
        case DEF:
            statements;
            break;
        default:
            statements;
            break;
    }
    
    opened by andresgarza 69
  • redefinition of Promise (W079)

    redefinition of Promise (W079)

    I just switched from 2.4.4 to 2.5.1 But now all my requires are messed up because:

    var Promise = require('bluebird') Will warn about: Redefinition of Promise (W079)

    Is there anyway I can fix this ? I'm using bluebird all over the place.

    P1 
    opened by helmus 48
  • Opt-out of `Confusing use of '!'.`

    Opt-out of `Confusing use of '!'.`

    This check was added for issue #211 but there is no way to opt-out of this detection. As the original poster of that issue suggested, it should be enabled by default, but with an override.

    opened by 3rd-Eden 41
  • Add QUnit support to the assume list

    Add QUnit support to the assume list

    I was running JSHint on my tests and thought it would be nice to have an assume QUnit option just like you can for jQuery. Looking through the source, here is a suggestion.

    under boolOptions add the qunit option

    qunit      : true, // if QUnit globals should be predefined
    

    define all the qunit functions (taken from http://docs.jquery.com/Qunit)

        qunit = {
            asyncTest      : false
            deepEqual      : false
            equal          : false
            expect         : false
            module         : false
            notDeepEqual   : false
            notEqual       : false
            notStrictEqual : false
            ok             : false
            QUnit          : false
            raises         : false
            start          : false
            stop           : false
            strictEqual    : false
            test           : false
        },
    

    add support for qunit in assume()

        if (option.qunit)
            combine(predefined, qunit);
    
    opened by hakanson 39
  • Update minimatch version

    Update minimatch version

    Could you please update your package to use the latest version of minimatch? The version currently used by jshint is throwing deprecation warnings:

    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    
    opened by adamreisnz 37
  • High cyclomatic complexity on switch statements

    High cyclomatic complexity on switch statements

    Currently, every case in a switch block increments the cyclomatic complexity regardless of whether or not it falls through.

    This has a complexity of 4:

    function(someVal) {
        switch (someVal) {
            case 1:
            case 2:
            case 3:
                doSomething();
                break;
            default:
                doSomethingElse();
                break;
        }
    }
    

    This has a complexity of 2 while being logically equivalent:

    function(someVal) {
        if (someVal === 1 || someVal === 2 || someVal === 3) {
            doSomething();
        } else {
            doSomethingElse();
        }
    }
    

    I'm not an expert in cyclomatic complexity by any means, so I'm honestly not sure if this is correct or not. Even if this is the expected behavior, it seems like it would be nice to at least have a flag which could make these two function calculate the same cyclomatic complexity.

    bountysource P3 Has PR 
    opened by jncraton 37
  • Experimental Traceur features/ES7

    Experimental Traceur features/ES7

    One experimental/ES7 feature supported through Traceur that I want to start using today is async/await.

    What is JSHint’s stance on supporting experimental Traceur features i.e. ES7, e.g. async/await?

    Proposal 
    opened by OliverJAsh 35
  • option for making new optional

    option for making new optional

    Most of the code I deal with makes use of new with constructors optional, neither it's used:

    function Constructor() {
      var object = Object.create(Constructor.prototype)
      // ....
      return object
    }
    
    
    var object = Constructor()
    

    JSHint always reports error on instantiation on last line. Would be nice to have an option to suppress reports on these.

    opened by Gozala 34
  • Added optional asyncawait support on top of esnext.

    Added optional asyncawait support on top of esnext.

    Seems to work, passes the test suite, works well with arrow function and classes.

    Configure like in the following:

    "esnext": true
    "experimental": ["asyncawait"]   or "experimental": ["asyncawait", "asyncreqawait"]
    

    To try it:

    npm install -g -f https://github.com/sebv/jshint/archive/esnextnext.tar.gz
    

    EDIT updated options.

    opened by sebv 32
  • Option to assume strict mode (for nodejs)

    Option to assume strict mode (for nodejs)

    Now that nodejs is es5 compliant it can be run in strict mode by default without including (function () { "use strict"; /* code here */ }());.

    Will you add an option implicitstrict so that it's not required to have the boilerplate code?

    P2 Proposal 
    opened by coolaj86 32
  • `jshint` breaks on experimental feature `import * as file_json from 'file.json' assert { 'type': 'json' };`

    `jshint` breaks on experimental feature `import * as file_json from 'file.json' assert { 'type': 'json' };`

    I use jshint on a pre-commit hook for my repository . I use an experimental import feature for JSON import as on usage:

    Repository branch : https://github.com/trouchet/sappio/tree/development

    Results : https://results.pre-commit.ci/run/github/554918283/1672518676.9gUppcUFT82pDGGNrmiHew

    Usage:

    import * as pkg from '../../package.json' assert { 'type': 'json' };
    

    Hook jshint complains

    src/config/app_info.js: line 1, col 42, Missing semicolon.
    src/config/app_info.js: line 1, col 43, Expected an assignment or function call and instead saw an expression.
    src/config/app_info.js: line 1, col 49, Missing semicolon.
    src/config/app_info.js: line 1, col 52, Expected an assignment or function call and instead saw an expression.
    src/config/app_info.js: line 1, col 58, Missing semicolon.
    src/config/app_info.js: line 1, col 58, Expected '}' to match '{' from line 1 and instead saw ':'.
    src/config/app_info.js: line 1, col 60, Expected an assignment or function call and instead saw an expression.
    src/config/app_info.js: line 1, col 66, Missing semicolon.
    src/config/app_info.js: line 1, col 60, Unrecoverable syntax error. (25% scanned).
    
    opened by brunolnetto 0
  • Bump qs from 6.3.2 to 6.3.3

    Bump qs from 6.3.2 to 6.3.3

    Bumps qs from 6.3.2 to 6.3.3.

    Changelog

    Sourced from qs's changelog.

    6.3.3

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] fix for an impossible situation: when the formatter is called with a non-string value
    • [Fix] utils.merge: avoid a crash with a null target and an array source
    • [Fix] utils.merge`: avoid a crash with a null target and a truthy non-array source
    • [Fix] stringify: fix a crash with strictNullHandling and a custom filter/serializeDate (#279)
    • [Fix] utils: merge: fix crash when source is a truthy primitive & no options are provided
    • [Fix] when parseArrays is false, properly handle keys ending in []
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [Refactor] use cached Array.isArray
    • [Refactor] stringify: Avoid arr = arr.concat(...), push to the existing instance (#269)
    • [Docs] Clarify the need for "arrayLimit" option
    • [meta] fix README.md (#399)
    • [meta] Clean up license text so it’s properly detected as BSD-3-Clause
    • [meta] add FUNDING.yml
    • [actions] backport actions from main
    • [Tests] use safer-buffer instead of Buffer constructor
    • [Tests] remove nonexistent tape option
    • [Dev Deps] backport from main
    Commits
    • ff235b4 v6.3.3
    • 4310742 [Fix] parse: ignore __proto__ keys (#428)
    • da1eee0 [Dev Deps] backport from main
    • 2c103b6 [actions] backport actions from main
    • aa4580e [Robustness] stringify: avoid relying on a global undefined (#427)
    • f8510a1 [meta] fix README.md (#399)
    • 4c036ce [Fix] fix for an impossible situation: when the formatter is called with a no...
    • 180bfa5 [meta] Clean up license text so it’s properly detected as BSD-3-Clause
    • e0b2c4b [Tests] use safer-buffer instead of Buffer constructor
    • f7139bf [Fix] utils.merge: avoid a crash with a null target and an array source
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump minimatch from 3.0.4 to 3.0.5

    Bump minimatch from 3.0.4 to 3.0.5

    Bumps minimatch from 3.0.4 to 3.0.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • jshint doesn't expect regexp literals in one-liners following if/while/for conditions, and also else

    jshint doesn't expect regexp literals in one-liners following if/while/for conditions, and also else

    Trying this in vscode:

    if (x) /abc/.exec('abc');
    while (x) /abc/.exec('abc');
    for (;x;) /abc/.exec('abc');
    
    if (false) ;
    else /abc/.exec('abc');
    

    Several error underlines occur, but they shouldn't. Thanks! :)

    P2 
    opened by qdirks 3
  • [[FIX]] Cannot read properties of undefined (reading value) when expr…

    [[FIX]] Cannot read properties of undefined (reading value) when expr…

    if write code on https://jshint.com like this: `function main() { const {...} ; // this

    return 'Hello, World!'; }` chrome: Uncaught TypeError: Cannot read properties of undefined (reading 'value')

    Needs work 
    opened by Lokya 3
Releases(2.13.6)
  • 2.13.6(Nov 11, 2022)

  • 2.13.5(Jul 8, 2022)

  • 2.13.4(Jan 24, 2022)

  • 2.13.3(Jan 5, 2022)

  • 2.13.2(Dec 27, 2021)

  • 2.13.1(Aug 10, 2021)

  • 2.13.0(May 30, 2021)

    2.13.0 (2021-05-30)

    Bug Fixes

    • Allow comma expression in MemberExpression (f05c8d1)
    • Consider all exported bindings "used" (90228b7)
    • Correct interpretation of ImportSpecifier (72a8102)
    • Correct location for error (e831188)
    • Correct location reported for directive (ee6aa68)
    • Detect duplicate exported bindings (916c230)
    • Don't warn when Function() is used without 'new'. (#3531) (c13c5cc)
    • Don't warn when RegExp() is used without 'new'. (#3529) (c18a6e4)
    • Enforce restrictions on new operand (c2719eb)
    • Graduate BigInt support to esversion: 11 (553f816)
    • Improve declaration parsing (a9bdc93)
    • Report early reference with warning (2c1a5f8)
    • Support RegExp Unicode property escapes (e7fa785)

    Features

    • Add support for "export * as ns from" (c46f464)
    • Add support for import.meta (73d7e0d)
    • Add support for dynamic import (6bfcaed)
    • Add support for optional chaining (b125dbe)
    • Implement support for nullish coalescing (f50b14d)
    Source code(tar.gz)
    Source code(zip)
  • 2.12.0(Aug 3, 2020)

  • 2.11.2(Jul 30, 2020)

  • 2.11.1(May 14, 2020)

    2.11.1 (2020-05-14)

    This release includes patches from a number of first-time contributors. James Owen, Tim Gates, ossdev, stvcisco, and thetric helped to make this the best JSHint release yet. Thank you all!

    Bug Fixes

    • Correct ASI for break and continue (3eb1b02)
    • Correct ASI for C-style for loops (ac232a5)
    • Improve tokenization of RegExp literals (#3471) (f786002)
    • TypeError accessing 'value' of undefined (8884eb9), closes #3455
    • Use relative paths with --filename when recieving from stdin (c1b5c2b)

    Features

    • Replacing PhantomJS with Puppeteer (51963a3)
    Source code(tar.gz)
    Source code(zip)
  • 2.11.0(Jan 13, 2020)

    2.11.0 (2020-01-13)

    This release was previously published using the "release candidate" pattern. No regressions were reported in the four weeks that followed, so the change set is being promoted to a true "minor" release.

    The release notes for version 2.11.0-rc1 completely describes the changes included in this version.

    Source code(tar.gz)
    Source code(zip)
  • 2.10.3(Nov 5, 2019)

    2.10.3 (2019-11-04)

    Bug Fixes

    • Allow more escapes with RegExp u flag (5ac5c46)
    • Correct binding power of AwaitExpression (af04b1e)
    • Correct interpretation of commas (691dbdc)
    • Correct restrictions on class method names (f670aeb)
    • Correctly interpret class method names (82b49c4)
    • Do not crash on invalid program code (b14acca)
    • Interpret "object rest" ident as a binding (c0e9a5b)
    • Relax singleGroups for async functions (c5dcd90)
    • Tolerate static as class method name (9cb3b20)
    • Tolerate valid assignments (0a60c9e)
    • Validate lone arrow function parameter (38285cd)
    Source code(tar.gz)
    Source code(zip)
  • 2.10.2(Mar 13, 2019)

  • 2.10.1(Feb 5, 2019)

  • 2.10.0(Feb 5, 2019)

    2.10.0 (2019-02-05)

    This release introduces support for the three most recent editions of JavaScript: ES7, ES8, and ES9. Users can enable support for any one of these via the esversion linting option.

    Perhaps most notably, this includes "async functions." Since their standardization in ES2017, no feature has been more requested. We're happy to add support for this powerful new language feature. If the delay is any indication, extending JSHint's parser was no small task, and we were able to make many seemingly-unrelated corrections along the way.

    That progress is easiest to see in JSHint's performance on Test262 (the official test suite for the JavaScript programming language). Version 2.9.6 passed 84% of those tests. Version 2.10.0 passes 96%. We're excited to push that number higher, especially considering that new language features and new tests are being added every day. If you're curious about what needs to be done, we maintain an "expectations file" describing every test JSHint is known to fail today.

    This release also includes brand-new parsing logic for classes. We thank Ethan Dorta and Alex Kritchevsky, the two first-time contributors who made this possible!

    Bug Fixes

    • Accept new RegExp flag introduced by ES6 (26b9e53)
    • Add global variables introduced in ES2017 (aded551)
    • Add globals for EventTarget interface (b78083a)
    • Add globals for WindowOrWorkerGlobalScope (e0aac94)
    • Allow YieldExpression as computed property (40dca82)
    • Correct implementation of spread/rest (bd0ae0d)
    • Correct invalid function invocation (cda02ae)
    • Correct parsing of let token (030d6b4)
    • Correct parsing of arrow function (8fa6e39)
    • Correct parsing of InExpression (06f54d0)
    • Disallow dups in non-simple parameter list (4a5a4a5)
    • Disallow fn declarations in stmt positions (a0e0305)
    • Disallow YieldExpression in gnrtr params (17ca4e4)
    • Enforce UniqueFormalParameters for methods (280d36b)
    • Honor globals config in JavaScript API (0278731)
    • Report invalid syntax as error (5ca8b1a)
    • Update parsing of object "rest" property (58967ea)

    Features

    • Enable object rest/spread via esversion (3fc9c19)
    • Enforce ES2016 restriction on USD (2c2025b)
    • Implement noreturnawait (70ab03d)
    • Implement regexpu option (962dced)
    • Implement ES2019 RegExp "dotall" (457d732)
    • Implement support for async iteration (1af5930)
    • Implement support for ES8 trailing commas (29cab1f)
    • Implement support for object spread/rest (35e1b17)
    • Introduce exponentiation operator (21b8731)
    • Introduce linting option leanswitch (1f008f2)
    • Introduce support for async functions (bc4ae9f)
    Source code(tar.gz)
    Source code(zip)
  • 2.9.7(Dec 7, 2018)

  • 2.9.6(Jul 30, 2018)

    2.9.6 (2018-07-30)

    Bug Fixes

    • Add missing global objects for browser env (badc7a4)
    • Add other Fetch spec globals (07bb596), closes #2582
    • Allow closing over immutable bindings (7091685)
    • Allow computed method names in obj literal (a5ff715)
    • Allow empty export and trailing comma (631327e), closes #2567
    • Avoid infinite loop on invalid for stmt (56a4379)
    • Consistently ignore dot-prefixed dirs (8d4317e)
    • Correct impl of built-in bindings (a11d631)
    • Correct interpretation of whitespace (dd06eea)
    • Correct location of reported error (1c434a3)
    • Correct location reported for W043 (1d04868)
    • Correct reporting of var name in list comprehensions (0ff6644)
    • Correct restriction on function name (55aa54e)
    • Correct spelling of Uint8ClampedArray (8df4a32)
    • Create block scope for switch statements (aa2be10)
    • Disallow default values in rest parameters (b420aed)
    • Do not create binding for illegal syntax (9fe8c94)
    • Do not warn about non-ambiguous linebreaks (ab3ab85)
    • Fix "is is" message typos (7993101)
    • Preserve functionality in "legacy" Node.js (2f6ac13)
    • recognize Jasmine global spyOnProperty (827237f), closes #3183
    • Relax restriction on asgnmnt to arguments (0a66710)
    • Remove warning W100 (ff71d3c)
    • Report error for duplicate arrow params (506c7d5)
    • Report error for redeclared generator fns (8896fa3)
    • Restrict "name" of strict mode functions (a554c89)
    • Restrict super usage to valid forms (8f3f880)
    • Restrict IdentifierNames in ES5 code (5995a9f)
    • Tolerate division following closing brace (3aa02db)
    • Tolerate RegExp as void operand (3f920b5)
    • Tolerate whitespace in inline directives (efeb0f8)

    Features

    • List outer scoped variables of W083 (d03662c), closes #3211
    Source code(tar.gz)
    Source code(zip)
  • 2.9.5(Jun 22, 2017)

    2.9.5 (2017-06-22)

    Bug Fixes

    • Account for hoisting of importing bindings (bd36953)
    • Add onmessage to vars.worker (540ed85)
    • Added missing "Storage" browser variable (8cfe5ad)
    • Avoid crash when peeking past end of prog (c083866)
    • Avoid false positive (44d9e0b)
    • Close synthetic scope for labeled blocks (5f0f789)
    • Fail gracefully on invalid if syntax (#3103) (8c6ac87)
    • Honor "ignore" file when linting STDIN (d4f83a4)
    • Parse for-in/of head LHS as asnmt target (da52ad9)
    • Removed warning message W041 (#3115) (376fa62)
    • Throw W033 instead of E058 when the ; after a do-while stmt is missing (6907cd4)

    Features

    • Add enforcing option: trailingcomma (#3090) (42dc572)
    • Add MediaRecorder to vars.js (b075919)
    Source code(tar.gz)
    Source code(zip)
  • 2.9.4(Oct 20, 2016)

    2.9.4 (2016-10-20)

    Bug Fixes

    • Allow RegExp literal as yield operand (#3011) (b646aea)
    • Allow W100 to be ignored during lookahead (a2b3881), closes #3013
    • Avoid crashing on invalid input (#3046) (bec152c)
    • Correct interpretation of ASI (#3045) (9803e11)
    • Do not duplicate reported warnings/errors (dc4a4fe)
    • Enforce TDZ within initializer of lexical declaration 8e9d406), closes #2637
    • Enforce TDZ within class heritage definition 8e9d406)
    • Enforce TDZ within for in/of head 8e9d406), closes #2693
    • Offset line no.s of errors from eval code (2a31c94)
    • Remove null value from errors array (#3049) (f7eb3d7)
    • Report error for offending token value (3b06d01)
    Source code(tar.gz)
    Source code(zip)
  • 2.9.3(Aug 18, 2016)

    2.9.3 (2016-08-18)

    Bug Fixes

    • Add TypedArray globals for ES2015 (ee0acab)
    • Allow Expression within for-in head (56c95d0)
    • Avoid crash when peeking past end of prog (#2937) (330d429)
    • Correct behavior of singleGroups (#2951) (97fefb7)
    • Correct interpretation of ASI (#2977) (3ef7a03)
    • Correctly recognize asi after directives (039ee2e), closes #2714
    • Disallow Import declarations below top lvl (d800e44)
    • Support y RegExp flag in ES2015 code (#2999) (a801433)
    • Support semicolons within arrow fn params (#3003) (179a9d6)

    Features

    • Error for literals on rhs of instanceof (e3e745b), closes #2777
    Source code(tar.gz)
    Source code(zip)
  • 2.9.2(Apr 19, 2016)

    2.9.2 (2016-04-19)

    This release contains a number of bug fixes. As always, we thank everyone who reported issues and submitted patches; those contributions are essential to the continuing improvement of the project. We hope you'll keep it up!

    Bug Fixes

    • (cli - extract) lines can end with "\r\n", not "\n\r" (93818f3), closes #2825
    • Account for implied closures (c3b4d63)
    • Add CompositionEvent to browser globals (56515cf)
    • Allow destructuring in setter parameter (97d0ac1)
    • Allow parentheses around object destructuring assignment. (7a0bd70), closes #2775
    • Allow regex inside template literal (5dd9c90), closes #2791
    • Allow regexp literal after 'instanceof' (caa30e6), closes #2773
    • Correct CLI's indentation offset logic (47daf76), closes #2778
    • Do not crash on invalid input (2e0026f)
    • Do not fail on valid configurations (2fb3c24)
    • Don't throw E056 for vars used in two functions (fd91d4a), closes #2838
    • Emit correct token value from "module" API (4a43fb9)
    • Expand forms accepted in dstr. assignment (8bbd537)
    • Improve binding power for tagged templates (9cf2ff0)
    • Improve reporting of "Bad assignment." (08df19e)
    • Make the 'freeze' option less strict (b76447c), closes #1600
    • Report "Bad assignment." in destructuring (fe559ed)
    • Report character position for camelcase errors (480252a), closes #2845
    • Reserve await keyword in ES6 module code (b1c8d5b)
    Source code(tar.gz)
    Source code(zip)
  • 2.9.1(Jan 14, 2016)

    2.9.1 (2016-01-14)

    Following the revocation of version 2.9.0, we observed an extended "release candidate" phase where we encouraged users to vet JSHint for undesirable changes in behavior. During that time, we identified and resolved a number of such regressions. This release comprises all changes from the release candidate phase along with the improvements initially released as version 2.9.0. This release does not itself contain any changes to the codebase. If you are upgrading from version 2.8.0 or earlier, please refer to the previously-published release notes for details on bug fixes and features--these can be found in the project's CHANGELOG.md file and on the project's website.

    Source code(tar.gz)
    Source code(zip)
  • 2.9.1-rc3(Jan 13, 2016)

  • 2.9.1-rc2(Dec 22, 2015)

  • 2.9.1-rc1(Nov 12, 2015)

    2.9.1-rc1 (2015-11-12)

    Version 2.9.0 was revoked shortly after its release due to a number of regressions. Although the underlying issues have been resolved, we are sensitive to the possibility that there may be still more; as mentioned in 2.9.0's release notes, the variable tracking system saw a significant refactoring.

    In an effort to minimize friction with a new version, we're publishing a release candidate and requesting feedback from early adopters. Please give it a try in your projects and let us know about any surprising behavior!

    Bug Fixes

    • latedef shouldn't warn when marking a var as exported (c630994), closes #2662
    • Add File and FileList to browser global variables (7f2a729), closes #2690
    • Allow comments and new lines after /* falls through */ (3b1c925), closes #2652 #1660
    • Allow let and const to be in a block outside of a block (84a9145), closes #2685
    • Always warn about missing "use strict" directive (e85c2a1), closes #2668
    • Disallow incompatible option values (72ba5ad)
    • Do not enable newcap within strict mode (acaf3f7)
    • Don't throw W080 when the initializer starts with undefined (0d87919), closes #2699
    • Don't warn that an exported function is used before it is defined. (d0433d2), closes #2658
    • Enforce Identifier restrictions lazily (ceca549)
    • Global "use strict" regressions (04b43d2), closes #2657 #2661
    • Support property assignment when destructure assigning (b6df1f2), closes #2659 #2660
    • Throw W119 instead of "Unexpected '`'" when using templates in ES5 mode. (87064e8)

    Features

    • Support QUnit's global notOk (73ac9b8)
    Source code(tar.gz)
    Source code(zip)
  • 2.8.0(May 31, 2015)

    | Commit | Message/Description | | --- | --- | | https://github.com/jshint/jshint/commit/6afcde407b759b3a9b52a1892daaefdee515cea4 | [[FIX]] Prevent regression in enforceall | | https://github.com/jshint/jshint/commit/e47168f5aa9576819830554f1b37dc0d49b76d31 | Update license in package.json | | https://github.com/jshint/jshint/commit/2444a0463e1a99d46e4afa50ed934c317265529d | [[FIX]] Reset generator flag for each method definition | | https://github.com/jshint/jshint/commit/ab12dfb558d45654a160cb2a3b74b38d355e61b6 | [[FIX]] Don't throw "Duplicate class method" with computed method names | | https://github.com/jshint/jshint/commit/2ea9cb0f636cf005d48e53cc69b29175818f4ddf | [[FIX]] Ignore unused arrow-function parameters if unused: vars | | https://github.com/jshint/jshint/commit/a093f784ee5298973c6233e9113842cbe8d16c74 | [[FIX]] Allow lexer to communicate completion | | https://github.com/jshint/jshint/commit/290280c29d47baad06d8958ef4a90807f4a67e40 | [[FEAT]] Implement module option | | https://github.com/jshint/jshint/commit/678da76e6488eb20a8bd5449f47f41da5ea5eb54 | [[FIX]] Move helper methods to state object | | https://github.com/jshint/jshint/commit/51059bd050d7ff0a1aa2ebeb93da0754261534eb | [[FIX]] Distinguish between directive and mode | | https://github.com/jshint/jshint/commit/c0edd9ff84a68946c615198a4a6f188f6fbbd54d | [[FEAT]] support destructuring in ForIn/Of loops, lint bad ForIn/Of LHS | | https://github.com/jshint/jshint/commit/1bb80f9a5551a639db2be0dea655c9edef7a9b8a | [[Fix]] Make const have block scope | | https://github.com/jshint/jshint/commit/2f5e5e654466452325f77c35e88fb8c6fb086e9f | src/options.js - toggle strict and globalstrict | | https://github.com/jshint/jshint/commit/b3b41c8555da07eaeacb0648cdc8cbbec62c2f59 | [[FIX]] add the "fetch" global for "browser" environment | | https://github.com/jshint/jshint/commit/4a4f522f1e112a2d9be0c4df5653d085b0c68a86 | [[FIX]] Relax singleGroups restrictions: arrow fns | | https://github.com/jshint/jshint/commit/9f551603e400c9ec3828a2c323aff804d6a08176 | [[FIX]] Relax singleGroups restrictions: IIFEs | | https://github.com/jshint/jshint/commit/58c8e64c86259790254037faa8879ed210c7d429 | [[FIX]] Parse semicolons in class bodies | | https://github.com/jshint/jshint/commit/2b673d92107be93df80e48471dced0432a127f25 | [[FIX]] parse const declarations in ForIn/Of loops | | https://github.com/jshint/jshint/commit/9270b663d9c3d5446ace5084182795a2162b8dc2 | [[Fix]] Update Lodash | | https://github.com/jshint/jshint/commit/dd768c243af2bd3a8beb5e47768eef3ec7ab2e5e | [[DOCS]] output markdown from changelog script |

    Source code(tar.gz)
    Source code(zip)
  • 2.7.0(Apr 10, 2015)

    | Commit | Message/Description | | --- | --- | | https://github.com/jshint/jshint/commit/9feab2c2168e7c89db8a33e5478fb8cfb0ff2d92 | v2.7.0 | | https://github.com/jshint/jshint/commit/928f19dbf3378734ef2119689dc51acfa37edfc2 | Add more tests for extends config option | | https://github.com/jshint/jshint/commit/2fc1e2377ac590eb0455f0a2b0ffef76f3f0b0ef | Replace underscore with lodash | | https://github.com/jshint/jshint/commit/29b5a7e9ea3e1977cf173073b0d01745b4c4f133 | Extends overrides section of base config | | https://github.com/jshint/jshint/commit/63d9a463848768c578bb378bb5d23ed0b12b3240 | [[CHORE]] Nit picking the quotes | | https://github.com/jshint/jshint/commit/757fb73dbd5f5bb842053dbce294e30e5f130b49 | [[FIX]] emit I003 more carefully and less annoyingly | | https://github.com/jshint/jshint/commit/4973ab7a6f1b76a4c66fe8be84536b62e3f3ae34 | Added xdescribe to list of jasmine vars | | https://github.com/jshint/jshint/commit/2ad235c3ae3bdfd0d6d8e4874f9ad0df0be5bce9 | [[FIX]] Accept get and set as ID properties | | https://github.com/jshint/jshint/commit/3be589afbb78d8ce2f25f59032d5e8e03094f373 | Add missing options for unused | | https://github.com/jshint/jshint/commit/64f85f367c3632a70c5e8d055917223c1e316307 | [[FIX]] Prevent incorrect warnings for relations | | https://github.com/jshint/jshint/commit/896bf821d9da1bee7ac409ddb17b88f9dc3d4a87 | [[FIX]] Relax restrictions on singleGroups | | https://github.com/jshint/jshint/commit/0eeba14ec5c5a0c7345b996cd17626c9465938f8 | [[FIX]] default to empty string in src/cli.js loadIgnores | | https://github.com/jshint/jshint/commit/b804e65397a8ad776bc7c6b7e0c57ccf0219a69f | [[FIX]] Incorrect 'Unclosed string' when the closing quote is the first character after a newline | | https://github.com/jshint/jshint/commit/3e79b4e3d0a46e2ac818ebe7f3c71ccb5fc7a202 | [[DOC]] Added more consistency among options file and config example | | https://github.com/jshint/jshint/commit/12811e797a264f323b920b314db965b8adcb207e | [[TEST]] also test uninitialized var/let/const exports | | https://github.com/jshint/jshint/commit/3ce12674fe31808cdb71086ef912d0b1c7fab0d4 | [[FIX]] export all names for var/let/const declarations | | https://github.com/jshint/jshint/commit/231557a34683fe59ab4f4b4af57651bea3da0648 | [[FIX]] predefine HTMLTemplateElement in browser | | https://github.com/jshint/jshint/commit/f52da985dadb397710db8bbb58088d0826b44132 | fixup! Document legacy values for typeof | | https://github.com/jshint/jshint/commit/81f1690c6a2cd08ca908c261ed3a1329e16cb604 | fixup! Remove duplicate value | | https://github.com/jshint/jshint/commit/46f9ba431c9ff6167327c33d51f0e00618416030 | [[Fix]] Only accept "symbol" as a type in ES6 envs | | https://github.com/jshint/jshint/commit/7f7aac298002fa9a22372c67f256f0cbc92959f7 | [[FIX]] allow typeof symbol === "symbol" | | https://github.com/jshint/jshint/commit/92e1a60c8dcb9a19ee57c7309e67b585167140db | Lint more stuff. | | https://github.com/jshint/jshint/commit/448a6f2d0e33e3d997fb7f6b89dd5eb9c6bd211c | Fix issue #1825: use of ! with instanceof should require parentheses | | https://github.com/jshint/jshint/commit/27e957c37c99574e1642a384b17d2ca0d1bef970 | Update README | | https://github.com/jshint/jshint/commit/59396f73ed6d81b115f04ea9051a7373074cc9ee | [[FEAT]] add varstmt enforcement option to disallow use of VariableStatements | | https://github.com/jshint/jshint/commit/011364e7a5dca4a99b5a51aa6409f1800535f3c5 | [[FIX]] Correctly enforce maxparams:0 | | https://github.com/jshint/jshint/commit/a8cfae6537193d28f63d5dfae42f20c5cae2c6f6 | [[DOCS]] add [[CHORE]] commit tag for dev-ops/CI/dependencies commits | | https://github.com/jshint/jshint/commit/6f83a1a78a5f1edec3fc7ac4cb4fa116661c7d7e | [[CHORE]] update dependencies | | https://github.com/jshint/jshint/commit/96a97d0c7f3b95a45224a603edb35100133240d4 | [[TEST]] improve test coverage for lone/extra rest operators | | https://github.com/jshint/jshint/commit/dd08f85ba02c60af075481fb9e4399ae97ec27b6 | [[FIX]] disallow 'lone' rest operator in identifier() | | https://github.com/jshint/jshint/commit/3477933e295dc30c22022d424814be8e4778ad46 | [[FIX]] allow trailing comma in ArrayBindingPattern | | https://github.com/jshint/jshint/commit/162dee6d4d3f78ec0e0a1d3e2232454de087cbbc | [[FIX]] templates are operands, not operators | | https://github.com/jshint/jshint/commit/cfd2e0bab32a8f21d0345934d02926a33aa44853 | [[FIX]] Make let variables in the closure shadow predefs |

    Source code(tar.gz)
    Source code(zip)
  • 2.6.3(Feb 28, 2015)

  • 2.6.2(Feb 28, 2015)

  • 2.6.1(Feb 27, 2015)

    633d1a0[[Fix]] JSCS issue
    813d97a[[FIX]] Prevent beginning array from being confused for JSON
    ff7228e[[Fix]] export default * are defined in lexical module scope. Fixes gh-2197
    4816dbd[[FEAT]] parse and lint tagged template literals
    cc8ccd7[[TEST]] fix typo in test case
    278ad75Add node.js 0.12 in CI.
    832f168[[DOCS]] Update link to CLA
    35df49f[[FIX]] Do not crash on improper use of `delete`
    b9b3a43splits eval as key tests into browser and node test runs.
    0ec9e03Use double quotes in test code
    b5f5d5d[[FIX]] Permit "eval" as object key
    ac98a24[[FIX]] Simulate class scope for class expr names
    7db4e33[[TEST]] Test linting JSON
    da52aa0[[FEAT]] Implement new option `futurehostile`
    d75ef69[[FIX]] Disambiguate argument
    06b5d40[[FIX]] Refactor `doFunction`
    a10daa1fix unit tests for adding error message. eliminate space
    ca7c639fix unit tests for adding error message. eliminate space
    b477896Fixing automatic tests
    eb46f40informative error when jshintrc is invalid
    f0bff58[[FIX]] Remove tautological condition
    4e59553[[TEST]] Improve lexer test coverage
    5b33e0f[[TEST]] Add test for bad option value
    3b934d4[[TEST]] Test all inline "latedef" options
    3f1006d[[TEST]] Add bad option test for unused
    0169b9c[[TEST]] Test inline rules for shadow
    2554c0b[[TEST]] Test escaped regex char ranges
    71f8e0f[[TEST]] Add tests for bad unicode
    83da4fd[[TEST]] Test all bitwise operators
    e69acfe[[FIX]] remove unused var
    7e80490[[FIX]] Remove quotmark linting for NoSubstTemplates
    065961a[[FIX]] Unfollowable path in lexer.
    5c9c7fd[[FIX]] Handle multi-line tokens after return or yield
    20ff670[[FIX]] Templates can not be directives
    4f08b74[[FIX]] Allow object-literals within template strings
    3da1eaf[[FIX]] Parse nested templates
    da57341[[TEST]] Upgrade JSCS and use it for indentation checking.
    438d928[[FIX]] ES6 modules respect undef and unused
    776ed69[[FIX]] Support more cases of ES6 module usage
    33612f8[[FIX]] Fix false positives in 'nocomma' option
    6003c83[[FIX]] Correct behavior of `singleGroups`
    8fe6610[[FIX]] Miss xdescribe/xit/context/xcontext in mocha
    e0f839b[[DOCS]] Add details relating to CLA
    bc857f3[[FIX]] Correct token reported by `singleGroups`
    2dc713a[[DOCS]] Switch to shields.io for the badges.
    efdd4e1Test node 0.11 on appveyor/windows
    4e89216[[DOCS]] Document deprecated options
    437655a[[FIX]] Allow array, grouping and string form to follow spread operator in function call args.
    42a6153Allow W117 and undef to be toggled per line.
    Source code(tar.gz)
    Source code(zip)
Detect copy-pasted and structurally similar code

Detect copy-pasted and structurally similar JavaScript code. Requires Node.js 6.0+, and supports ES6, JSX as well as Flow. Note: the project has been

Daniel St. Jules 3.5k Dec 26, 2022
The JavaScript Code Quality Tool

JSLint, The JavaScript Code Quality Tool Douglas Crockford [email protected] 2019-03-15 jslint.js contains the jslint function. It parses and a

Douglas Crockford 3.5k Jan 6, 2023
🌟 JavaScript Style Guide, with linter & automatic code fixer

JavaScript Standard Style Sponsored by English • Español (Latinoamérica) • Français • Bahasa Indonesia • Italiano (Italian) • 日本語 (Japanese) • 한국어 (Ko

Standard JS 27.8k Dec 31, 2022
Prettier is an opinionated code formatter.

Opinionated Code Formatter JavaScript · TypeScript · Flow · JSX · JSON CSS · SCSS · Less HTML · Vue · Angular GraphQL · Markdown · YAML Your favorite

Prettier 44.5k Dec 30, 2022
Pre-evaluate code at build-time with babel-macros

preval.macro This is a babel-plugin-macros macro for babel-plugin-preval. Please see those projects for more information. Installation This module is

Kent C. Dodds 118 Dec 16, 2022
For formatting, searching, and rewriting JavaScript.

jsfmt For formatting, searching, and rewriting JavaScript. Analogous to gofmt. Installation npm install -g jsfmt Usage $ jsfmt --help Usage: jsfmt [

Rdio 1.7k Dec 9, 2022
Magic number detection for JavaScript

Magic number detection for javascript. Let Buddy sniff out the unnamed numerical constants in your code. Overview What are magic numbers? Installation

Daniel St. Jules 827 Dec 24, 2022
Beautifier for javascript

JS Beautifier This little beautifier will reformat and re-indent bookmarklets, ugly JavaScript, unpack scripts packed by Dean Edward’s popular packer,

null 8k Jan 3, 2023
CLI tool to add @ts-expect-errors to typescript type errors

suppress-ts-errors Cli tool to add comments to suppress typescript type errors. Add @ts-expect-error or @ts-ignore comments to all locations where err

ryo 53 Dec 8, 2022
Easy-to-use tool to inform you about potential risks in your project dependencies list

sdc-check Easy-to-use tool to inform you about potential risks in your project dependencies list Usage Add to your project Add new npm command to scri

Maksim Balabash 132 Dec 4, 2022
Find and fix problems in your JavaScript code.

ESLint Website | Configuring | Rules | Contributing | Reporting Bugs | Code of Conduct | Twitter | Mailing List | Chat Room ESLint is a tool for ident

ESLint 21.9k Dec 31, 2022
Find and fix problems in your JavaScript code.

ESLint Website | Configuring | Rules | Contributing | Reporting Bugs | Code of Conduct | Twitter | Mailing List | Chat Room ESLint is a tool for ident

ESLint 22k Jan 8, 2023
In Your Face shows you Doom 'Ouch Faces' that correlate to the number of errors in your code!

In Your Face Watch how I made this extension on YouTube here In Your Face is a VS Code extension that shows you Doom 'Ouch Faces' that correlate to th

Virej Dasani 125 Dec 25, 2022
null 8 Nov 11, 2022
Golf it! is a game designed to let you show off your code-fu by solving problems

Golf it! Golf it! is a game designed to let you show off your code-fu by solving problems in the least number of characters ✨ Explore the docs » View

Ashikka Gupta 5 Aug 18, 2022
A list of helpful front-end related questions you can use to interview potential candidates, test yourself or completely ignore.

Front-end Developer Interview Questions This repository contains a number of front-end interview questions that can be used when vetting potential can

H5BP 56.1k Jan 4, 2023
Web app to display potential profits of cryptocurrencies.

What_If With the recent stock market and cryptocurrency rally in the past two years I often found myself wondering how much would I have made if I bou

null 3 Feb 12, 2022
A website that acts as a guide about the universities to potential students whole throughout the globe.

A website that acts as a guide about the universities to potential students whole throughout the globe.

null 1 Apr 15, 2022
Hello Jobs is a one-stop solution for all job seekers. In future, this could also serve as a platform for recruiters to hire potential candidates.

Hello Jobs Hello Jobs is a one-stop solution for all job seekers. In future, this could also serve as a platform for recruiters to hire potential cand

S Harshita 6 Dec 26, 2022
An open-source Typing-effect Library, That enables potential users to add a typing effect to mere DOM Elements.

Typing Effect Library An open-source Typing-effect Library I created. That enables potential users to add a typing effect to mere DOM Elements. Tool P

Okoye Charles 14 Oct 3, 2022