4f03524668
- 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
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
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"
|
|
}
|
|
}
|
|
]; |