@jslint-org/jslint 2021.10.20 → 2021.11.20

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/.npmignore ADDED
@@ -0,0 +1,6 @@
1
+ *
2
+ .*
3
+
4
+ !.npmignore
5
+ !jslint.mjs
6
+ !jslint.vim
package/CHANGELOG.md CHANGED
@@ -1,16 +1,26 @@
1
1
  # Changelog
2
2
 
3
3
  # Todo
4
- - ci - deprecate/remove jslint.cjs from ci
5
4
  - cli - remove cli-option `--mode-vim-plugin`
6
5
  - coverage - add macros `/*coverage-disable*/` and `/*coverage-enable*/`.
6
+ - coverage - support globbing `*` in cli-options `--exclude` and `--include`
7
7
  - jslint - add html and css linting back into jslint.
8
- - jslint - add new warning requiring paren around comma-separated concatenations.
9
- - jslint - add top-level-await support
10
- - jslint - unify analysis of variable-assignment/function-parameters into one function
8
+ - jslint - add new warning requiring paren around plus-separated concatenations.
9
+ - jslint - add numeric-separators support.
10
+ - jslint - relax warning against console.log and friends and deprecate directive `devel`
11
11
  - jslint - require regexp to use open-form.
12
12
  - jslint - try to improve parser to be able to parse jquery.js without stopping.
13
+ - jslint - unify analysis of variable-assignment/function-parameters into one function
13
14
  - node - after node-v14 is deprecated, remove shell-code `export "NODE_OPTIONS=--unhandled-rejections=strict"`.
15
+ - perf - improve performance by hoisting inlined regexps out of loops and subfunctions
16
+
17
+ # v2021.11.20
18
+ - jslint - add top-level-await support
19
+ - ci - deprecate/remove jslint.cjs from ci
20
+ - coverage - add cli-options `--exclude=aa,bb`, `--exclude-node-modules=false`, `--include=aa,bb`
21
+ - coverage - dedupe coverage-logic now applied when only one script passed
22
+ - npm - add file .npmignore
23
+ - website - add clickable-links to editor-code in report-warnings and report-functions
14
24
 
15
25
  # v2021.10.20
16
26
  - ci - add release-trigger to publish to `@jslint-org/jslint`
