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

jshint / jshint / 2620 / 3
100%
master: 100%

Build:
DEFAULT BRANCH: master
Ran 03 Apr 2017 06:44PM UTC
Files 13
Run time 1s
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

03 Apr 2017 06:29PM UTC coverage: 97.685% (+0.003%) from 97.682%
2620.3

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.

4008 of 4103 relevant lines covered (97.68%)

3374.93 hits per line

Source Files on job 2620.3
  • Tree
  • List 0
  • Changed 8
  • Source Changed 3
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2620
  • Travis Job 2620.3
  • 42dc5726 on github
  • Prev Job for on master (#2619.3)
  • Next Job for on master (#2621.3)
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

© 2026 Coveralls, Inc