Skip to content

Commit 278cd9e

Browse files
committed
- cleanup pr-comments
1 parent 1f3b267 commit 278cd9e

File tree

6 files changed

+45
-33
lines changed

6 files changed

+45
-33
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
- node - after node-v14 is deprecated, remove shell-code `export "NODE_OPTIONS=--unhandled-rejections=strict"`.
1616

1717
# v2022.6.1-beta
18-
- directive - add new directive `subscript` allowing JSLint to be used with scripts targeting Google Closure Compiler
18+
- directive - add new directive `subscript` for linting of scripts targeting Google Closure Compiler
1919
- warning - relax warning about missing `catch` in `try...finally` statement
20-
- jslint - allow aliases `evil, nomen` for jslint-directives `eval, name`, respectively
20+
- jslint - allow aliases `evil, nomen` for jslint-directives `eval, name`, respectively for backwards-compat
2121
- bugfix - fix broken codemirror example
2222
- bugfix - fix jslint not-recognizing option-chaining when comparing operands of binary operator
2323
- allow array-literals to directly call [...].flat() and [...].flatMap()

help.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,9 @@ <h1><code>/*jslint*/</code></h1>
486486
should be allowed to enclose string literals.</td>
487487
</tr>
488488
<tr>
489-
<td id="subscript">Allow identifiers in subscript-notation.</td>
489+
<td id="subscript">Allow identifier in subscript-notation.</td>
490490
<td><code>subscript</code></td>
491-
<td><code>true</code> to allow identifiers in
491+
<td><code>true</code> to allow identifier in
492492
subscript-notation, e.g.: <code>foo["bar"] = 1;</code>.
493493
This allows linting of scripts targeting Google Closure Compiler,
494494
where subscript-notation is commonly used to prevent renaming of

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@
11721172
<div title="Allow single-quote strings.">
11731173
<label><input type="checkbox" value="single">single</label>
11741174
</div>
1175-
<div title="Allow identifiers in subscript-notation.">
1175+
<div title="Allow identifier in subscript-notation.">
11761176
<label><input type="checkbox" value="subscript">subscript</label>
11771177
</div>
11781178
<div title="Allow 'this'.">
@@ -1443,7 +1443,7 @@
14431443
}) {
14441444
switch (target.tagName) {
14451445

1446-
// PR-368 - website
1446+
// PR-368 - Website
14471447
// Add clickable-links to editor-code in report-warnings and report-functions.
14481448

14491449
case "ADDRESS":
@@ -1642,7 +1642,7 @@
16421642
// .... /*jslint node*/ .......... Assume Node.js environment.
16431643
// .... /*jslint nomen*/ ......... Allow weird property names.
16441644
// .... /*jslint single*/ ........ Allow single-quote strings.
1645-
// .... /*jslint subscript*/ ..... Allow identifiers in subscript-notation.
1645+
// .... /*jslint subscript*/ ..... Allow identifier in subscript-notation.
16461646
// .... /*jslint this*/ .......... Allow 'this'.
16471647
// .... /*jslint trace*/ ......... Include jslint stack-trace in warnings.
16481648
// .... /*jslint unordered*/ ..... Allow unordered cases, params, properties,

jslint.mjs

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,9 @@ function globExclude({
469469
// $()*+-./?[\]^{|}
470470

471471
strRegex = strRegex.replace((
472-
// ignore [-/]
472+
473+
// Ignore [-/].
474+
473475
/[$()*+.?\[\\\]\^{|}]/g
474476
), "\\$&");
475477

@@ -1256,7 +1258,7 @@ function jslint(
12561258
mode_json: false, // true if parsing JSON.
12571259
mode_module: false, // true if import or export was used.
12581260
mode_property: false, // true if directive /*property*/ is
1259-
// used.
1261+
// ... used.
12601262
mode_shebang: false, // true if #! is seen on the first line.
12611263
option_dict,
12621264
property_dict,
@@ -2471,6 +2473,7 @@ function jslint_phase2_lex(state) {
24712473
global_dict[key] = "user-defined";
24722474

24732475
// PR-347 - Disable warning "unexpected_directive_a".
2476+
//
24742477
// state.mode_module = the_comment;
24752478

24762479
break;
@@ -3289,7 +3292,7 @@ function jslint_phase2_lex(state) {
32893292
case "node": // Assume Node.js environment.
32903293
case "nomen": // Allow weird property names.
32913294
case "single": // Allow single-quote strings.
3292-
case "subscript": // Allow identifiers in subscript-notation.
3295+
case "subscript": // Allow identifier in subscript-notation.
32933296
case "test_cause": // Test jslint's causes.
32943297
case "test_internal_error": // Test jslint's internal-error
32953298
// ... handling-ability.
@@ -3302,10 +3305,14 @@ function jslint_phase2_lex(state) {
33023305
case "white": // Allow messy whitespace.
33033306
option_dict[key] = val;
33043307
break;
3305-
// alias for eval
3308+
3309+
// PR-404 - Alias "evil" to jslint-directive "eval" for backwards-compat.
3310+
33063311
case "evil":
33073312
return option_set_item("eval", val);
3308-
// alias for nomen
3313+
3314+
// PR-404 - Alias "nomen" to jslint-directive "name" for backwards-compat.
3315+
33093316
case "name":
33103317
return option_set_item("nomen", val);
33113318
default:
@@ -4555,9 +4562,7 @@ function jslint_phase3_parse(state) {
45554562
if (the_subscript.id === "(string)" || the_subscript.id === "`") {
45564563
name = survey(the_subscript);
45574564

4558-
// PR-xxx - directive
4559-
// Add new directive "subscript" allowing JSLint to be used with scripts
4560-
// targeting Google Closure Compiler.
4565+
// PR-404 - Add new directive "subscript" to play nice with Google Closure.
45614566

45624567
if (!option_dict.subscript && jslint_rgx_identifier.test(name)) {
45634568

@@ -6357,6 +6362,7 @@ function jslint_phase3_parse(state) {
63576362
let names;
63586363

63596364
// PR-347 - Disable warning "unexpected_directive_a".
6365+
//
63606366
// if (typeof state.mode_module === "object") {
63616367
//
63626368
// // test_cause:
@@ -6715,8 +6721,7 @@ function jslint_phase3_parse(state) {
67156721

67166722
catchage = catch_stack.pop();
67176723

6718-
// PR-xxx - warning
6719-
// Relax warning about missing `catch` in `try...finally` statement.
6724+
// PR-404 - Relax warning about missing `catch` in `try...finally` statement.
67206725
//
67216726
// } else {
67226727
//
@@ -6845,12 +6850,14 @@ function jslint_phase3_parse(state) {
68456850
return stop("expected_identifier_a");
68466851
}
68476852

6848-
// PR-363 - Bugfix - fix false-warning
6849-
// <uninitialized 'bb'> in code '/*jslint node*/\nlet {aa:bb} = {}; bb();'
6853+
// PR-363 - Bugfix
6854+
// Add test against false-warning <uninitialized 'bb'> in code
6855+
// '/*jslint node*/\nlet {aa:bb} = {}; bb();'.
6856+
//
6857+
// token_nxt.label = name;
6858+
// the_variable.names.push(token_nxt);
6859+
// enroll(token_nxt, "variable", mode_const);
68506860

6851-
// token_nxt.label = name;
6852-
// the_variable.names.push(token_nxt);
6853-
// enroll(token_nxt, "variable", mode_const);
68546861
name = token_nxt;
68556862
the_variable.names.push(name);
68566863
survey(name);
@@ -11113,15 +11120,13 @@ function sentinel() {}
1111311120
processArgElem[1] = processArgElem.slice(1).join("=");
1111411121
switch (processArgElem[0]) {
1111511122

11116-
// PR-371
11117-
// Add cli-option `--exclude=...`.
11123+
// PR-371 - Add cli-option `--exclude=...`.
1111811124

1111911125
case "--exclude":
1112011126
excludeList.push(processArgElem[1]);
1112111127
break;
1112211128

11123-
// PR-371
11124-
// Add cli-option `--include=...`
11129+
// PR-371 - Add cli-option `--include=...`
1112511130

1112611131
case "--include":
1112711132
includeList.push(processArgElem[1]);
@@ -11221,15 +11226,13 @@ function sentinel() {}
1122111226
pathnameDict[pathname] = scriptCov;
1122211227
});
1122311228

11224-
// PR-400
11225-
// Filter directory `node_modules`.
11229+
// PR-400 - Filter directory `node_modules`.
1122611230

1122711231
if (!modeIncludeNodeModules) {
1122811232
excludeList.push("node_modules/");
1122911233
}
1123011234

11231-
// PR-400
11232-
// Filter files by glob-patterns in excludeList, includeList.
11235+
// PR-400 - Filter files by glob-patterns in excludeList, includeList.
1123311236

1123411237
data.result = globExclude({
1123511238
excludeList,

jslint_ci.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,6 @@ function globExclude({
19441944
/[\[\]]/g
19451945
), "\\$&");
19461946
strRegex = strRegex.replace((
1947-
// ignore [-/]
19481947
/[$()*+.?\[\\\]\^{|}]/g
19491948
), "\\$&");
19501949
strRegex = strRegex.replace((

test.mjs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,8 +861,9 @@ jstestDescribe((
861861
],
862862
var: [
863863

864-
// PR-363 - Bugfix - add test against false-warning
865-
// <uninitialized 'bb'> in code '/*jslint node*/\nlet {aa:bb} = {}; bb();'
864+
// PR-363 - Bugfix
865+
// Add test against false-warning <uninitialized 'bb'> in code
866+
// '/*jslint node*/\nlet {aa:bb} = {}; bb();'.
866867

867868
"/*jslint node*/\n",
868869
""
@@ -921,6 +922,9 @@ jstestDescribe((
921922
], [
922923
"debugger;", {devel: true}, []
923924
], [
925+
926+
// PR-404 - Alias "evil" to jslint-directive "eval" for backwards-compat.
927+
924928
"new Function();\neval();", {eval: true, evil: true}, []
925929
], [
926930
(
@@ -943,12 +947,18 @@ jstestDescribe((
943947
], [
944948
"/".repeat(100), {long: true}, []
945949
], [
950+
951+
// PR-404 - Alias "nomen" to jslint-directive "name" for backwards-compat.
952+
946953
"let aa = aa._;", {name: true, nomen: true}, []
947954
], [
948955
"require();", {node: true}, []
949956
], [
950957
"let aa = 'aa';", {single: true}, []
951958
], [
959+
960+
// PR-404 - Add new directive "subscript" to play nice with Google Closure.
961+
952962
"aa[\"aa\"] = 1;", {subscript: true}, ["aa"]
953963
], [
954964
"", {test_internal_error: true}, []

0 commit comments

Comments
 (0)