@jslint-org/jslint 2025.3.31 → 2025.10.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,11 +2,13 @@
2
2
 
3
3
  # Todo
4
4
  - doc - document supported/unsupported es6+ features
5
- - coverage - add macros `/*coverage-disable*/` and `/*coverage-enable*/`.
6
5
  - jslint - add html and css linting back into jslint.
7
6
  - jslint - add new warning requiring paren around plus-separated concatenations.
8
7
  - jslint - try to improve parser to be able to parse jquery.js without stopping.
9
8
 
9
+ # v2025.10.31
10
+ - coverage - Add coverage-directives '/*coverage-disable*/', '/*coverage-enable*/'. '//coverage-ignore-line'.
11
+
10
12
  # v2025.3.31
11
13
  - ci - Upgrade nodejs used in ci to v22.
12
14
  - ubuntu-ci - bugfix - Fix out-of-date apt-list when installing graphicsmagick.
package/README.md CHANGED
@@ -3,7 +3,7 @@ Douglas Crockford <douglas@crockford.com>
3
3
 
4
4
 
5
5
  # Status
6
- | Branch | [master<br>(v2025.3.31)](https://github.com/jslint-org/jslint/tree/master) | [beta<br>(Web Demo)](https://github.com/jslint-org/jslint/tree/beta) | [alpha<br>(Development)](https://github.com/jslint-org/jslint/tree/alpha) |
6
+ | Branch | [master<br>(v2025.10.31)](https://github.com/jslint-org/jslint/tree/master) | [beta<br>(Web Demo)](https://github.com/jslint-org/jslint/tree/beta) | [alpha<br>(Development)](https://github.com/jslint-org/jslint/tree/alpha) |
7
7
  |--:|:--:|:--:|:--:|
8
8
  | CI | [![ci](https://github.com/jslint-org/jslint/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/jslint-org/jslint/actions?query=branch%3Amaster) | [![ci](https://github.com/jslint-org/jslint/actions/workflows/ci.yml/badge.svg?branch=beta)](https://github.com/jslint-org/jslint/actions?query=branch%3Abeta) | [![ci](https://github.com/jslint-org/jslint/actions/workflows/ci.yml/badge.svg?branch=alpha)](https://github.com/jslint-org/jslint/actions?query=branch%3Aalpha) |
9
9
  | Coverage | [![coverage](https://jslint-org.github.io/jslint/branch-master/.artifact/coverage/coverage_badge.svg)](https://jslint-org.github.io/jslint/branch-master/.artifact/coverage/index.html) | [![coverage](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage/coverage_badge.svg)](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage/index.html) | [![coverage](https://jslint-org.github.io/jslint/branch-alpha/.artifact/coverage/coverage_badge.svg)](https://jslint-org.github.io/jslint/branch-alpha/.artifact/coverage/index.html) |
@@ -66,6 +66,8 @@ Douglas Crockford <douglas@crockford.com>
66
66
  - [Directive `/*property*/`](#directive-property)
67
67
  - [Directive `/*jslint-disable*/.../*jslint-enable*/`](#directive-jslint-disablejslint-enable)
68
68
  - [Directive `//jslint-ignore-line`](#directive-jslint-ignore-line)
69
+ - [Directive `/*coverage-disable*/.../*coverage-enable*/`](#directive-coverage-disablecoverage-enable)
70
+ - [Directive `//coverage-ignore-line`](#directive-coverage-ignore-line)
69
71
 
70
72
  10. [Package Listing](#package-listing)
71
73
 
@@ -891,6 +893,34 @@ eval("1"); //jslint-ignore-line
891
893
  ```
892
894
 
893
895
 
896
+ <br><br>
897
+ ### Directive `/*coverage-disable*/.../*coverage-enable*/`
898
+
899
+ ```js
900
+ /*coverage-disable*/
901
+
902
+ // JSLint will ignore code-coverage in this region.
903
+
904
+ if (false) {
905
+ console.log("hello world");
906
+ }
907
+
908
+ /*coverage-enable*/
909
+ ```
910
+
911
+
912
+ <br><br>
913
+ ### Directive `//coverage-ignore-line`
914
+
915
+ ```js
916
+ // JSLint will ignore code-coverage at given line.
917
+
918
+ if (false) {
919
+ console.log("hello world"); //coverage-ignore-line
920
+ }
921
+ ```
922
+
923
+
894
924
  <br><br>
895
925
  # Package Listing
896
926
  ![screenshot_package_listing.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_package_listing.svg)
@@ -923,7 +953,7 @@ eval("1"); //jslint-ignore-line
923
953
  - `git push upstream alpha -f`
924
954
  - verify ci-success for upstream-branch-alpha
925
955
  - https://github.com/jslint-org/jslint/actions
926
- - goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-p2024.11.24
956
+ - goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-p2025.10.28
927
957
  - click `Create pull request`
928
958
  - input `Add your description here...` with:
929
959
  ```
@@ -963,7 +993,7 @@ This PR will additionally:
963
993
  - `git push upstream alpha -f`
964
994
  - verify ci-success for upstream-branch-alpha
965
995
  - https://github.com/jslint-org/jslint/actions
966
- - goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-v2025.3.31
996
+ - goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-v2025.10.31
967
997
  - click `Create pull request`
968
998
  - input `Add a title` with: `# v20yy.mm.dd`
969
999
  - input `Add a description` with:
package/jslint.mjs CHANGED
@@ -106,9 +106,9 @@
106
106
  formatted_message, free, freeze, from, froms, fsWriteFileWithParents,
107
107
  fud_stmt, functionName, function_list, function_stack, functions, get,
108
108
  getset, github_repo, globExclude, global, global_dict, global_list,
109
- holeList, htmlEscape, id, identifier, import, import_list, import_meta_url,
110
- inc, includeList, indent2, index, indexOf, init, initial, isArray,
111
- isBlockCoverage, isHole, isNaN, is_equal, is_weird, join, jslint,
109
+ holeList, htmlEscape, id, identifier, ignoreLine, import, import_list,
110
+ import_meta_url, inc, includeList, indent2, index, indexOf, init, initial,
111
+ isArray, isBlockCoverage, isHole, isNaN, is_equal, is_weird, join, jslint,
112
112
  jslint_apidoc, jslint_assert, jslint_charset_ascii, jslint_cli,
113
113
  jslint_edition, jslint_phase1_split, jslint_phase2_lex, jslint_phase3_parse,
114
114
  jslint_phase4_walk, jslint_phase5_whitage, jslint_report, json,
@@ -163,7 +163,7 @@ let jslint_charset_ascii = (
163
163
  + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
164
164
  + "`abcdefghijklmnopqrstuvwxyz{|}~\u007f"
165
165
  );
166
- let jslint_edition = "v2025.3.31";
166
+ let jslint_edition = "v2025.10.31";
167
167
  let jslint_export; // The jslint object to be exported.
168
168
  let jslint_fudge = 1; // Fudge starting line and starting
169
169
  // ... column to 1.
@@ -10882,12 +10882,15 @@ body {
10882
10882
  background: #9d9;
10883
10883
  }
10884
10884
  .coverage .count {
10885
- color: #666;
10885
+ color: #333;
10886
10886
  }
10887
10887
  .coverage .coverageIgnore {
10888
10888
  background: #ccc;
10889
10889
  }
10890
10890
  .coverage .coverageLow,
10891
+ .coverage .ignore {
10892
+ background: #ccc;
10893
+ }
10891
10894
  .coverage .uncovered {
10892
10895
  background: #ebb;
10893
10896
  }
@@ -10911,6 +10914,10 @@ body {
10911
10914
  .coverage tr:hover td {
10912
10915
  background: #7d7;
10913
10916
  }
10917
+ .coverage pre:hover span.ignore,
10918
+ .coverage tr:hover td.coverageIgnore {
10919
+ background: #ccc;
10920
+ }
10914
10921
  .coverage pre:hover span.uncovered,
10915
10922
  .coverage tr:hover td.coverageLow {
10916
10923
  background: #f99;
@@ -11112,6 +11119,7 @@ body {
11112
11119
  lineList.forEach(function ({
11113
11120
  count,
11114
11121
  holeList,
11122
+ ignoreLine,
11115
11123
  line,
11116
11124
  startOffset
11117
11125
  }, ii) {
@@ -11159,7 +11167,11 @@ body {
11159
11167
  // true.
11160
11168
 
11161
11169
  if (isHole) {
11162
- lineHtml += " class=\"uncovered\"";
11170
+ lineHtml += (
11171
+ ignoreLine
11172
+ ? " class=\"ignore\""
11173
+ : " class=\"uncovered\""
11174
+ );
11163
11175
  }
11164
11176
  lineHtml += ">";
11165
11177
  chunk = "";
@@ -11179,7 +11191,9 @@ body {
11179
11191
  </span>
11180
11192
  <span class="count
11181
11193
  ${(
11182
- count <= 0
11194
+ (count <= 0 && ignoreLine)
11195
+ ? "ignore"
11196
+ : count <= 0
11183
11197
  ? "uncovered"
11184
11198
  : ""
11185
11199
  )}"
@@ -11416,6 +11430,7 @@ function sentinel() {}
11416
11430
  functions,
11417
11431
  url: pathname
11418
11432
  }) {
11433
+ let ignoreBlock = false;
11419
11434
  let lineList;
11420
11435
  let linesCovered;
11421
11436
  let linesTotal;
@@ -11425,14 +11440,23 @@ function sentinel() {}
11425
11440
  source.replace((
11426
11441
  /^.*$/gm
11427
11442
  ), function (line, startOffset) {
11443
+ if (line === "/*coverage-disable*/") {
11444
+ ignoreBlock = true;
11445
+ }
11428
11446
  lineList[lineList.length - 1].endOffset = startOffset - 1;
11429
11447
  lineList.push({
11430
11448
  count: -1,
11431
11449
  endOffset: 0,
11432
11450
  holeList: [],
11451
+ ignoreLine: (
11452
+ ignoreBlock || line.endsWith("//coverage-ignore-line")
11453
+ ),
11433
11454
  line,
11434
11455
  startOffset
11435
11456
  });
11457
+ if (line === "/*coverage-enable*/") {
11458
+ ignoreBlock = false;
11459
+ }
11436
11460
  return "";
11437
11461
  });
11438
11462
  lineList.shift();
@@ -11485,11 +11509,13 @@ function sentinel() {}
11485
11509
  });
11486
11510
  });
11487
11511
  linesTotal = lineList.length;
11488
- linesCovered = lineList.filter(function ({
11489
- count
11512
+ linesCovered = 0;
11513
+ lineList.forEach(function ({
11514
+ count,
11515
+ ignoreLine
11490
11516
  }) {
11491
- return count > 0;
11492
- }).length;
11517
+ linesCovered += count > 0 || ignoreLine;
11518
+ });
11493
11519
  await moduleFs.promises.mkdir((
11494
11520
  modulePath.dirname(coverageDir + pathname)
11495
11521
  ), {
package/package.json CHANGED
@@ -35,5 +35,5 @@
35
35
  "shCiArtifactUpload": 1,
36
36
  "shCiPublishNpm": 1,
37
37
  "type": "module",
38
- "version": "2025.3.31"
38
+ "version": "2025.10.31"
39
39
  }