@jslint-org/jslint 2023.4.29 → 2023.5.23
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 +9 -2
- package/README.md +97 -1
- package/asset_codemirror_rollup.js +1 -1
- package/jslint.mjs +60 -15
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,9 +5,16 @@
|
|
|
5
5
|
- coverage - add macros `/*coverage-disable*/` and `/*coverage-enable*/`.
|
|
6
6
|
- jslint - add html and css linting back into jslint.
|
|
7
7
|
- jslint - add new warning requiring paren around plus-separated concatenations.
|
|
8
|
-
- jslint - require regexp to use open-form.
|
|
9
8
|
- jslint - try to improve parser to be able to parse jquery.js without stopping.
|
|
10
|
-
|
|
9
|
+
|
|
10
|
+
# v2023.5.23
|
|
11
|
+
- jslint - Check exported properties are ordered.
|
|
12
|
+
- jslint - Add grammar for "export async function ...".
|
|
13
|
+
- python - Add shell-function shLintPython().
|
|
14
|
+
- jslint - Add grammar for regexp-named-capture-group and regexp-named-backreference.
|
|
15
|
+
- jslint - Add grammar for side-effect import-statement.
|
|
16
|
+
- ci - Rename shell-function shRawLibFetch() to shRollupFetch().
|
|
17
|
+
- doc - document devop procedures to maintain jslint-repo
|
|
11
18
|
|
|
12
19
|
# v2023.4.29
|
|
13
20
|
- vscode - Add manual lint-on-save command to vscode-jslint extension.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ Douglas Crockford <douglas@crockford.com>
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
# Status
|
|
6
|
-
| Branch | [master<br>(v2023.
|
|
6
|
+
| Branch | [master<br>(v2023.5.23)](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 | [](https://github.com/jslint-org/jslint/actions?query=branch%3Amaster) | [](https://github.com/jslint-org/jslint/actions?query=branch%3Abeta) | [](https://github.com/jslint-org/jslint/actions?query=branch%3Aalpha) |
|
|
9
9
|
| Coverage | [](https://jslint-org.github.io/jslint/branch-master/.artifact/coverage/index.html) | [](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage/index.html) | [](https://jslint-org.github.io/jslint/branch-alpha/.artifact/coverage/index.html) |
|
|
@@ -73,6 +73,12 @@ Douglas Crockford <douglas@crockford.com>
|
|
|
73
73
|
|
|
74
74
|
12. [License](#license)
|
|
75
75
|
|
|
76
|
+
13. [Devops Instruction](#devops-instruction)
|
|
77
|
+
- [branch-master commit](#branch-master-commit)
|
|
78
|
+
- [branch-master publish](#branch-master-publish)
|
|
79
|
+
- [pull-request merge](#pull-request-merge)
|
|
80
|
+
- [vscode-jslint publish](#vscode-jslint-publish)
|
|
81
|
+
|
|
76
82
|
|
|
77
83
|
<br><br>
|
|
78
84
|
# Web Demo
|
|
@@ -895,6 +901,96 @@ eval("1"); //jslint-ignore-line
|
|
|
895
901
|
- CodeMirror editor is under [MIT License](https://github.com/codemirror/codemirror5/blob/d0e3b2e727c41aa4fd89fbad0adfb3815339174c/LICENSE).
|
|
896
902
|
- Function `v8CoverageListMerge` is derived from [MIT Licensed v8-coverage](https://github.com/demurgos/v8-coverage/blob/73446087dc38f61b09832c9867122a23f8577099/ts/LICENSE.md).
|
|
897
903
|
|
|
904
|
+
|
|
905
|
+
<br><br>
|
|
906
|
+
# Devops Instruction
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
<br><br>
|
|
910
|
+
### branch-master commit
|
|
911
|
+
- $ `shGitSquashPop <commit-beta> '# v20yy.mm.dd\n<release notes from CHANGELOG.md>'`
|
|
912
|
+
- verify correct-year `20yy`
|
|
913
|
+
- $ `git push origin alpha:branch-v20yy.mm.dd`
|
|
914
|
+
- $ `git push upstream alpha -f`
|
|
915
|
+
- verify ci-success for upstream-branch-alpha
|
|
916
|
+
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
|
|
917
|
+
- goto https://github.com/kaizhu256/jslint/pulls
|
|
918
|
+
- click `New pull request`
|
|
919
|
+
- click `base repository: jslint-org/jslint base:beta`
|
|
920
|
+
- click `head repository: kaizhu256/jslint compare:branch-v20yy.mm.dd`
|
|
921
|
+
- click `Create pull request`
|
|
922
|
+
- verify ci-success for pull-request
|
|
923
|
+
- https://github.com/jslint-org/jslint/actions/workflows/on_pull_request.yml
|
|
924
|
+
- click `Rebase and merge`
|
|
925
|
+
- verify ci-success for upstream-branch-beta
|
|
926
|
+
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
|
|
927
|
+
```shell
|
|
928
|
+
git fetch upstream beta
|
|
929
|
+
git diff alpha..upstream/beta
|
|
930
|
+
# verify no diff between alpha..upstream/beta
|
|
931
|
+
git reset upstream/beta
|
|
932
|
+
git push origin alpha -f
|
|
933
|
+
git push origin alpha:beta
|
|
934
|
+
git push upstream alpha -f
|
|
935
|
+
git push origin :branch-v20yy.mm.dd -f
|
|
936
|
+
```
|
|
937
|
+
- verify ci-success for origin-branch-alpha
|
|
938
|
+
- https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
|
|
939
|
+
- verify ci-success for upstream-branch-alpha
|
|
940
|
+
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
<br><br>
|
|
944
|
+
### branch-master publish
|
|
945
|
+
- $ `git push upstream beta:master`
|
|
946
|
+
- verify ci-success for upstream-branch-master
|
|
947
|
+
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
|
|
948
|
+
- goto https://github.com/jslint-org/jslint/releases/new
|
|
949
|
+
- input tag `v20yy.mm.dd`
|
|
950
|
+
- click `Create new tag: v20yy.mm.dd on publish`
|
|
951
|
+
- verify correct-year `20yy`
|
|
952
|
+
- click `Target: master`
|
|
953
|
+
- input `Release title: v20yy.mm.dd - <description>`
|
|
954
|
+
- copy-paste release notes from CHANGELOG.md
|
|
955
|
+
- click `Generate release notes`
|
|
956
|
+
- click `Set as the latest release`
|
|
957
|
+
- click `Publish release`
|
|
958
|
+
- verify ci-success for upstream-branch-publish
|
|
959
|
+
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
|
|
960
|
+
- verify email-notification `Successfully published @jslint-org/jslint@20yy.mm.dd`
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
<br><br>
|
|
964
|
+
### pull-request merge
|
|
965
|
+
- find highest issue-number at https://github.com/jslint-org/jslint/issues/, and add +1 to it for PR-xxx
|
|
966
|
+
- verify `commit into jslint-org:beta`
|
|
967
|
+
- verify ci-success for pull-request
|
|
968
|
+
- https://github.com/jslint-org/jslint/actions/workflows/on_pull_request.yml
|
|
969
|
+
- click `Rebase and merge`
|
|
970
|
+
- verify ci-success for upstream-branch-beta
|
|
971
|
+
- https://github.com/jslint-org/jslint/actions/workflows/ci.yml
|
|
972
|
+
```shell
|
|
973
|
+
git fetch upstream beta
|
|
974
|
+
git diff upstream/beta
|
|
975
|
+
git reset upstream/beta
|
|
976
|
+
git push -f origin alpha alpha:beta
|
|
977
|
+
shMyciUpdate
|
|
978
|
+
git push -f upstream alpha
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
<br><br>
|
|
983
|
+
### vscode-jslint publish
|
|
984
|
+
- goto https://github.com/jslint-org/jslint/tree/gh-pages/branch-beta/.artifact/jslint_wrapper_vscode
|
|
985
|
+
- click `vscode-jslint-20yy.mm.dd.vsix`
|
|
986
|
+
- click `Download`
|
|
987
|
+
- goto https://marketplace.visualstudio.com/manage/publishers/jslint
|
|
988
|
+
- right-click `Update`
|
|
989
|
+
- drag-and-drop downloaded `vscode-jslint-20yy.mm.dd.vsix`
|
|
990
|
+
- click 'Upload'
|
|
991
|
+
- verify email-notification `[Succeeded] Extension publish on Visual Studio Marketplace - vscode-jslint`
|
|
992
|
+
|
|
993
|
+
|
|
898
994
|
<!--
|
|
899
995
|
Coverage-hack
|
|
900
996
|
node --eval '
|
package/jslint.mjs
CHANGED
|
@@ -165,7 +165,7 @@ let jslint_charset_ascii = (
|
|
|
165
165
|
+ "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
|
|
166
166
|
+ "`abcdefghijklmnopqrstuvwxyz{|}~\u007f"
|
|
167
167
|
);
|
|
168
|
-
let jslint_edition = "v2023.
|
|
168
|
+
let jslint_edition = "v2023.5.23";
|
|
169
169
|
let jslint_export; // The jslint object to be exported.
|
|
170
170
|
let jslint_fudge = 1; // Fudge starting line and starting
|
|
171
171
|
// ... column to 1.
|
|
@@ -1584,7 +1584,9 @@ ${name}<span class="apidocSignatureSpan">${signature}</span>
|
|
|
1584
1584
|
), "\n");
|
|
1585
1585
|
return result;
|
|
1586
1586
|
}));
|
|
1587
|
-
|
|
1587
|
+
|
|
1588
|
+
// Init module_list.
|
|
1589
|
+
|
|
1588
1590
|
module_list = await Promise.all(module_list.map(async function ({
|
|
1589
1591
|
pathname
|
|
1590
1592
|
}) {
|
|
@@ -1990,8 +1992,11 @@ async function jslint_cli({
|
|
|
1990
1992
|
).test(process_argv[1])
|
|
1991
1993
|
|| mode_cli
|
|
1992
1994
|
)
|
|
1993
|
-
&&
|
|
1994
|
-
|
|
1995
|
+
&& (
|
|
1996
|
+
moduleUrl.fileURLToPath(import_meta_url)
|
|
1997
|
+
===
|
|
1998
|
+
modulePath.resolve(process_argv[1])
|
|
1999
|
+
)
|
|
1995
2000
|
)
|
|
1996
2001
|
&& !mode_cli
|
|
1997
2002
|
) {
|
|
@@ -2810,20 +2815,30 @@ function jslint_phase2_lex(state) {
|
|
|
2810
2815
|
// Match a group that starts with left paren.
|
|
2811
2816
|
|
|
2812
2817
|
char_after("(");
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
if (char === "=" || char === "!") {
|
|
2816
|
-
char_after();
|
|
2817
|
-
} else {
|
|
2818
|
-
char_after(":");
|
|
2819
|
-
}
|
|
2820
|
-
} else if (char === ":") {
|
|
2818
|
+
switch (char) {
|
|
2819
|
+
case ":":
|
|
2821
2820
|
|
|
2822
2821
|
// test_cause:
|
|
2823
2822
|
// ["aa=/(:)/", "lex_regexp_group", "expected_a_before_b", ":", 6]
|
|
2824
2823
|
// ["aa=/?/", "lex_regexp_group", "expected_a_before_b", "?", 5]
|
|
2825
2824
|
|
|
2826
2825
|
warn_at("expected_a_before_b", line, column, "?", ":");
|
|
2826
|
+
break;
|
|
2827
|
+
case "?":
|
|
2828
|
+
char_after("?");
|
|
2829
|
+
switch (char) {
|
|
2830
|
+
case "!":
|
|
2831
|
+
|
|
2832
|
+
// PR-437 - Add grammar for regexp-named-capture-group.
|
|
2833
|
+
|
|
2834
|
+
case "<":
|
|
2835
|
+
case "=":
|
|
2836
|
+
char_after();
|
|
2837
|
+
break;
|
|
2838
|
+
default:
|
|
2839
|
+
char_after(":");
|
|
2840
|
+
}
|
|
2841
|
+
break;
|
|
2827
2842
|
}
|
|
2828
2843
|
|
|
2829
2844
|
// RegExp
|
|
@@ -2857,7 +2872,10 @@ function jslint_phase2_lex(state) {
|
|
|
2857
2872
|
// ["aa=/\\/", "lex_regexp_group", "escape", "", 0]
|
|
2858
2873
|
|
|
2859
2874
|
test_cause("escape");
|
|
2860
|
-
|
|
2875
|
+
|
|
2876
|
+
// PR-437 - Add grammar for regexp-named-backreference.
|
|
2877
|
+
|
|
2878
|
+
char_after_escape("BbDdSsWw^${}[]():=!.|*+?k");
|
|
2861
2879
|
break;
|
|
2862
2880
|
case "^":
|
|
2863
2881
|
if (snippet !== "^") {
|
|
@@ -6170,7 +6188,8 @@ function jslint_phase3_parse(state) {
|
|
|
6170
6188
|
}
|
|
6171
6189
|
|
|
6172
6190
|
function stmt_export() {
|
|
6173
|
-
|
|
6191
|
+
let export_list = [];
|
|
6192
|
+
let the_export = token_now;
|
|
6174
6193
|
let the_id;
|
|
6175
6194
|
let the_name;
|
|
6176
6195
|
let the_thing;
|
|
@@ -6214,9 +6233,13 @@ function jslint_phase3_parse(state) {
|
|
|
6214
6233
|
export_dict.default = the_thing;
|
|
6215
6234
|
the_export.expression.push(the_thing);
|
|
6216
6235
|
} else {
|
|
6217
|
-
|
|
6236
|
+
|
|
6237
|
+
// PR-439 - Add grammar for "export async function ...".
|
|
6238
|
+
|
|
6239
|
+
if (token_nxt.id === "function" || token_nxt.id === "async") {
|
|
6218
6240
|
|
|
6219
6241
|
// test_cause:
|
|
6242
|
+
// ["export async function aa(){}", "stmt_export", "freeze_exports", "async", 8]
|
|
6220
6243
|
// ["export function aa(){}", "stmt_export", "freeze_exports", "function", 8]
|
|
6221
6244
|
|
|
6222
6245
|
warn("freeze_exports");
|
|
@@ -6266,6 +6289,7 @@ function jslint_phase3_parse(state) {
|
|
|
6266
6289
|
stop("expected_identifier_a");
|
|
6267
6290
|
}
|
|
6268
6291
|
the_id = token_nxt.id;
|
|
6292
|
+
export_list.push(token_nxt);
|
|
6269
6293
|
the_name = token_global.context[the_id];
|
|
6270
6294
|
if (the_name === undefined) {
|
|
6271
6295
|
|
|
@@ -6292,6 +6316,13 @@ function jslint_phase3_parse(state) {
|
|
|
6292
6316
|
break;
|
|
6293
6317
|
}
|
|
6294
6318
|
}
|
|
6319
|
+
|
|
6320
|
+
// PR-439 - Check exported properties are ordered.
|
|
6321
|
+
|
|
6322
|
+
// test_cause:
|
|
6323
|
+
// ["export {bb, aa}", "check_ordered", "expected_a_b_before_c_d", "aa", 13]
|
|
6324
|
+
|
|
6325
|
+
check_ordered("export", export_list);
|
|
6295
6326
|
advance("}");
|
|
6296
6327
|
semicolon();
|
|
6297
6328
|
} else {
|
|
@@ -6441,6 +6472,20 @@ function jslint_phase3_parse(state) {
|
|
|
6441
6472
|
// }
|
|
6442
6473
|
|
|
6443
6474
|
state.mode_module = true;
|
|
6475
|
+
|
|
6476
|
+
// PR-436 - Add grammar for side-effect import-statement.
|
|
6477
|
+
|
|
6478
|
+
if (token_nxt.id === "(string)") {
|
|
6479
|
+
|
|
6480
|
+
// test_cause:
|
|
6481
|
+
// ["import \"./aa.mjs\";", "stmt_import", "import_side_effect", "", 0]
|
|
6482
|
+
|
|
6483
|
+
test_cause("import_side_effect");
|
|
6484
|
+
warn("expected_a_b", token_nxt, "{", artifact());
|
|
6485
|
+
advance();
|
|
6486
|
+
semicolon();
|
|
6487
|
+
return the_import;
|
|
6488
|
+
}
|
|
6444
6489
|
if (token_nxt.identifier) {
|
|
6445
6490
|
name = token_nxt;
|
|
6446
6491
|
advance();
|
package/package.json
CHANGED