@jslint-org/jslint 2023.4.29 → 2023.6.21

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
@@ -5,9 +5,19 @@
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
- - jslint - unify analysis of variable-assignment/function-parameters into one function
9
+
10
+ # v2023.6.21
11
+ - doc - Update docs in README.md.
12
+
13
+ # v2023.5.23
14
+ - jslint - Check exported properties are ordered.
15
+ - jslint - Add grammar for "export async function ...".
16
+ - python - Add shell-function shLintPython().
17
+ - jslint - Add grammar for regexp-named-capture-group and regexp-named-backreference.
18
+ - jslint - Add grammar for side-effect import-statement.
19
+ - ci - Rename shell-function shRawLibFetch() to shRollupFetch().
20
+ - doc - document devop procedures to maintain jslint-repo
11
21
 
12
22
  # v2023.4.29
13
23
  - 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.4.29)](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>(v2023.6.21)](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) |
@@ -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
@@ -807,7 +813,7 @@ Error
807
813
 
808
814
  ```js
809
815
  /*jslint unordered*/
810
- // Allow unordered cases, params, properties, and variables.
816
+ // Allow unordered cases, params, properties, variables, and exports.
811
817
 
812
818
  let foo = {bb: 1, aa: 0};
813
819
 
@@ -817,6 +823,11 @@ function bar({
817
823
  }) {
818
824
  return aa + bb;
819
825
  }
826
+
827
+ export {
828
+ foo,
829
+ bar
830
+ };
820
831
  ```
821
832
 
822
833
  <br>
@@ -895,6 +906,115 @@ eval("1"); //jslint-ignore-line
895
906
  - CodeMirror editor is under [MIT License](https://github.com/codemirror/codemirror5/blob/d0e3b2e727c41aa4fd89fbad0adfb3815339174c/LICENSE).
896
907
  - Function `v8CoverageListMerge` is derived from [MIT Licensed v8-coverage](https://github.com/demurgos/v8-coverage/blob/73446087dc38f61b09832c9867122a23f8577099/ts/LICENSE.md).
897
908
 
909
+
910
+ <br><br>
911
+ # Devops Instruction
912
+
913
+
914
+ <br><br>
915
+ ### branch-master commit
916
+ - $ `shGitSquashPop <commit-beta> '# v20yy.mm.dd\n<release notes from CHANGELOG.md>'`
917
+ - verify correct-year `20yy`
918
+ - $ `git push origin alpha:branch-v20yy.mm.dd`
919
+ - $ `git push upstream alpha -f`
920
+ - verify ci-success for upstream-branch-alpha
921
+ - https://github.com/jslint-org/jslint/actions/workflows/ci.yml
922
+ - goto https://github.com/kaizhu256/jslint/pulls
923
+ - click `New pull request`
924
+ - click `base repository: jslint-org/jslint base:beta`
925
+ - click `head repository: kaizhu256/jslint compare:branch-v20yy.mm.dd`
926
+ - verify `commit into jslint-org:beta`
927
+ - click `Create pull request`
928
+ - verify ci-success for pull-request
929
+ - https://github.com/jslint-org/jslint/actions/workflows/on_pull_request.yml
930
+ - click `Rebase and merge`
931
+ - verify ci-success for upstream-branch-beta
932
+ - https://github.com/jslint-org/jslint/actions/workflows/ci.yml
933
+ ```shell
934
+ git fetch upstream beta
935
+ git diff alpha..upstream/beta
936
+ # verify no diff between alpha..upstream/beta
937
+ git reset upstream/beta
938
+ git push origin alpha -f
939
+ git push origin alpha:beta
940
+ shMyciUpdate
941
+ git push upstream alpha -f
942
+ ```
943
+ - verify ci-success for origin-branch-alpha
944
+ - https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
945
+ - verify ci-success for upstream-branch-alpha
946
+ - https://github.com/jslint-org/jslint/actions/workflows/ci.yml
947
+ - click `Delete branch`
948
+ ```shell
949
+ git push origin beta:master
950
+ git push upstream beta:master
951
+ ```
952
+ - verify ci-success for origin-branch-master
953
+ - https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
954
+ - verify ci-success for upstream-branch-master
955
+ - https://github.com/jslint-org/jslint/actions/workflows/ci.yml
956
+
957
+
958
+ <br><br>
959
+ ### branch-master publish
960
+ - $ `git push upstream beta:master`
961
+ - verify ci-success for upstream-branch-master
962
+ - https://github.com/jslint-org/jslint/actions/workflows/ci.yml
963
+ - goto https://github.com/jslint-org/jslint/releases/new
964
+ - input tag `v20yy.mm.dd`
965
+ - click `Create new tag: v20yy.mm.dd on publish`
966
+ - verify correct-year `20yy`
967
+ - click `Target: master`
968
+ - input `Release title: v20yy.mm.dd - <description>`
969
+ - copy-paste release notes from CHANGELOG.md
970
+ - click `Generate release notes`
971
+ - click `Set as the latest release`
972
+ - click `Preview` and review
973
+ - click `Publish release`
974
+ - verify ci-success for upstream-branch-publish
975
+ - https://github.com/jslint-org/jslint/actions/workflows/ci.yml
976
+ - verify email-notification `Successfully published @jslint-org/jslint@20yy.mm.dd`
977
+
978
+
979
+ <br><br>
980
+ ### pull-request merge
981
+ - find highest issue-number at https://github.com/jslint-org/jslint/issues/, and add +1 to it for PR-xxx
982
+ - verify `commit into jslint-org:beta`
983
+ - click `Create pull request`
984
+ - verify ci-success for pull-request
985
+ - https://github.com/jslint-org/jslint/actions/workflows/on_pull_request.yml
986
+ - click `Rebase and merge`
987
+ - verify ci-success for upstream-branch-beta
988
+ - https://github.com/jslint-org/jslint/actions/workflows/ci.yml
989
+ ```shell
990
+ git fetch upstream beta
991
+ git diff alpha..upstream/beta
992
+ # verify no diff between alpha..upstream/beta
993
+ git reset upstream/beta
994
+ git push origin alpha -f
995
+ git push origin alpha:beta
996
+ shMyciUpdate
997
+ git push upstream alpha -f
998
+ ```
999
+ - verify ci-success for origin-branch-alpha
1000
+ - https://github.com/kaizhu256/jslint/actions/workflows/ci.yml
1001
+ - verify ci-success for upstream-branch-alpha
1002
+ - https://github.com/jslint-org/jslint/actions/workflows/ci.yml
1003
+ - click `Delete branch`
1004
+
1005
+
1006
+ <br><br>
1007
+ ### vscode-jslint publish
1008
+ - goto https://github.com/jslint-org/jslint/tree/gh-pages/branch-beta/.artifact/jslint_wrapper_vscode
1009
+ - click `vscode-jslint-20yy.mm.dd.vsix`
1010
+ - click `Download`
1011
+ - goto https://marketplace.visualstudio.com/manage/publishers/jslint
1012
+ - right-click `Update`
1013
+ - drag-and-drop downloaded `vscode-jslint-20yy.mm.dd.vsix`
1014
+ - click 'Upload'
1015
+ - verify email-notification `[Succeeded] Extension publish on Visual Studio Marketplace - vscode-jslint`
1016
+
1017
+
898
1018
  <!--
899
1019
  Coverage-hack
900
1020
  node --eval '
@@ -1,6 +1,6 @@
1
1
  /*jslint-disable*/
2
2
  /*
3
- shRawLibFetch
3
+ shRollupFetch
4
4
  {
5
5
  "fetchList": [
6
6
  {
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.4.29";
168
+ let jslint_edition = "v2023.6.21";
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
- // init module_list
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
- && moduleUrl.fileURLToPath(import_meta_url)
1994
- === modulePath.resolve(process_argv[1])
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
- if (char === "?") {
2814
- char_after("?");
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
- char_after_escape("BbDdSsWw^${}[]():=!.|*+?");
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 !== "^") {
@@ -3309,7 +3327,7 @@ function jslint_phase2_lex(state) {
3309
3327
  case "this": // Allow 'this'.
3310
3328
  case "trace": // Include jslint stack-trace in warnings.
3311
3329
  case "unordered": // Allow unordered cases, params, properties,
3312
- // ... and variables.
3330
+ // ... variables, and exports.
3313
3331
  case "variable": // Allow unordered const and let declarations
3314
3332
  // ... that are not at top of function-scope.
3315
3333
  case "white": // Allow messy whitespace.
@@ -6170,7 +6188,8 @@ function jslint_phase3_parse(state) {
6170
6188
  }
6171
6189
 
6172
6190
  function stmt_export() {
6173
- const the_export = token_now;
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
- if (token_nxt.id === "function") {
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
@@ -35,5 +35,5 @@
35
35
  "shCiArtifactUpload": 1,
36
36
  "shCiNpmPublish": 1,
37
37
  "type": "module",
38
- "version": "2023.4.29"
38
+ "version": "2023.6.21"
39
39
  }