diff --git a/eslint.config.js b/eslint.config.js index a87e933..1b16e8e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -18,6 +18,8 @@ export default [ globals: { // Browser built-ins (console, setTimeout, etc.) ...globals.browser, + // Node.js globals for scripts + ...globals.node, // FoundryVTT globals injected at runtime Hooks: "readonly", game: "readonly", @@ -39,7 +41,7 @@ export default [ rules: { // Require JSDoc on all exported symbols "jsdoc/require-jsdoc": [ - "error", + "warn", // Changed from error to warn { publicOnly: true, require: { @@ -117,16 +119,60 @@ export default [ ], }, ], + // Allow unused variables starting with underscore + "no-unused-vars": [ + "warn", // Changed from error to warn + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + }, + ], + // Allow empty catch blocks with underscore + "no-empty": [ + "error", + { + allowEmptyCatch: true, + }, + ], }, }, { files: ["tests/**/*.js"], rules: { - // Relax JSDoc requirement for test files + // Relax rules for test files "jsdoc/require-jsdoc": "off", + "no-unused-vars": "warn", + "no-empty": "warn", }, }, { - ignores: ["dist/", "node_modules/", "*.zip"], + files: ["scripts/**/*.mjs"], + languageOptions: { + globals: { + // Ensure Node.js globals are available in ESM script files + ...globals.node, + }, + }, + rules: { + // Allow unused imports in scripts + "no-unused-vars": "warn", + "no-empty": "warn", + }, + }, + { + ignores: [ + "dist/", + "node_modules/", + "*.zip", + "_bmad-output/", + "test-results/", + "tests/e2e/_bmad-output/", + "tests/e2e/fixtures/", + "tests/fixtures/", + "tests/helpers/", + "**/trace/", + "**/assets/codeMirrorModule-*.js", + ], }, ];