package/README.md CHANGED
@@ -1,15 +1,9 @@
1
- [<img align="left" height="100" src="asset_image_logo_512.svg"/>](https://github.com/jslint-org/jslint)
2
-
3
-
4
- # JSLint, The JavaScript Code Quality and Coverage Tool
5
-
6
- &nbsp;
7
-
1
+ # [<img align="left" height="80" src="asset_image_logo_512.svg"/>](https://github.com/jslint-org/jslint) JSLint, The JavaScript Code Quality and Coverage Tool
8
2
  Douglas Crockford <douglas@crockford.com>
9
3
 
10
4
 
11
5
  # Status
12
- | Branch | [master<br>(v2021.10.20)](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>(v2021.11.20)](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) |
13
7
  |--:|:--:|:--:|:--:|
14
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) |
15
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) |
@@ -17,6 +11,7 @@ Douglas Crockford <douglas@crockford.com>
17
11
  | Artifacts | [<img src="asset_image_folder_open_solid.svg" height="30">](https://github.com/jslint-org/jslint/tree/gh-pages/branch-master/.artifact) | [<img src="asset_image_folder_open_solid.svg" height="30">](https://github.com/jslint-org/jslint/tree/gh-pages/branch-beta/.artifact) | [<img src="asset_image_folder_open_solid.svg" height="30">](https://github.com/jslint-org/jslint/tree/gh-pages/branch-alpha/.artifact) |
18
12
 
19
13
 
14
+ <br><br>
20
15
  # Table of Contents
21
16
 
22
17
  1. [Web Demo](#web-demo)
@@ -41,7 +36,7 @@ Douglas Crockford <douglas@crockford.com>
41
36
  - [To create V8 coverage report from Node.js / Npm program in javascript:](#to-create-v8-coverage-report-from-nodejs--npm-program-in-javascript)
42
37
 
43
38
  7. [Plugin Vim](#plugin-vim)
44
- - [To run JSLint inside vim:](#to-run-jslint-inside-vim)
39
+ - [To run JSLint in Vim:](#to-run-jslint-in-vim)
45
40
 
46
41
  8. [Description](#description)
47
42
 
@@ -52,25 +47,32 @@ Douglas Crockford <douglas@crockford.com>
52
47
  11. [License](#license)
53
48
 
54
49
 
50
+ <br><br>
55
51
  # Web Demo
56
52
  - https://www.jslint.com
57
53
 
58
54
  [![screenshot](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_browser__2fjslint_2fbranch-beta_2findex.html.png)](https://jslint-org.github.io/jslint/index.html)
59
55
 
60
56
 
57
+ <br><br>
61
58
  # Web Demo Archived
62
59
  - [Web Demo 2020](https://www.jslint.com/branch-v2020.11.6/index.html)
63
60
  - [Web Demo 2014 (ES5 only)](https://www.jslint.com/branch-v2014.7.8/jslint.html)
64
61
  - [Web Demo 2013 (ES5, CSS, HTML)](https://www.jslint.com/branch-v2013.3.13/jslint.html)
65
62
 
66
63
 
64
+ <br><br>
67
65
  # API Doc
68
66
  - https://www.jslint.com/apidoc.html
69
67
 
70
68
  [![screenshot](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_browser__2f.artifact_2fapidoc.html.png)](https://www.jslint.com/apidoc.html)
71
69
 
72
70
 
71
+ <br><br>
73
72
  # Quickstart Install
73
+
74
+
75
+ <br><br>
74
76
  ### To install, just download https://www.jslint.com/jslint.mjs and save to file:
75
77
  ```shell <!-- shRunWithScreenshotTxt .artifact/screenshot_sh_install_download.svg -->
76
78
  #!/bin/sh
@@ -81,6 +83,8 @@ curl -L https://www.jslint.com/jslint.mjs > jslint.mjs
81
83
 
82
84
  ![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_sh_install_download.svg)
83
85
 
86
+
87
+ <br><br>
84
88
  ### To run `jslint.mjs` in shell:
85
89
  ```shell <!-- shRunWithScreenshotTxt .artifact/screenshot_sh_jslint_file.svg -->
86
90
  #!/bin/sh
@@ -93,11 +97,13 @@ node jslint.mjs hello.js
93
97
 
94
98
  ![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_sh_jslint_file.svg)
95
99
 
100
+
101
+ <br><br>
96
102
  ### To import `jslint.mjs` in ES Module environment:
97
103
  ```shell <!-- shRunWithScreenshotTxt .artifact/screenshot_js_import_esm.svg -->
98
104
  #!/bin/sh
99
105
 
100
- node --input-type=module -e '
106
+ node --input-type=module --eval '
101
107
 
102
108
  /*jslint devel*/
103
109
 
@@ -125,11 +131,13 @@ result.warnings.forEach(function ({
125
131
 
126
132
  ![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_js_import_esm.svg)
127
133
 
134
+
135
+ <br><br>
128
136
  ### To import `jslint.mjs` in CommonJS environment:
129
137
  ```shell <!-- shRunWithScreenshotTxt .artifact/screenshot_js_import_cjs.svg -->
130
138
  #!/bin/sh
131
139
 
132
- node -e '
140
+ node --eval '
133
141
 
134
142
  /*jslint devel*/
135
143
  (async function () {
@@ -160,6 +168,8 @@ node -e '
160
168
 
161
169
  ![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_js_import_cjs.svg)
162
170
 
171
+
172
+ <br><br>
163
173
  ### To JSLint entire directory in shell:
164
174
  ```shell <!-- shRunWithScreenshotTxt .artifact/screenshot_sh_jslint_dir.svg -->
165
175
  #!/bin/sh
@@ -173,7 +183,11 @@ node jslint.mjs .
173
183
  ![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_sh_jslint_dir.svg)
174
184
 
175
185
 
186
+ <br><br>
176
187
  # Quickstart JSLint Report
188
+
189
+
190
+ <br><br>
177
191
  ### To create a JSLint report in shell:
178
192
  ```shell <!-- shRunWithScreenshotTxt .artifact/screenshot_sh_jslint_report_file.svg -->
179
193
  #!/bin/sh
@@ -195,11 +209,12 @@ node jslint.mjs \
195
209
  [![screenshot.png](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_browser__2f.artifact_2fjslint_report_hello.html.png)](https://jslint-org.github.io/jslint/branch-beta/.artifact/jslint_report_hello.html)
196
210
 
197
211
 
212
+ <br><br>
198
213
  ### To create a JSLint report in javascript:
199
214
  ```shell <!-- shRunWithScreenshotTxt .artifact/screenshot_js_jslint_report_file.svg -->
200
215
  #!/bin/sh
201
216
 
202
- node --input-type=module -e '
217
+ node --input-type=module --eval '
203
218
 
204
219
  /*jslint devel*/
205
220
  import jslint from "./jslint.mjs";
@@ -225,8 +240,16 @@ import fs from "fs";
225
240
 
226
241
  ![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_js_jslint_report_file.svg)
227
242
 
243
+ - screenshot file [.artifact/jslint_report_hello.html](https://jslint-org.github.io/jslint/branch-beta/.artifact/jslint_report_hello.html)
228
244
 
245
+ [![screenshot.png](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_browser__2f.artifact_2fjslint_report_hello.html.png)](https://jslint-org.github.io/jslint/branch-beta/.artifact/jslint_report_hello.html)
246
+
247
+
248
+ <br><br>
229
249
  # Quickstart V8 Coverage Report
250
+
251
+
252
+ <br><br>
230
253
  ### To create V8 coverage report from Node.js / Npm program in shell:
231
254
  ```shell <!-- shRunWithScreenshotTxt .artifact/screenshot_sh_coverage_report_spawn.svg -->
232
255
  #!/bin/sh
@@ -243,8 +266,15 @@ npm install
243
266
 
244
267
  node ../jslint.mjs \
245
268
  v8_coverage_report=../.artifact/coverage_sqlite3_sh/ \
269
+ --exclude-node-modules=true \
270
+ --exclude=test/foo.js,test/bar.js \
271
+ --exclude=test/baz.js \
246
272
  npm run test
247
273
  ```
274
+ - shell output
275
+
276
+ ![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_sh_coverage_report_spawn.svg)
277
+
248
278
  - screenshot file [.artifact/coverage_sqlite3_sh/index.html](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage_sqlite3_sh/index.html)
249
279
 
250
280
  [![screenshot.png](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_browser__2f.artifact_2fcoverage_sqlite3_sh_2findex.html.png)](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage_sqlite3_sh/index.html)
@@ -253,10 +283,8 @@ node ../jslint.mjs \
253
283
 
254
284
  [![screenshot.png](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_browser__2f.artifact_2fcoverage_sqlite3_sh_2flib_2fsqlite3.js.html.png)](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage_sqlite3_sh/lib/sqlite3.js.html)
255
285
 
256
- - shell output
257
-
258
- ![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_sh_coverage_report_spawn.svg)
259
286
 
287
+ <br><br>
260
288
  ### To create V8 coverage report from Node.js / Npm program in javascript:
261
289
  ```shell <!-- shRunWithScreenshotTxt .artifact/screenshot_js_coverage_report_spawn.svg -->
262
290
  #!/bin/sh
@@ -269,7 +297,7 @@ git clone https://github.com/mapbox/node-sqlite3 node-sqlite3-js \
269
297
  cd node-sqlite3-js
270
298
  npm install
271
299
 
272
- node --input-type=module -e '
300
+ node --input-type=module --eval '
273
301
 
274
302
  /*jslint node*/
275
303
  import jslint from "../jslint.mjs";
@@ -279,12 +307,20 @@ import jslint from "../jslint.mjs";
279
307
 
280
308
  await jslint.v8CoverageReportCreate({
281
309
  coverageDir: "../.artifact/coverage_sqlite3_js/",
282
- processArgv: ["npm", "run", "test"]
310
+ processArgv: [
311
+ "--include=lib/sqlite3-binding.js,lib/sqlite3.js",
312
+ "--include=lib/trace.js",
313
+ "npm", "run", "test"
314
+ ]
283
315
  });
284
316
  }());
285
317
 
286
318
  '
287
319
  ```
320
+ - shell output
321
+
322
+ ![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_js_coverage_report_spawn.svg)
323
+
288
324
  - screenshot file [.artifact/coverage_sqlite3_js/index.html](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage_sqlite3_js/index.html)
289
325
 
290
326
  [![screenshot.png](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_browser__2f.artifact_2fcoverage_sqlite3_js_2findex.html.png)](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage_sqlite3_js/index.html)
@@ -293,13 +329,13 @@ import jslint from "../jslint.mjs";
293
329
 
294
330
  [![screenshot.png](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_browser__2f.artifact_2fcoverage_sqlite3_js_2flib_2fsqlite3.js.html.png)](https://jslint-org.github.io/jslint/branch-beta/.artifact/coverage_sqlite3_js/lib/sqlite3.js.html)
295
331
 
296
- - shell output
297
332
 
298
- ![screenshot.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_js_coverage_report_spawn.svg)
333
+ <br><br>
334
+ # Plugin Vim
299
335
 
300
336
 
301
- # Plugin Vim
302
- ### To run JSLint inside vim:
337
+ <br><br>
338
+ ### To run JSLint in Vim:
303
339
  1. Download and save [`jslint.mjs`](https://www.jslint.com/jslint.mjs), [`jslint.vim`](https://www.jslint.com/jslint.vim) to directory `~/.vim/`
304
340
  2. Add vim-command `:source ~/.vim/jslint.vim` to file `~/.vimrc`
305
341
  3. Vim can now jslint files (via nodejs):
@@ -310,6 +346,7 @@ import jslint from "../jslint.mjs";
310
346
  ![screenshot.png](asset_image_jslint_vim_plugin.png)
311
347
 
312
348
 
349
+ <br><br>
313
350
  # Description
314
351
  - [jslint.mjs](jslint.mjs) contains the jslint function. It parses and analyzes a source file, returning an object with information about the file. It can also take an object that sets options.
315
352
 
@@ -334,17 +371,27 @@ plays the part of a stern but benevolent editor, helping you to get the style
334
371
  right so that you can focus your creative energy where it is most needed.
335
372
 
336
373
 
374
+ <br><br>
337
375
  # Package Listing
338
376
  ![screenshot_package_listing.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_package_listing.svg)
339
377
 
340
378
 
379
+ <br><br>
341
380
  # Changelog
342
381
  - [Full CHANGELOG.md](CHANGELOG.md)
343
382
 
344
383
  ![screenshot_changelog.svg](https://jslint-org.github.io/jslint/branch-beta/.artifact/screenshot_changelog.svg)
345
384
 
346
385
 
386
+ <br><br>
347
387
  # License
348
388
  - JSLint is under [Unlicense License](LICENSE).
349
- - CodeMirror code-editor is under [MIT License](https://github.com/codemirror/CodeMirror/blob/master/LICENSE).
389
+ - CodeMirror editor is under [MIT License](https://github.com/codemirror/CodeMirror/blob/master/LICENSE).
350
390
  - Function `v8CoverageListMerge` is derived from [MIT Licensed v8-coverage](https://github.com/demurgos/v8-coverage/blob/73446087dc38f61b09832c9867122a23f8577099/ts/LICENSE.md).
391
+
392
+ <!--
393
+ Coverage-hack
394
+ node --eval '
395
+ 0
396
+ '
397
+ -->