@jslint-org/jslint 2021.11.20 → 2022.3.30
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 +2 -2
- package/README.md +6 -6
- package/jslint.mjs +400 -265
- package/jslint_wrapper_cjs.cjs +22 -0
- package/package.json +9 -3
- package/CHANGELOG.md +0 -226
- package/jslint.vim +0 -26
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*jslint beta, node*/
|
|
2
|
+
/*property
|
|
3
|
+
module, readFileSync, replace, runInNewContext
|
|
4
|
+
*/
|
|
5
|
+
require("vm").runInNewContext(
|
|
6
|
+
(
|
|
7
|
+
"\"use strict\";"
|
|
8
|
+
+ require("fs").readFileSync(
|
|
9
|
+
__dirname + "/jslint.mjs",
|
|
10
|
+
"utf8"
|
|
11
|
+
).replace(
|
|
12
|
+
"\nexport default Object.freeze(jslint_export);",
|
|
13
|
+
"\nmodule.exports = jslint_export;"
|
|
14
|
+
).replace(
|
|
15
|
+
"\njslint_import_meta_url = import.meta.url;",
|
|
16
|
+
"\n// jslint_import_meta_url = import.meta.url;"
|
|
17
|
+
)
|
|
18
|
+
),
|
|
19
|
+
{
|
|
20
|
+
module
|
|
21
|
+
}
|
|
22
|
+
);
|
package/package.json
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
},
|
|
5
5
|
"counter": 7,
|
|
6
6
|
"description": "JSLint, The JavaScript Code Quality and Coverage Tool",
|
|
7
|
-
"
|
|
7
|
+
"exports": {
|
|
8
|
+
"default": "./jslint_wrapper_cjs.cjs",
|
|
9
|
+
"import": "./jslint.mjs"
|
|
10
|
+
},
|
|
11
|
+
"fileCount": 29,
|
|
8
12
|
"keywords": [
|
|
9
13
|
"coverage-report",
|
|
10
14
|
"javascript",
|
|
@@ -13,7 +17,8 @@
|
|
|
13
17
|
"zero-dependency"
|
|
14
18
|
],
|
|
15
19
|
"license": "UNLICENSE",
|
|
16
|
-
"main": "
|
|
20
|
+
"main": "./jslint_wrapper_cjs.cjs",
|
|
21
|
+
"module": "./jslint.mjs",
|
|
17
22
|
"name": "@jslint-org/jslint",
|
|
18
23
|
"repository": {
|
|
19
24
|
"type": "git",
|
|
@@ -23,5 +28,6 @@
|
|
|
23
28
|
"test": "node jslint.mjs v8_coverage_report=.artifact/coverage node test.mjs",
|
|
24
29
|
"test2": "sh jslint_ci.sh shCiBase"
|
|
25
30
|
},
|
|
26
|
-
"
|
|
31
|
+
"type": "module",
|
|
32
|
+
"version": "2022.3.30"
|
|
27
33
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
# Todo
|
|
4
|
-
- cli - remove cli-option `--mode-vim-plugin`
|
|
5
|
-
- coverage - add macros `/*coverage-disable*/` and `/*coverage-enable*/`.
|
|
6
|
-
- coverage - support globbing `*` in cli-options `--exclude` and `--include`
|
|
7
|
-
- jslint - add html and css linting back into jslint.
|
|
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
|
-
- jslint - require regexp to use open-form.
|
|
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
|
|
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
|
|
24
|
-
|
|
25
|
-
# v2021.10.20
|
|
26
|
-
- ci - add release-trigger to publish to `@jslint-org/jslint`
|
|
27
|
-
- bugfix - fix coverage-report having incorrect http-link to index.html
|
|
28
|
-
- bugfix - fix false warning `uninitialized 'bb'` in code `/*jslint node*/\nlet {aa:bb} = {}; bb();`
|
|
29
|
-
- bugfix - fix issue #358 - switch-statement crashes jslint
|
|
30
|
-
- ci - cache coverage-example node-sqlite3 to speed up ci
|
|
31
|
-
- ci - rename dir .build/ to .artifact/
|
|
32
|
-
- ci - update shell-function shRunWithCoverage() to reduce size of string/argument passed to nodejs by using 2-space-indent
|
|
33
|
-
- cli - add cli-command jslint_plugin_vim
|
|
34
|
-
- cli - add cli-command v8_coverage_report
|
|
35
|
-
- cli - change cli-option `--mode-report` to cli-command `jslint_report=<filename>`
|
|
36
|
-
- coverage - relax requirement for coverageDir to be in cwd
|
|
37
|
-
- deprecated - cli - add cli-option `--mode-report`
|
|
38
|
-
- doc - add api-documentation
|
|
39
|
-
- fs - merge file asset_codemirror_rollup.css into index.html
|
|
40
|
-
- fs - merge file browser.mjs into index.html
|
|
41
|
-
- fs - merge file function.html into help.html
|
|
42
|
-
- fs - remove little-used font asset_font_programma_bold.woff2
|
|
43
|
-
- fs - rename files with dashes to files with underscore
|
|
44
|
-
- jslint - disable linting of embedded javascript in markdown-files
|
|
45
|
-
- jslint - relax regexp-warning against using 'space'
|
|
46
|
-
- npm - add file package.json and command `npm test`
|
|
47
|
-
- style - change naming-convention for non-jslint-core code from underscore to camelCase
|
|
48
|
-
- test - add mocha-like test-functions jstestDescribe, jstestIt
|
|
49
|
-
|
|
50
|
-
# v2021.9.20
|
|
51
|
-
- jslint - add bigint support.
|
|
52
|
-
- vim - add vim-plugin and file jslint.vim.
|
|
53
|
-
- doc - auto-generate toc for README.md
|
|
54
|
-
- jslint - rename little-used directive `debug` to `trace` to avoid confusion with non-related directive `devel`.
|
|
55
|
-
|
|
56
|
-
# v2021.8.20
|
|
57
|
-
- warning - disable un-ergonomic warnings restricting directive-global (missing_browser and unexpected_directive_a).
|
|
58
|
-
- fs - rename file ci.sh to jslint_ci.sh.
|
|
59
|
-
- license - add codemirror license to rollup-assets.
|
|
60
|
-
- website - display number of warnings, properties, functions in report.
|
|
61
|
-
- website - fix uiLoader getting hidden behind highlighted text.
|
|
62
|
-
|
|
63
|
-
# v2021.7.24
|
|
64
|
-
- bugfix - fix jslint not warning about function-redefinition when function is defined inside a call.
|
|
65
|
-
- bugfix - fix website crashing when linting pure json-object.
|
|
66
|
-
- ci - fix race-condition when inlining css.
|
|
67
|
-
- doc - update README.md with links to archived web-demos.
|
|
68
|
-
- jslint - add new beta-warning against redefining global-variables.
|
|
69
|
-
- jslint - add new beta-warning if functions are unordered.
|
|
70
|
-
- jslint - add new warning disallowing string-literal as property-name, e.g. {`aa`:0}.
|
|
71
|
-
- jslint - comment out shebang in jslint.mjs so older ios devices can use website.
|
|
72
|
-
- jslint - deprecate directive `/*jslint eval*/` - use `//jslint-quiet` instead.
|
|
73
|
-
- jslint-revamp - rearrange functions in jslint.mjs to comply with ordered-functions beta-warning.
|
|
74
|
-
- jslint-revamp - revamp cause-based testing with more robust instrumentation.
|
|
75
|
-
- tests - test artifact and column-position in warnings are correct.
|
|
76
|
-
|
|
77
|
-
# v2021.6.30
|
|
78
|
-
- breaking-change - rename files *.js to *.mjs for better integration with nodejs.
|
|
79
|
-
- ci - auto-screenshot example-shell-commands in README.md.
|
|
80
|
-
- ci - include explicit commonjs (jslint.cjs) and es-module (jslint.mjs) variants of jslint.
|
|
81
|
-
- jslint - disable out-of-scope warning for functions.
|
|
82
|
-
- jslint - reintroduce directive `/*jslint indent2*/` - allow 2-space indent.
|
|
83
|
-
- license - change license to public-domain/unlicense.
|
|
84
|
-
- website - create codemirror-plugin to highlight jslint-warnings in editor.
|
|
85
|
-
|
|
86
|
-
# v2021.6.22
|
|
87
|
-
- bugfix - fix global_list being ignored by jslint.
|
|
88
|
-
- bugfix - fix no-warning when exception in catch-block is unused.
|
|
89
|
-
- ci - migrate ci-scripts from cjs to esm.
|
|
90
|
-
- cli - add env-variable \$JSLINT_BETA.
|
|
91
|
-
- jslint - add new directive `/*jslint beta*/` - enable features currently in beta.
|
|
92
|
-
- jslint - add new directive `/*jslint variable*/` - allow unordered variable-declarations that are not at top of function-scope.
|
|
93
|
-
- jslint - add new warning if const/let/var statements are not declared at top of function-scope.
|
|
94
|
-
- jslint - add new warning if const/let/var statements are unordered.
|
|
95
|
-
- website - invalidate url-cache with each deployment.
|
|
96
|
-
- website - replace .png logo with .svg logo.
|
|
97
|
-
- website - replace current-editor with CodeMirror-editor and change programming-font-family from `Programma` to `consolas, menlo, monospace`.
|
|
98
|
-
|
|
99
|
-
# v2021.6.12
|
|
100
|
-
- bugfix - fix await expression/statement inside catch-statement not registered by functionage.await.
|
|
101
|
-
- bugfix - fix cli appending slash "/" to normalized filename.
|
|
102
|
-
- bugfix - fix issue #316, #317 - jslint complains about dynamic-import.
|
|
103
|
-
- bugfix - fix misleading warning describing alphabetical-order instead of ascii-order.
|
|
104
|
-
- bugfix - fix off-by-one-column bug in missing-semicolon-warning.
|
|
105
|
-
- bugfix - fix try-catch-block complaining about "Unexpected await" inside async-function.
|
|
106
|
-
- directive - re-introduce `/*jslint name*/` to ignore "Bad property name" warning.
|
|
107
|
-
- doc - add install-screenshots.
|
|
108
|
-
- jslint - add new warning if case-statements are not sorted.
|
|
109
|
-
- jslint - add warning for unexpected ? in example `aa=/.{0}?/`.
|
|
110
|
-
- jslint - add warning for unexpected-expr in example `async function aa(){await 0;}`.
|
|
111
|
-
- jslint-refactor-1 - make "stateful" variables scoped outside of jslint() "stateless" by moving them into jslint().
|
|
112
|
-
- jslint-refactor-2 - inline constants anticondition, bitwiseop, escapeable, and opener directly into code.
|
|
113
|
-
- jslint-refactor-3 - inline regexp-functions quantifier(), ranges(), klass(), choice(), directly into code.
|
|
114
|
-
- jslint-refactor-4 - document jslint process and each recursion-loop converted to while-loop.
|
|
115
|
-
- remove unnecessary variables nr.
|
|
116
|
-
- rename artifact-related variables a, b to let artifact_now, artifact_nxt.
|
|
117
|
-
- rename functions make() to token_create().
|
|
118
|
-
- reorganize/rename "global" variables by topical-prefixes:
|
|
119
|
-
artifact_xxx, export_xxx, from_xxx, import_xxx, line_xxx, mode_xxx, token_xxx
|
|
120
|
-
- jslint-refactor-5 - split jslint-core-logic into 5-phases.
|
|
121
|
-
- move phase-sub-functions out of function-jslint().
|
|
122
|
-
- move global-vars into state-object, that can be passed between functions.
|
|
123
|
-
- migrate recursive-loops to while-loops in sub-function phase2_lex().
|
|
124
|
-
- move remaining global-vars into sub-functions or hardcode.
|
|
125
|
-
- update functions artifact(), stop(), warn() with fallback-code `the_token = the_token || state.token_nxt;`.
|
|
126
|
-
- website - add ui-loader-animation.
|
|
127
|
-
|
|
128
|
-
# v2021.6.3
|
|
129
|
-
- breaking-change - hardcode `const fudge = 1`
|
|
130
|
-
- breaking-change - remove little-used-feature allowing jslint to accept array-of-strings as source b/c internal lines-object has been changed from array-of-strings to array-of-objects.
|
|
131
|
-
- doc - add svg changelog.
|
|
132
|
-
- doc - add svg package-listing.
|
|
133
|
-
- doc - document cli-feature to jslint entire directory.
|
|
134
|
-
- jslint - add eslint-like ignore-directives `/*jslint-disable*/`, `/*jslint-enable*/`, `//jslint-quiet`.
|
|
135
|
-
- jslint - add new warning `Directive /*jslint-disable*/ was not closed with /*jslint-enable*/.`.
|
|
136
|
-
- jslint - add new warning `Directive /*jslint-enable*/ was not opened with /*jslint-disable*/.`.
|
|
137
|
-
- jslint - remove obsolete ie-era warning about duplicate names for caught-errors.
|
|
138
|
-
- website - move options-ui to top of page after editor-ui
|
|
139
|
-
|
|
140
|
-
# v2021.5.30
|
|
141
|
-
- bugfix - fix issue #282 - fail to warn trailing semicolon in `export default Object.freeze({})`.
|
|
142
|
-
- ci - 100% code-coverage!
|
|
143
|
-
- ci - auto-update changelog in README.md from CHANGELOG.md.
|
|
144
|
-
- ci - auto-update version numbers in README.md and jslint.js from CHANGELOG.md.
|
|
145
|
-
- deadcode - replace with assertion-check in function choice() - `if (char === "|") { warn... }`.
|
|
146
|
-
- deadcode - replace with assertion-check in function do_function() - `if (mega_mode) { warn... }`.
|
|
147
|
-
- deadcode - replace with assertion-check in function no_space() - `const at = (free ? ...)`.
|
|
148
|
-
- deadcode - replace with assertion-check in function no_space() - `if (open) {...}`.
|
|
149
|
-
- deadcode - replace with assertion-check in function parse_directive() - `} else if (value === "false") {...}`.
|
|
150
|
-
- deadcode - replace with assertion-check in function supplant() - `return ( replacement !== undefined ?...)`.
|
|
151
|
-
- jslint - cleanup regexp code using switch-case-statements.
|
|
152
|
-
- jslint - inline function `activate` into function `action_var`.
|
|
153
|
-
- jslint - inline-document each deadcode-removal/assertion-check.
|
|
154
|
-
- jslint - inline-document each warning with cause that can reproduce it - part 2.
|
|
155
|
-
- tests - inline remaining causal-regressions from test.js into jslint.js
|
|
156
|
-
- tests - validate inline-multi-causes are sorted.
|
|
157
|
-
- website - replace links `branch.xxx` with `branch-xxx`.
|
|
158
|
-
|
|
159
|
-
# v2021.5.27
|
|
160
|
-
- ci - fix expectedWarningCode not being validated.
|
|
161
|
-
- ci - in windows, disable git-autocrlf.
|
|
162
|
-
- deadcode - replace with assertion-check in function are_similar() - "if (a === b) { return true }".
|
|
163
|
-
- deadcode - replace with assertion-check in function are_similar() superseded by id-check - "if (Array.isArray(b)) { return false; }".
|
|
164
|
-
- deadcode - replace with assertion-check in function are_similar() superseded by is_weird() check - "if (a.arity === "function" && a.arity ===...c".
|
|
165
|
-
- jslint - add directive `test_internal_error`.
|
|
166
|
-
- jslint - add directive `unordered` to tolerate unordered properties and params.
|
|
167
|
-
- jslint - inline-document each warning with cause that can reproduce it - part 1.
|
|
168
|
-
- style - refactor code moving infix-operators from post-position to pre-position in multiline statements.
|
|
169
|
-
- website - add hotkey ctrl-enter to run jslint.
|
|
170
|
-
|
|
171
|
-
# v2021.5.26
|
|
172
|
-
- ci - fix ci silently failing in node-v12 and node-v14.
|
|
173
|
-
- cli - add env var JSLINT_CLI to force-trigger cli in jslint.js (used for code-coverage of cli).
|
|
174
|
-
- jslint - add "globalThis" to default globals.
|
|
175
|
-
- jslint - add new rules unordered_param_a, unordered_property_a, that warn if parameters and properties are listed in nonascii-order.
|
|
176
|
-
- jslint - fix bug where (global) functionage missing properties finally and try.
|
|
177
|
-
- jslint - fix bug failing to parse unicode "\\u{12345}".
|
|
178
|
-
- jslint - fix bug falsely warning against conditional-chaining-operator "?.".
|
|
179
|
-
- jslint - remove deadcode for preaction-binary-".".
|
|
180
|
-
- jslint - remove deadcode warning bad_option_a.
|
|
181
|
-
- website - add fork-me ribbon.
|
|
182
|
-
- website - load index.html with example code.
|
|
183
|
-
- website - merge file report.js into browser.js.
|
|
184
|
-
|
|
185
|
-
# v2021.5.23
|
|
186
|
-
- doc - add section Changelog.
|
|
187
|
-
- doc - update README.md with installation instructions.
|
|
188
|
-
- cli - merge shell-function shJslintCli into jslint.js.
|
|
189
|
-
- jslint - update default globals with support for "import".
|
|
190
|
-
- jslint - sort warnings with higher priority for early_stop.
|
|
191
|
-
- jslint - add async/await support.
|
|
192
|
-
- ci - make branch-beta the default branch.
|
|
193
|
-
- ci - validate non-http/file links in *.md files.
|
|
194
|
-
- ci - add shell-functions shCiBranchPromote.
|
|
195
|
-
|
|
196
|
-
# v2021.5.21
|
|
197
|
-
- this ci-release does not change any core-functionality of file jslint.js.
|
|
198
|
-
- doc - add file CHANGELOG.md.
|
|
199
|
-
- ci - begin addng regression tests and improve code-coverage.
|
|
200
|
-
- ci - allow pull-requests to run restricted-ci (cannot upload artifacts).
|
|
201
|
-
- gh-pages - fix missing assets and insecure http-links.
|
|
202
|
-
- gh-pages - merge file jslint.css into index.html.
|
|
203
|
-
- gh-pages - add files image-jslint-xxx.png.
|
|
204
|
-
- gh-pages - cleanup asset naming-convention.
|
|
205
|
-
- fix missing fonts in function.html and help.html.
|
|
206
|
-
- add files .gitconfig, Daley-Bold.woff2, Programma-Bold.woff2, icon-folder-open-solid.svg, icon-window-maximize-regular.svg.
|
|
207
|
-
- ci - fix http-links after moving to jslint-org.
|
|
208
|
-
- doc - migrate file README to README.md with embedded ci links and screenshots.
|
|
209
|
-
- ci - add macos and windows to ci-matrix.
|
|
210
|
-
- ci - ci now fails if jslint-check fails for any of the files in branches.
|
|
211
|
-
- ci - add github-workflows to generate code-coverage for jslint.js.
|
|
212
|
-
|
|
213
|
-
# v2020.11.6
|
|
214
|
-
- last jslint version before jslint-org migration.
|
|
215
|
-
|
|
216
|
-
# v2018.4.25
|
|
217
|
-
- last jslint version written in commonjs.
|
|
218
|
-
|
|
219
|
-
# v2017.11.6
|
|
220
|
-
- last jslint version written in es5.
|
|
221
|
-
|
|
222
|
-
# v2014.7.8
|
|
223
|
-
- last jslint version before 2 year hiatus.
|
|
224
|
-
|
|
225
|
-
# v2013.3.13
|
|
226
|
-
- last jslint version that can lint .html and .css files.
|
package/jslint.vim
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"" jslint.vim
|
|
2
|
-
"" jslint plugin for vim
|
|
3
|
-
""
|
|
4
|
-
"" 1. Save this file and "jslint.mjs" to directory "~/.vim/"
|
|
5
|
-
"" 2. Add vim-command ":source ~/.vim/jslint.vim" to file "~/.vimrc"
|
|
6
|
-
"" 3. Vim can now jslint files (via nodejs):
|
|
7
|
-
"" - with vim-command ":SaveAndJslint"
|
|
8
|
-
"" - with vim-key-combo "<Ctrl-S> <Ctrl-J>"
|
|
9
|
-
|
|
10
|
-
"" this function will save current file and jslint it (via nodejs)
|
|
11
|
-
function! SaveAndJslint(bang)
|
|
12
|
-
"" save file
|
|
13
|
-
if a:bang == "!" | write! | else | write | endif
|
|
14
|
-
"" jslint file (via nodejs)
|
|
15
|
-
let &l:errorformat = "%f:%n:%l:%c:%m"
|
|
16
|
-
let &l:makeprg = "node \"" . $HOME . "/.vim/jslint.mjs\" --mode-vim-plugin"
|
|
17
|
-
\ . " \"" . fnamemodify(bufname("%"), ":p") . "\""
|
|
18
|
-
silent make! | cwindow | redraw!
|
|
19
|
-
endfunction
|
|
20
|
-
|
|
21
|
-
"" create vim-command ":SaveAndJslint"
|
|
22
|
-
command! -nargs=* -bang SaveAndJslint call SaveAndJslint("<bang>")
|
|
23
|
-
|
|
24
|
-
"" map vim-key-combo "<ctrl-s> <ctrl-j>" to ":SaveAndJslint"
|
|
25
|
-
inoremap <c-s><c-j> <esc> :SaveAndJslint <cr>
|
|
26
|
-
nnoremap <c-s><c-j> :SaveAndJslint <cr>
|