Skip to content

Commit 878a573

Browse files
authored
Merge pull request #404 from kaizhu256/directive_subscript
- directive - add new directive `subscript` for linting of scripts targeting Google Closure Compiler
2 parents ee1029d + 278cd9e commit 878a573

10 files changed

+266
-145
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Changelog
22

33
# Todo
4-
- jslint - allow alias `nomen` for jslint-directive `name`
54
- wrapper - add vscode-command to suppress minor warnings on given line
65
- doc - document jslint directives and supported/unsupported es6+ features
76
- cli - remove cli-option `--mode-vim-plugin`
@@ -16,6 +15,10 @@
1615
- node - after node-v14 is deprecated, remove shell-code `export "NODE_OPTIONS=--unhandled-rejections=strict"`.
1716

1817
# v2022.6.1-beta
18+
- directive - add new directive `subscript` for linting of scripts targeting Google Closure Compiler
19+
- warning - relax warning about missing `catch` in `try...finally` statement
20+
- jslint - allow aliases `evil, nomen` for jslint-directives `eval, name`, respectively for backwards-compat
21+
- bugfix - fix broken codemirror example
1922
- bugfix - fix jslint not-recognizing option-chaining when comparing operands of binary operator
2023
- allow array-literals to directly call [...].flat() and [...].flatMap()
2124

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,11 @@ import jslint from "../jslint.mjs";
376376

377377
<!-- Assets from codemirror. -->
378378

379-
<link rel="stylesheet" href="https://codemirror.net/lib/codemirror.css">
380-
<link rel="stylesheet" href="https://codemirror.net/addon/lint/lint.css">
381-
<script defer src="https://codemirror.net/lib/codemirror.js"></script>
382-
<script defer
383-
src="https://codemirror.net/mode/javascript/javascript.js"></script>
384-
<script defer src="https://codemirror.net/addon/lint/lint.js"></script>
379+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.css">
380+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/lint/lint.css">
381+
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.js"></script>
382+
<script defer src="https://codemirror.net/mode/javascript/javascript.js"></script>
383+
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/lint/lint.js"></script>
385384

386385
<!-- Assets from jslint. -->
387386

@@ -397,6 +396,10 @@ body {
397396
.JSLINT_.JSLINT_REPORT_ {
398397
margin-top: 20px;
399398
}
399+
#editor1 {
400+
height: 300px;
401+
width: 100%;
402+
}
400403
</style>
401404
</head>
402405

asset_codemirror_rollup.js

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ shRawLibFetch
55
"fetchList": [
66
{
77
"comment": true,
8-
"url": "https://github.com/codemirror/CodeMirror/blob/5.65.3/LICENSE"
8+
"url": "https://github.com/codemirror/CodeMirror5/blob/5.65.5/LICENSE"
99
},
1010
{
11-
"url": "https://github.com/codemirror/CodeMirror/blob/5.65.3/codemirror.js",
12-
"url2": "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.3/codemirror.js"
11+
"url": "https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js",
12+
"url2": "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.js"
1313
},
1414
{
15-
"url": "https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/edit/matchbrackets.js"
15+
"url": "https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/edit/matchbrackets.js"
1616
},
1717
{
18-
"url": "https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/edit/trailingspace.js"
18+
"url": "https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/edit/trailingspace.js"
1919
},
2020
{
21-
"url": "https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/lint/lint.js"
21+
"url": "https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/lint/lint.js"
2222
},
2323
{
24-
"url": "https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/selection/active-line.js"
24+
"url": "https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/selection/active-line.js"
2525
},
2626
{
27-
"url": "https://github.com/codemirror/CodeMirror/blob/5.65.3/mode/javascript/javascript.js"
27+
"url": "https://github.com/codemirror/CodeMirror5/blob/5.65.5/mode/javascript/javascript.js"
2828
}
2929
],
3030
"replaceList": []
@@ -33,13 +33,13 @@ shRawLibFetch
3333

3434

3535
/*
36-
repo https://github.com/codemirror/CodeMirror/tree/5.65.3
37-
committed 2022-04-20T09:49:25Z
36+
repo https://github.com/codemirror/CodeMirror5/tree/5.65.5
37+
committed 2022-05-30T09:58:15Z
3838
*/
3939

4040

