Skip to content

Commit 8dfdf62

Browse files
committed
# v2026.7.30
- jslint-ecma - Add ES2015-feature for..of. - jslint - Disable directive-option /*jslint for*/, replacing it with for-loop specific warnings. - jslint - Update scope-related warnings for variables, depending on whether they are let/const (scope_block) or var (scope_function). - jslint - Change warning 'out_of_scope_a' to 'temporal_dead_zone_a'. - jslint - Change warning 'uninitialized_a' to 'unassigned_var_a'. - jslint - Change scope from scope_function to scope_block: - const-declaration - let-declaration - function-declaration - jslint - Add implicit scope_block for: - do-while - for-loop - if-else - while-loop - jslint - Add hidden scope_block for: - catch-variable - for-variable - function-parameter - label-name - jslint - Restrict scope from scope_function to its own function-body: - named-function-expression - jslint - Rename internal scope-variables to imporove readability of scope-logic: - 'blockage' to 'scope_block' - 'functionage' to 'scope_function' - jslint - Add block-scope to internal-function jslint_phase3_parse(). - jslint - Expand built-in-globals for browser, ecma, and node - auto-generated from online-sources. - jslint-ci - Add automated ci for shellcheck to lint shell-scripts. - jslint-regression - Cleanup indent for multiline-method-chaining. - jslint-regression - Fix jslint crashing before warning about dangling ')' or ']'. - jslint-parse - Fix jslint unable to continue parsing 'async aa => 0'. - jslint-parse - Fix jslint unable to continue parsing 'function aa(){}0'. - jslint-regression - Fix long-running regression where 'let x = x;' doesn't warn about temporal-dead-zone. - jslint-warning - Tighten warning of unused variables to be always on, regardless of module / nodejs mode. - jslint - Wrap all property-updates 'name.init = true/false' with calls to: name_declare() - 'let aa=0' post_a_assignment() - 'aa=0'
1 parent 4563300 commit 8dfdf62

7 files changed

Lines changed: 75 additions & 69 deletions

File tree

