Skip to content
This repository was archived by the owner on Jun 14, 2026. It is now read-only.

Commit 7de3c12

Browse files
Replace jshint with eslint and override lodash to fix vulnerability
Removes jshint (and its lodash@~4.17.21 pin) in favor of eslint, which unblocks overriding lodash to 4.18.1 and clears the GHSA-r5fr-rjxr-66jc and GHSA-f23m-r3pf-42rh advisories. The new eslint config matches jshint's practical behavior on this codebase, and the before_prepare hook is rewritten to shell out to eslint. Stale per-file jshint pragmas are stripped throughout www/js since their rules are now configured globally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 53adef0 commit 7de3c12

39 files changed

Lines changed: 750 additions & 412 deletions

.jshintrc

Lines changed: 0 additions & 91 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
export default [
2+
{
3+
files: ["www/js/**/*.js"],
4+
languageOptions: {
5+
ecmaVersion: 2015,
6+
sourceType: "script",
7+
globals: {
8+
// Browser
9+
window: "readonly",
10+
document: "readonly",
11+
navigator: "readonly",
12+
localStorage: "readonly",
13+
sessionStorage: "readonly",
14+
location: "readonly",
15+
history: "readonly",
16+
setTimeout: "readonly",
17+
clearTimeout: "readonly",
18+
setInterval: "readonly",
19+
clearInterval: "readonly",
20+
XMLHttpRequest: "readonly",
21+
FormData: "readonly",
22+
FileReader: "readonly",
23+
Blob: "readonly",
24+
URL: "readonly",
25+
atob: "readonly",
26+
btoa: "readonly",
27+
Image: "readonly",
28+
Event: "readonly",
29+
CustomEvent: "readonly",
30+
requestAnimationFrame: "readonly",
31+
cancelAnimationFrame: "readonly",
32+
fetch: "readonly",
33+
Headers: "readonly",
34+
Request: "readonly",
35+
Response: "readonly",
36+
performance: "readonly",
37+
Worker: "readonly",
38+
HTMLElement: "readonly",
39+
HTMLCanvasElement: "readonly",
40+
HTMLVideoElement: "readonly",
41+
screen: "readonly",
42+
getComputedStyle: "readonly",
43+
matchMedia: "readonly",
44+
MutationObserver: "readonly",
45+
46+
// Development
47+
console: "readonly",
48+
alert: "readonly",
49+
confirm: "readonly",
50+
prompt: "readonly",
51+
52+
// Cordova / App globals
53+
cordova: "readonly",
54+
StatusBar: "readonly",
55+
angular: "readonly",
56+
ionic: "readonly",
57+
moment: "readonly",
58+
Masonry: "readonly",
59+
Packery: "readonly",
60+
Draggabilly: "readonly",
61+
imagesLoaded: "readonly",
62+
Chart: "readonly",
63+
saveAs: "readonly",
64+
chrome: "readonly",
65+
URI: "readonly",
66+
localforage: "readonly",
67+
CryptoJS: "readonly",
68+
Connection: "readonly",
69+
LZString: "readonly",
70+
vis: "readonly",
71+
timeline: "readonly",
72+
PushNotification: "readonly",
73+
ConnectSDK: "readonly",
74+
ContactFindOptions: "readonly",
75+
$: "readonly",
76+
MobileAccessibility: "readonly",
77+
hello: "readonly",
78+
DJS: "readonly",
79+
FirebasePlugin: "readonly",
80+
gifshot: "readonly",
81+
ReadableStream: "readonly",
82+
LibraryHelper: "readonly",
83+
GifWriter: "readonly",
84+
NeuQuant: "readonly",
85+
LocalFileSystem: "readonly",
86+
FileError: "readonly",
87+
},
88+
},
89+
rules: {
90+
// Enforcing (from jshint config)
91+
"no-bitwise": "error",
92+
"no-extend-native": "error",
93+
"no-caller": "error",
94+
95+
// Off to match jshint's practical behavior on this codebase
96+
"no-undef": "off",
97+
"eqeqeq": "off",
98+
"curly": "off",
99+
"no-unused-vars": "off",
100+
"strict": "off",
101+
"no-loop-func": "off",
102+
"no-return-assign": "off",
103+
"dot-notation": "off",
104+
},
105+
},
106+
];

hooks/before_prepare/02_eslint.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env node
2+
3+
var childProcess = require('child_process');
4+
var path = require('path');
5+
6+
var projectRoot = path.resolve(__dirname, '..', '..');
7+
var eslintBin = path.join(projectRoot, 'node_modules', '.bin', 'eslint');
8+
9+
console.log('Linting www/js/ with ESLint...');
10+
11+
try {
12+
childProcess.execSync(
13+
eslintBin + ' www/js/',
14+
{ cwd: projectRoot, stdio: 'inherit' }
15+
);
16+
console.log('ESLint: no errors found.');
17+
} catch (e) {
18+
console.error('ESLint found errors. Build aborted.');
19+
process.exit(1);
20+
}

hooks/before_prepare/02_jshint.js

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)