4141
/*
42-
file https://github.com/codemirror/CodeMirror/blob/5.65.3/LICENSE
42+
file https://github.com/codemirror/CodeMirror5/blob/5.65.5/LICENSE
4343
*/
4444
/*
4545
MIT License
@@ -67,7 +67,7 @@ THE SOFTWARE.
6767

6868

6969
/*
70-
file https://github.com/codemirror/CodeMirror/blob/5.65.3/codemirror.js
70+
file https://github.com/codemirror/CodeMirror5/blob/5.65.5/codemirror.js
7171
*/
7272
// CodeMirror, copyright (c) by Marijn Haverbeke and others
7373
// Distributed under an MIT license: https://codemirror.net/LICENSE
@@ -97,7 +97,8 @@ file https://github.com/codemirror/CodeMirror/blob/5.65.3/codemirror.js
9797
var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);
9898
var webkit = !edge && /WebKit\//.test(userAgent);
9999
var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent);
100-
var chrome = !edge && /Chrome\//.test(userAgent);
100+
var chrome = !edge && /Chrome\/(\d+)/.exec(userAgent);
101+
var chrome_version = chrome && +chrome[1];
101102
var presto = /Opera\//.test(userAgent);
102103
var safari = /Apple Computer/.test(navigator.vendor);
103104
var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
@@ -4580,6 +4581,17 @@ file https://github.com/codemirror/CodeMirror/blob/5.65.3/codemirror.js
45804581
}
45814582

45824583
function onScrollWheel(cm, e) {
4584+
// On Chrome 102, viewport updates somehow stop wheel-based
4585+
// scrolling. Turning off pointer events during the scroll seems
4586+
// to avoid the issue.
4587+
if (chrome && chrome_version >= 102) {
4588+
if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = "none"; }
4589+
else { clearTimeout(cm.display.chromeScrollHack); }
4590+
cm.display.chromeScrollHack = setTimeout(function () {
4591+
cm.display.chromeScrollHack = null;
4592+
cm.display.sizer.style.pointerEvents = "";
4593+
}, 100);
4594+
}
45834595
var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
45844596
var pixelsPerUnit = wheelPixelsPerUnit;
45854597
if (e.deltaMode === 0) {
@@ -8268,7 +8280,7 @@ file https://github.com/codemirror/CodeMirror/blob/5.65.3/codemirror.js
82688280
var pasted = e.clipboardData && e.clipboardData.getData("Text");
82698281
if (pasted) {
82708282
e.preventDefault();
8271-
if (!cm.isReadOnly() && !cm.options.disableInput)
8283+
if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())
82728284
{ runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }); }
82738285
return true
82748286
}
@@ -9912,14 +9924,14 @@ file https://github.com/codemirror/CodeMirror/blob/5.65.3/codemirror.js
99129924

99139925
addLegacyProps(CodeMirror);
99149926

9915-
CodeMirror.version = "5.65.3";
9927+
CodeMirror.version = "5.65.5";
99169928

99179929
return CodeMirror;
99189930
})));
99199931

99209932

99219933
/*
9922-
file https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/edit/matchbrackets.js
9934+
file https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/edit/matchbrackets.js
99239935
*/
99249936
// CodeMirror, copyright (c) by Marijn Haverbeke and others
99259937
// Distributed under an MIT license: https://codemirror.net/LICENSE
@@ -10084,7 +10096,7 @@ file https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/edit/matchbracke
1008410096

1008510097

1008610098
/*
10087-
file https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/edit/trailingspace.js
10099+
file https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/edit/trailingspace.js
1008810100
*/
1008910101
// CodeMirror, copyright (c) by Marijn Haverbeke and others
1009010102
// Distributed under an MIT license: https://codemirror.net/LICENSE
@@ -10116,7 +10128,7 @@ file https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/edit/trailingspa
1011610128

1011710129

1011810130
/*
10119-
file https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/lint/lint.js
10131+
file https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/lint/lint.js
1012010132
*/
1012110133
// CodeMirror, copyright (c) by Marijn Haverbeke and others
1012210134
// Distributed under an MIT license: https://codemirror.net/LICENSE
@@ -10412,7 +10424,7 @@ file https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/lint/lint.js
1041210424

1041310425

1041410426
/*
10415-
file https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/selection/active-line.js
10427+
file https://github.com/codemirror/CodeMirror5/blob/5.65.5/addon/selection/active-line.js
1041610428
*/
1041710429
// CodeMirror, copyright (c) by Marijn Haverbeke and others
1041810430
// Distributed under an MIT license: https://codemirror.net/LICENSE
@@ -10489,7 +10501,7 @@ file https://github.com/codemirror/CodeMirror/blob/5.65.3/addon/selection/active
1048910501

1049010502

1049110503
/*
10492-
file https://github.com/codemirror/CodeMirror/blob/5.65.3/mode/javascript/javascript.js
10504+
file https://github.com/codemirror/CodeMirror5/blob/5.65.5/mode/javascript/javascript.js
1049310505
*/
1049410506
// CodeMirror, copyright (c) by Marijn Haverbeke and others
1049510507
// Distributed under an MIT license: https://codemirror.net/LICENSE

0 commit comments

Comments
 (0)