chore: add JS/ESLint toolchain, refactor onclick to event delegation

- Add ESLint config for web/ui (flat config, golangci-lint-compatible)
- Add js-lint task to mise.toml (npm run lint in web/ui)
- Add ESLint check to check-toolchain.sh
- Add .golangci.yml for golangci-lint v2 with correct exclusions
- Refactor app.js: replace inline onclick with data-action + event delegation
- Add null checks and HTTP status checks to browseWavs
- Add web/ui/node_modules/ to .gitignore
This commit is contained in:
2026-06-22 00:10:49 -07:00
parent f716902580
commit 4f03524668
8 changed files with 1201 additions and 4 deletions
+45
View File
@@ -0,0 +1,45 @@
const globals = require('globals');
module.exports = [
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'script',
globals: {
...globals.browser,
AudioContext: 'readonly',
requestAnimationFrame: 'readonly',
cancelAnimationFrame: 'readonly',
fetch: 'readonly',
EventSource: 'readonly',
document: 'readonly',
console: 'readonly',
setTimeout: 'readonly',
Math: 'readonly',
JSON: 'readonly',
location: 'readonly',
encodeURIComponent: 'readonly',
decodeURIComponent: 'readonly',
parseInt: 'readonly',
Number: 'readonly',
Promise: 'readonly',
Object: 'readonly',
Array: 'readonly',
Map: 'readonly',
process: 'readonly',
__dirname: 'readonly',
require: 'readonly',
module: 'readonly',
exports: 'readonly'
}
},
rules: {
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"no-redeclare": "warn",
"no-unreachable": "warn",
"eqeqeq": ["error", "always"],
"prefer-const": "warn"
}
}
];