.ci.sh

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ shCiArtifactUploadCustom() {(set -e
1919
node --input-type=module --eval '
2020
import moduleFs from "fs";
2121
(async function () {
22-
let cacheKey = Math.random().toString(36).slice(-4);
23-
let fileDict = {};
22+
const cacheKey = Math.random().toString(36).slice(-4);
23+
const fileDict = {};
2424
await Promise.all([
2525
"index.html"
2626
].map(async function (file) {
@@ -49,7 +49,7 @@ import moduleFs from "fs";
4949
import moduleFs from "fs";
5050
import moduleChildProcess from "child_process";
5151
(async function () {
52-
let fileDict = {};
52+
const fileDict = {};
5353
let screenshotCurl;
5454
await Promise.all([
5555
"README.md"
@@ -130,7 +130,7 @@ echo "\
130130
node --input-type=module --eval '
131131
import moduleChildProcess from "child_process";
132132
(async function () {
133-
let {
133+
const {
134134
GITHUB_BRANCH0,
135135
GITHUB_GITHUB_IO
136136
} = process.env;
@@ -192,7 +192,7 @@ shCiBaseCustom() {(set -e
192192
import jslint from "./jslint.mjs";
193193
import moduleFs from "fs";
194194
(async function () {
195-
let fileDict = {};
195+
const fileDict = {};
196196
let fileModified;
197197
let versionBeta;
198198
let versionMaster;
@@ -244,8 +244,8 @@ import moduleFs from "fs";
244244
file: "jslint.mjs",
245245
// update version
246246
src: fileDict["jslint.mjs"].replace((
247-
/^let jslint_edition = ".*?";$/m
248-
), `let jslint_edition = "v${versionBeta}";`)
247+
/^const jslint_edition = ".*?";$/m
248+
), `const jslint_edition = "v${versionBeta}";`)
249249
}, {
250250
file: "jslint_ci.sh",
251251
// update coverage-code
@@ -286,7 +286,7 @@ import moduleFs from "fs";
286286
file,
287287
src
288288
}) {
289-
let src0 = fileDict[file];
289+
const src0 = fileDict[file];
290290
if (src !== src0) {
291291
console.error(`update file ${file}`);
292292
fileModified = file;
@@ -423,19 +423,18 @@ function objectDeepCopyWithKeysSorted(obj) {
423423
await Promise.all(promiseList);
424424
Object.entries(dictAll).forEach(function ([dictName, dict]) {
425425
Object.keys(dict).forEach(function (name) {
426-
let val;
427426
if (dictName !== "ecma_auto" && dictAll.ecma_auto[name]) {
428427
delete dict[name];
429428
}
430429
if (dictName === "node_auto") {
431-
val = ["----", "----"];
430+
const value = ["----", "----"];
432431
if (dict[name]) {
433-
val[0] = "node";
432+
value[0] = "node";
434433
}
435434
if (dictAll.browser_auto_node[name]) {
436-
val[1] = "brow";
435+
value[1] = "brow";
437436
}
438-
dict[name] = val.join(" ");
437+
dict[name] = value.join(" ");
439438
}
440439
});
441440
});
@@ -460,11 +459,11 @@ function objectDeepCopyWithKeysSorted(obj) {
460459
.trim()
461460
.replace((
462461
/^( *?".*?": )(".*?")/gm
463-
), function (ignore, name, val) {
462+
), function (ignore, name, value) {
464463
return (
465464
name
466465
+ " ".repeat(Math.max(0, 40 - name.length))
467-
+ val
466+
+ value
468467
);
469468
})
470469
+ "$2"
@@ -494,7 +493,7 @@ shCiVscePackageJslintWrapperVscode() {(set -e
494493
node --input-type=module --eval '
495494
import moduleFs from "fs";
496495
(async function () {
497-
let fileDict = {};
496+
const fileDict = {};
498497
await Promise.all([
499498
"README.md"
500499
].map(async function (file) {
@@ -637,7 +636,7 @@ import moduleFs from "fs";
637636
"type": "git",
638637
"url": "https://github.com/jslint-org/jslint.git"
639638
},
640-
"version": "2026.7.1"
639+
"version": "2026.7.30"
641640
}, undefined, 4)
642641
}
643642
].map(async function ({

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
- jslint-ecma - Add ES2018-feature Asynchronous Iteration.
55
- jslint-ecma - Add ES2015-feature iterators.
66
- jslint - Audit token-property '.free'.
7-
- jslint - Add warning and tdz for function-declaration inside block-scope.
87
- jslint-ecma - Expand ES2015-feature-support for es-module-export-statement.
98
- jslint - Relax warning expected_line_break_a_b for ternary-operator inside template-literal.
109
- jslint - Add ability to auto-fix whitespace.
1110
- jslint - Add html and css linting back into jslint.
1211
- jslint - Add new warning requiring paren around plus-separated concatenations.
1312
- jslint - Try to improve parser to be able to parse jquery.js without stopping.
1413

15-
# v2026.7.1-beta
14+
# v2026.7.30
1615
- jslint-ecma - Add ES2015-feature for..of.
1716
- jslint - Disable directive-option /*jslint for*/, replacing it with for-loop specific warnings.
1817
- jslint - Update scope-related warnings for variables, depending on whether they are let/const (scope_block) or var (scope_function).

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Douglas Crockford <douglas@crockford.com>
33

44

55
# Status
6-
| Branch | [master<br>(v2026.6.30)](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>(v2026.7.30)](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) |
77
|--:|:--:|:--:|:--:|
88
| 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) |
99
| 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) |
@@ -1068,7 +1068,7 @@ if (false) {
10681068
- verify ci-success @ https://github.com/kaizhu256/jslint/actions
10691069
- verify ci-success @ https://github.com/jslint-org/jslint/actions
10701070

1071-
1. goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-v2026.6.30
1071+
1. goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-v2026.7.30
10721072
- click `Create pull request`
10731073
- input `Add a title *` with: `# v20yy.mm.dd`
10741074
- input `Add a description` with:

jslint.mjs

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -410,23 +410,23 @@
410410

411411
// init debugInline
412412
const debugInline = (function () {
413-
let __consoleError = function () {
414-
return;
415-
};
413+
let consoleError = Object;
416414
function debug(...argList) {
417415

418416
// This function will print <argList> to stderr and then return <argList>[0].
419417

420-
__consoleError("\n\ndebugInline");
421-
__consoleError(...argList);
422-
__consoleError("\n");
418+
consoleError("\n\ndebugInline");
419+
consoleError(...argList);
420+
consoleError("\n");
421+
if (consoleError === Object) {
422+
consoleError = console.error;
423+
}
423424
return argList[0];
424425
}
425-
debug(); // Coverage-hack.
426-
__consoleError = console.error; //jslint-ignore-line
427426
return debug;
428427
}());
429-
const jslint_charset_ascii = (
428+
debugInline(); // coverage-hack
429+
const jslint_charset_ascii = ( //jslint-ignore-line
430430
"\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007"
431431
+ "\b\t\n\u000b\f\r\u000e\u000f"
432432
+ "\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017"
@@ -435,7 +435,7 @@ const jslint_charset_ascii = (
435435
+ "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
436436
+ "`abcdefghijklmnopqrstuvwxyz{|}~\u007f"
437437
);
438-
const jslint_edition = "v2026.7.1-beta";
438+
const jslint_edition = "v2026.7.30";
439439
const jslint_fudge = 1; // Fudge starting line and starting
440440
// ... column to 1.
441441
const jslint_global_dict_all = {
@@ -2980,7 +2980,7 @@ function jslint_phase2_lex(state) {
29802980
body.replace(jslint_rgx_directive_part, function (
29812981
match0,
29822982
key,
2983-
val,
2983+
value,
29842984
jj
29852985
) {
29862986
if (ii !== jj) {
@@ -2996,12 +2996,12 @@ function jslint_phase2_lex(state) {
29962996
ii += match0.length;
29972997
switch (the_comment.directive) {
29982998
case "global":
2999-
if (val) {
2999+
if (value) {
30003000

30013001
// test_cause:
30023002
// ["/*global aa:false*/", "lex_comment", "bad_option_a", "aa:false", 1]
30033003

3004-
warn("bad_option_a", the_comment, key + ":" + val);
3004+
warn("bad_option_a", the_comment, key + ":" + value);
30053005
}
30063006
global_dict[key] = "user-defined";
30073007

@@ -3011,7 +3011,7 @@ function jslint_phase2_lex(state) {
30113011

30123012
break;
30133013
case "jslint":
3014-
if (!option_set_item(key, val !== "false")) {
3014+
if (!option_set_item(key, value !== "false")) {
30153015

30163016
// test_cause:
30173017
// ["/*jslint undefined*/", "lex_comment", "bad_option_a", "undefined", 1]
@@ -3873,7 +3873,7 @@ function jslint_phase2_lex(state) {
38733873
return token_create(snippet);
38743874
}
38753875

3876-
function option_set_item(key, val) {
3876+
function option_set_item(key, value) {
38773877

38783878
// These are the options that are recognized in the option object or that may
38793879
// appear in a /*jslint*/ directive. Most options will have a boolean value,
@@ -3910,25 +3910,25 @@ function jslint_phase2_lex(state) {
39103910
case "variable": // Allow unordered const and let declarations
39113911
// ... that are not at top of scope_function.
39123912
case "white": // Allow messy whitespace.
3913-
option_dict[key] = val;
3913+
option_dict[key] = value;
39143914
break;
39153915

39163916
// PR-404 - Alias "evil" to jslint-directive "eval" for backwards-compat.
39173917

39183918
case "evil":
3919-
return option_set_item("eval", val);
3919+
return option_set_item("eval", value);
39203920

39213921
// PR-404 - Alias "nomen" to jslint-directive "name" for backwards-compat.
39223922

39233923
case "name":
3924-
return option_set_item("nomen", val);
3924+
return option_set_item("nomen", value);
39253925
default:
39263926
return false;
39273927
}
39283928

39293929
// Initialize global-variables.
39303930

3931-
switch (val && key) {
3931+
switch (value && key) {
39323932
case "browser":
39333933
case "couch":
39343934
case "devel":
@@ -4702,7 +4702,11 @@ function jslint_phase3_parse(state) {
47024702
test_cause("import");
47034703
break;
47044704
default:
4705-
if (option_dict.beta && !option_dict.variable) {
4705+
if (
4706+
(variable_prv.id !== "{" || the_variable.id === "var")
4707+
&& option_dict.beta
4708+
&& !option_dict.variable
4709+
) {
47064710

47074711
// test_cause:
47084712
// ["String();const aa=0", "check", "var_on_top_a_b", "block", 10]
@@ -10794,11 +10798,11 @@ async function moduleFsInit() {
1079410798
}
1079510799
}
1079610800

10797-
function noop(val) {
10801+
function noop(value) {
1079810802

10799-
// This function will do nothing except return <val>.
10803+
// This function will do nothing except return <value>.
1080010804

10801-
return val;
10805+
return value;
1080210806
}
1080310807

1080410808
function objectDeepCopyWithKeysSorted(obj) {
@@ -10825,12 +10829,12 @@ function objectDeepCopyWithKeysSorted(obj) {
1082510829
return sorted;
1082610830
}
1082710831

10828-
function object_assign_from_list(dict, list, val) {
10832+
function object_assign_from_list(dict, list, value) {
1082910833

1083010834
// Assign each property-name from <list> to <dict>.
1083110835

1083210836
list.forEach(function (key) {
10833-
dict[key] = val;
10837+
dict[key] = value;
1083410838
});
1083510839
return dict;
1083610840
}
@@ -10865,16 +10869,16 @@ function v8CoverageListMerge(processCovs) {
1086510869
return bb.endOffset - aa.endOffset;
1086610870
}
1086710871

10868-
function dictKeyValueAppend(dict, key, val) {
10872+
function dictKeyValueAppend(dict, key, value) {
1086910873

10870-
// This function will append <val> to list <dict>[<key>].
10874+
// This function will append <value> to list <dict>[<key>].
1087110875

1087210876
let list = dict.get(key);
1087310877
if (list === undefined) {
1087410878
list = [];
1087510879
dict.set(key, list);
1087610880
}
10877-
list.push(val);
10881+
list.push(value);
1087810882
}
1087910883

1088010884
function mergeTreeList(parentTrees) {

0 commit comments

Comments
 (0)