|
| 1 | +/* |
| 2 | +* Copyright (c) 2015-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. |
| 3 | +*/ |
| 4 | + |
| 5 | +// ESLint 9+ flat config |
| 6 | +const globals = require("globals"); |
| 7 | + |
| 8 | +module.exports = [ |
| 9 | + { |
| 10 | + // Base configuration for all JS files |
| 11 | + files: ["**/*.js"], |
| 12 | + languageOptions: { |
| 13 | + ecmaVersion: 2022, |
| 14 | + sourceType: "commonjs", // Node.js uses CommonJS |
| 15 | + globals: { |
| 16 | + ...globals.commonjs, |
| 17 | + ...globals.node, |
| 18 | + ...globals.browser, // Add browser globals like setTimeout |
| 19 | + structuredClone: "readonly", |
| 20 | + // Legacy globals from old config |
| 21 | + Atomics: "readonly", |
| 22 | + SharedArrayBuffer: "readonly" |
| 23 | + } |
| 24 | + }, |
| 25 | + rules: { |
| 26 | + // Spacing and formatting |
| 27 | + "indent": "off", // TODO: Fix indentation in separate PR |
| 28 | + "linebreak-style": ["error", "unix"], |
| 29 | + "quotes": ["error", "single"], |
| 30 | + "semi": ["error", "always"], |
| 31 | + |
| 32 | + // Modern best practices |
| 33 | + "eqeqeq": "error", |
| 34 | + "curly": ["error", "all"], // Require braces for all control structures |
| 35 | + "no-unused-vars": "error", |
| 36 | + "no-undef": "error", |
| 37 | + |
| 38 | + // Spacing rules (disabled for initial setup - TODO: Fix in separate PR) |
| 39 | + "arrow-spacing": "off", |
| 40 | + "space-before-blocks": "off", |
| 41 | + "space-before-function-paren": "off", |
| 42 | + "space-in-parens": "off", |
| 43 | + "object-curly-spacing": "off", |
| 44 | + "keyword-spacing": "off", |
| 45 | + "comma-spacing": "off", |
| 46 | + "key-spacing": "off", |
| 47 | + "space-infix-ops": "off", |
| 48 | + |
| 49 | + // Style rules (disabled for initial setup - TODO: Fix in separate PR) |
| 50 | + "array-bracket-spacing": "off", |
| 51 | + "block-spacing": "off", |
| 52 | + "brace-style": "off", |
| 53 | + "func-call-spacing": "off", |
| 54 | + "no-trailing-spaces": "off", |
| 55 | + |
| 56 | + // Disable console errors for this project |
| 57 | + "no-console": "off", |
| 58 | + |
| 59 | + // Bracket notation preference |
| 60 | + "dot-notation": "error" |
| 61 | + } |
| 62 | + }, |
| 63 | + { |
| 64 | + // Ignore patterns |
| 65 | + ignores: [ |
| 66 | + "**/data/*.js", |
| 67 | + "node_modules/**", |
| 68 | + "coverage/**" |
| 69 | + ] |
| 70 | + } |
| 71 | +]; |
0 commit comments