import { defineConfig } from "oxlint"; export const javascript = defineConfig({ categories: { correctness: "warn", perf: "warn", style: "warn", suspicious: "warn" }, overrides: [{ files: ["**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts}"], rules: { "arrow-body-style": "off", "curly": ["warn", "all"], "eqeqeq": ["warn", "always"], "func-style": ["warn", "declaration", { allowArrowFunctions: true }], "no-constant-binary-expression": "warn", "no-dupe-class-members": "error", "no-empty": ["warn", { allowEmptyCatch: true }], "no-empty-static-block": "warn", "no-extra-bind": "warn", "no-loss-of-precision": "warn", "no-new-native-nonconstructor": "error", "no-unexpected-multiline": "warn", "no-unneeded-ternary": "warn", "no-unused-expressions": ["warn", { allowShortCircuit: true, allowTaggedTemplates: true, allowTernary: true }], "no-unused-labels": "warn", "no-unused-vars": "off", "no-useless-call": "warn", "no-useless-catch": "warn", "no-useless-computed-key": "warn", "no-useless-concat": "warn", "no-useless-constructor": "off", "no-useless-escape": "warn", "no-useless-rename": "warn", "no-useless-return": "warn", "no-var": "warn", "prefer-exponentiation-operator": "warn", "prefer-object-spread": "warn", "prefer-template": "warn", "radix": "warn", // disable recommended rules "id-length": "off", "no-magic-numbers": "off", "sort-imports": "off", // unicorn "unicorn/better-regex": "warn", "unicorn/consistent-destructuring": "warn", "unicorn/empty-brace-spaces": "warn", "unicorn/error-message": "warn", "unicorn/no-await-expression-member": "warn", "unicorn/no-empty-file": "warn", "unicorn/no-instanceof-array": "warn", "unicorn/no-negation-in-equality-check": "warn", "unicorn/no-unreadable-array-destructuring": "warn", "unicorn/no-useless-length-check": "warn", "unicorn/no-useless-spread": "warn", "unicorn/no-useless-undefined": ["warn", { checkArguments: false }], "unicorn/number-literal-case": "warn", "unicorn/numeric-separators-style": ["warn", { onlyIfContainsSeparator: false }], "unicorn/prefer-date-now": "warn", "unicorn/prefer-export-from": ["warn", { ignoreUsedVariables: true }], "unicorn/prefer-negative-index": "warn", "unicorn/prefer-node-protocol": "warn", "unicorn/template-indent": ["warn", { tags: ["ts"] }], "unicorn/throw-new-error": "warn", "yoda": "warn" } }], plugins: ["unicorn"] });