• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jshint / jshint / 2620
100%

Build:
DEFAULT BRANCH: master
Ran 03 Apr 2017 06:39PM UTC
Jobs 4
Files 13
Run time 4min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
2620

push

travis-ci

rwaldron
[[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.

4 of 4 new or added lines in 1 file covered. (100.0%)

4011 of 4103 relevant lines covered (97.76%)

13499.7 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2620.1 03 Apr 2017 06:39PM UTC 0
97.73
Travis Job 2620.1
2 2620.2 03 Apr 2017 06:40PM UTC 0
97.68
Travis Job 2620.2
3 2620.3 03 Apr 2017 06:44PM UTC 0
97.68
Travis Job 2620.3
4 2620.4 03 Apr 2017 06:43PM UTC 0
97.68
Travis Job 2620.4
Source Files on build 2620
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2620
  • 42dc5726 on github
  • Prev Build on master (#2619)
  • Next Build on master (#2621)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc