@jslint-org/jslint 2023.10.24 → 2024.6.28

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
@@ -7,6 +7,21 @@
7
7
  - jslint - add new warning requiring paren around plus-separated concatenations.
8
8
  - jslint - try to improve parser to be able to parse jquery.js without stopping.
9
9
 
10
+ # v2024.6.28
11
+ - coverage - Fix coverage-function v8CoverageReportCreate() throwing error EINVAL in latest nodejs-security-patch, when running win32-coverage with npm.cmd.
12
+ - jslint - Remove unnecessary shell-function shCurlExe().
13
+
14
+ # v2024.3.26
15
+ - ci - Add shell-functions shGitPullrequestCleanup(), shGitPullrequest() to automatically cleanup or create-and-push github-pull-commit to origin/alpha.
16
+ - jslint - Allow destructuring-assignment after function-definition.
17
+ - ci - Replace npm-package used to auto-build vscode-plugin, vsce to @vscode/vsce.
18
+ - test - Update test-function jstestDescribe() to wait awhile for imports to initialize before running tests.
19
+ - ci - Fix tmpdir in shell-function shBrowserScreenshot().
20
+ - vim - Allow installing vim-plugin to any directory, instead of hardcoded to ~/.vim/.
21
+ - ci - Update github-ci for actions/cache, actions/setup-python from nodejs v16 to nodejs v20.
22
+ - ci - Update shell-function shRollupFetch() to fix blank date-committed.
23
+ - ci - bugfix - Fix google-chrome unable to create screenshot because user-data-dir is /dev/null.
24
+
10
25
  # v2023.10.24
11
26
  - jslint - bugfix - Update file jslint_wrapper_vim.vim to fix broken vim-link when linting shell-files.
12
27
  - ci - add custom-shell-ci hooks to script jslint_ci.sh:
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.10.24)](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>(v2024.6.28)](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) |
@@ -74,9 +74,9 @@ Douglas Crockford <douglas@crockford.com>
74
74
  12. [License](#license)
75
75
 
76
76
  13. [Devops Instruction](#devops-instruction)
77
+ - [pull-request merge](#pull-request-merge)
77
78
  - [branch-master commit](#branch-master-commit)
78
79
  - [branch-master publish](#branch-master-publish)
79
- - [pull-request merge](#pull-request-merge)
80
80
  - [vscode-jslint publish](#vscode-jslint-publish)
81
81
 
82
82
 
@@ -506,6 +506,9 @@ window.addEventListener("load", function () {
506
506
  # Quickstart JSLint in Vim
507
507
  1. Download and save [`jslint.mjs`](https://www.jslint.com/jslint.mjs), [`jslint_wrapper_vim.vim`](https://www.jslint.com/jslint_wrapper_vim.vim) to directory `~/.vim/`
508
508
  2. Add vim-command `:source ~/.vim/jslint_wrapper_vim.vim` to file `~/.vimrc`
509
+ - If above files were saved to custom-directory, then use that directory instead, e.g.:
510
+ - save [`jslint.mjs`](https://www.jslint.com/jslint.mjs), [`jslint_wrapper_vim.vim`](https://www.jslint.com/jslint_wrapper_vim.vim) to directory `~/vimfiles/`
511
+ - vim-command `:source ~/vimfiles/jslint_wrapper_vim.vim`
509
512
  3. Vim can now jslint files (via nodejs):
510
513
  - with vim-command `:SaveAndJslint`
511
514
  - with vim-key-combo `<Ctrl-S> <Ctrl-J>`
@@ -912,105 +915,119 @@ eval("1"); //jslint-ignore-line
912
915
 
913
916
 
914
917
  <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`
918
+ ### pull-request merge
919
+ - find highest issue-number at https://github.com/jslint-org/jslint/issues/, https://github.com/jslint-org/jslint/pulls/, and add +1 to it for PR-xxx
920
+ - `shGitPullrequest beta beta`
921
+ - verify ci-success for origin-branch-alpha
922
+ - https://github.com/kaizhu256/jslint/actions
923
+ - `git push upstream alpha -f`
924
+ - verify ci-success for upstream-branch-alpha
925
+ - https://github.com/jslint-org/jslint/actions
926
+ - goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-p2024.6.23
927
+ - click `Create pull request`
928
+ - input `Add your description here...` with:
929
+ ```
930
+ Fixes #xxx.
931
+ - <primary-commit-message>
932
+
933
+ This PR will ...
934
+
935
+ this PR will additionally:
936
+ - <secondary-commit-message>
937
+ ...
938
+
939
+ <screenshot>
940
+ ```
926
941
  - verify `commit into jslint-org:beta`
927
942
  - click `Create pull request`
928
- - verify ci-success for pull-request
943
+ - verify ci-success for pull-request
929
944
  - https://github.com/jslint-org/jslint/actions/workflows/on_pull_request.yml
945
+ - wait awhile before continuing ...
930
946
  - 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
+ - verify ci-success for upstream-branch-beta
948
+ - https://github.com/jslint-org/jslint/actions
949
+ - `shGitPullrequestCleanup`
950
+ - verify ci-success for origin-branch-alpha
951
+ - https://github.com/kaizhu256/jslint/actions
952
+ - `git push upstream alpha -f`
953
+ - verify ci-success for upstream-branch-alpha
954
+ - https://github.com/jslint-org/jslint/actions
947
955
  - click `Delete branch`
948
- ```shell
949
- git push origin beta:master
950
- git push upstream beta:master
956
+
957
+
958
+ <br><br>
959
+ ### branch-master commit
960
+ - `shGitPullrequest master beta`
961
+ - verify ci-success for origin-branch-alpha
962
+ - https://github.com/kaizhu256/jslint/actions
963
+ - `git push upstream alpha -f`
964
+ - verify ci-success for upstream-branch-alpha
965
+ - https://github.com/jslint-org/jslint/actions
966
+ - goto https://github.com/jslint-org/jslint/compare/beta...kaizhu256:jslint:branch-v2024.6.28
967
+ - click `Create pull request`
968
+ - input `Add a title` with: `# v20yy.mm.dd`
969
+ - input `Add a description` with:
970
+ ```
971
+ - <primary-commit-message>
972
+ - <secondary-commit-message>
951
973
  ```
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
974
+ - verify `commit into jslint-org:beta`
975
+ - click `Create pull request`
976
+ - verify ci-success for pull-request
977
+ - https://github.com/jslint-org/jslint/actions/workflows/on_pull_request.yml
978
+ - wait awhile before continuing ...
979
+ - click `Rebase and merge`
980
+ - verify ci-success for upstream-branch-beta
981
+ - https://github.com/jslint-org/jslint/actions
982
+ - `shGitPullrequestCleanup`
983
+ - verify ci-success for origin-branch-alpha
984
+ - https://github.com/kaizhu256/jslint/actions
985
+ - `git push upstream alpha -f`
986
+ - verify ci-success for upstream-branch-alpha
987
+ - https://github.com/jslint-org/jslint/actions
988
+ - click `Delete branch`
989
+ - `git push origin beta:master`
990
+ - verify ci-success for origin-branch-master
991
+ - https://github.com/kaizhu256/jslint/actions
992
+ - `git push upstream beta:master`
993
+ - verify ci-success for upstream-branch-master
994
+ - https://github.com/jslint-org/jslint/actions
956
995
 
957
996
 
958
997
  <br><br>
959
998
  ### 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
999
+ - `git push upstream beta:master`
1000
+ - verify ci-success for upstream-branch-master
1001
+ - https://github.com/jslint-org/jslint/actions
963
1002
  - goto https://github.com/jslint-org/jslint/releases/new
964
- - input tag `v20yy.mm.dd`
1003
+ - input `Choose a tag` with: `v20yy.mm.dd`
965
1004
  - click `Create new tag: v20yy.mm.dd on publish`
966
1005
  - verify correct-year `20yy`
967
- - click `Target: master`
968
- - input `Release title: v20yy.mm.dd - <description>`
969
- - copy-paste release notes from CHANGELOG.md
1006
+ - select `Target: master`
1007
+ - select `Previous tag:auto`
1008
+ - input `Release title` with: `v20yy.mm.dd - <primary-commit-message>`
1009
+ - input `Describe this release` with:
1010
+ ```
1011
+ - <primary-commit-message>
1012
+ - <secondary-commit-message>
1013
+ ```
970
1014
  - click `Generate release notes`
971
1015
  - click `Set as the latest release`
972
1016
  - click `Preview` and review
973
1017
  - 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`
1018
+ - verify ci-success for upstream-branch-publish
1019
+ - https://github.com/jslint-org/jslint/actions
1020
+ - verify email-notification `Successfully published @jslint-org/jslint@20yy.mm.dd`
1004
1021
 
1005
1022
 
1006
1023
  <br><br>
1007
1024
  ### vscode-jslint publish
1008
1025
  - goto https://github.com/jslint-org/jslint/tree/gh-pages/branch-beta/.artifact/jslint_wrapper_vscode
1009
1026
  - click `vscode-jslint-20yy.mm.dd.vsix`
1010
- - click `Download`
1027
+ - click `Raw` to download
1011
1028
  - goto https://marketplace.visualstudio.com/manage/publishers/jslint
1012
1029
  - right-click `Update`
1013
- - drag-and-drop downloaded `vscode-jslint-20yy.mm.dd.vsix`
1030
+ - upload downloaded file `vscode-jslint-20yy.mm.dd.vsix`
1014
1031
  - click 'Upload'
1015
1032
  - verify email-notification `[Succeeded] Extension publish on Visual Studio Marketplace - vscode-jslint`
1016
1033
 
package/jslint.mjs CHANGED
@@ -125,8 +125,8 @@
125
125
  process_env, process_exit, promises, property, property_dict, push, quote,
126
126
  ranges, readFile, readdir, readonly, recursive, reduce, repeat, replace,
127
127
  resolve, result, reverse, role, round, scriptId, search, set, shebang,
128
- shift, signature, single, slice, some, sort, source, spawn, splice, split,
129
- stack, stack_trace, start, startOffset, startsWith, statement,
128
+ shell, shift, signature, single, slice, some, sort, source, spawn, splice,
129
+ split, stack, stack_trace, start, startOffset, startsWith, statement,
130
130
  statement_prv, stdio, stop, stop_at, stringify, subscript, switch,
131
131
  syntax_dict, tenure, test, test_cause, test_internal_error, this, thru,
132
132
  toLocaleString, toString, token, token_global, token_list, token_nxt,
@@ -163,7 +163,7 @@ let jslint_charset_ascii = (
163
163
  + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
164
164
  + "`abcdefghijklmnopqrstuvwxyz{|}~\u007f"
165
165
  );
166
- let jslint_edition = "v2023.10.24";
166
+ let jslint_edition = "v2024.6.28";
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.
@@ -5487,13 +5487,15 @@ function jslint_phase3_parse(state) {
5487
5487
  if (
5488
5488
  token_nxt.id === "."
5489
5489
  || token_nxt.id === "?."
5490
- || token_nxt.id === "["
5490
+
5491
+ // PR-459 - Allow destructuring-assignment after function-definition.
5492
+
5493
+ // || token_nxt.id === "["
5491
5494
  ) {
5492
5495
 
5493
5496
  // test_cause:
5494
5497
  // ["function aa(){}\n.aa", "prefix_function", "unexpected_a", ".", 1]
5495
5498
  // ["function aa(){}\n?.aa", "prefix_function", "unexpected_a", "?.", 1]
5496
- // ["function aa(){}\n[]", "prefix_function", "unexpected_a", "[", 1]
5497
5499
 
5498
5500
  warn("unexpected_a");
5499
5501
  }
@@ -9952,6 +9954,12 @@ async function jstestDescribe(description, testFunction) {
9952
9954
  process.on("exit", jstestOnExit);
9953
9955
  }
9954
9956
 
9957
+ // PR-457 - Wait awhile for imports to initialize.
9958
+
9959
+ await new Promise(function (resolve) {
9960
+ setTimeout(resolve);
9961
+ });
9962
+
9955
9963
  // Init jstestItList.
9956
9964
 
9957
9965
  jstestItList = [];
@@ -10005,9 +10013,7 @@ function jstestIt(description, testFunction, mode) {
10005
10013
  } catch (errCaught) {
10006
10014
  err = errCaught;
10007
10015
  }
10008
- resolve([
10009
- err, description, mode
10010
- ]);
10016
+ resolve([err, description, mode]);
10011
10017
  }));
10012
10018
  }
10013
10019
 
@@ -11279,24 +11285,37 @@ function sentinel() {}
11279
11285
  }
11280
11286
  }));
11281
11287
  exitCode = await new Promise(function (resolve) {
11282
- moduleChildProcess.spawn(
11283
- (
11284
- processArgv[0] === "npm"
11288
+ let processArgv0 = processArgv[0];
11285
11289
 
11286
11290
  // If win32 environment, then replace program npm with npm.cmd.
11287
11291
  // Coverage-hack - Ugly-hack to get test-coverage under both win32 and linux.
11288
11292
 
11289
- ? process.platform.replace("win32", "npm.cmd").replace(
11290
- process.platform,
11291
- "npm"
11292
- )
11293
- : processArgv[0]
11294
- ),
11293
+ if (processArgv0 === "npm") {
11294
+ processArgv0 = process.platform.replace(
11295
+ "win32",
11296
+ "npm.cmd"
11297
+ ).replace(
11298
+ process.platform,
11299
+ "npm"
11300
+ );
11301
+ }
11302
+ moduleChildProcess.spawn(
11303
+ processArgv0,
11295
11304
  processArgv.slice(1),
11296
11305
  {
11297
11306
  env: Object.assign({}, process.env, {
11298
11307
  NODE_V8_COVERAGE: coverageDir
11299
11308
  }),
11309
+
11310
+ // PR-465
11311
+ // https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
11312
+ // Node.js will now error with EINVAL if a .bat or .cmd file is passed to
11313
+ // child_process.spawn and child_process.spawnSync without the shell option set.
11314
+
11315
+ shell: (
11316
+ processArgv0.endsWith(".bat")
11317
+ || processArgv0.endsWith(".cmd")
11318
+ ),
11300
11319
  stdio: ["ignore", 1, 2]
11301
11320
  }
11302
11321
  ).on("exit", resolve);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "bin": {
3
- "jslint": "./jslint.mjs"
3
+ "jslint": "jslint.mjs"
4
4
  },
5
5
  "bugs": {
6
6
  "url": "https://github.com/jslint-org/jslint/issues"
@@ -26,7 +26,7 @@
26
26
  "name": "@jslint-org/jslint",
27
27
  "repository": {
28
28
  "type": "git",
29
- "url": "https://github.com/jslint-org/jslint.git"
29
+ "url": "git+https://github.com/jslint-org/jslint.git"
30
30
  },
31
31
  "scripts": {
32
32
  "test": "node jslint.mjs v8_coverage_report=.artifact/coverage node test.mjs",
@@ -35,5 +35,5 @@
35
35
  "shCiArtifactUpload": 1,
36
36
  "shCiPublishNpm": 1,
37
37
  "type": "module",
38
- "version": "2023.10.24"
38
+ "version": "2024.6.28"
39
39
  }