@adddog/eslint 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,7 @@ function eslint_config(options, ...userConfigs) {
41
41
  "no-barrel-files": eslintPluginNoBarrelFiles__default
42
42
  },
43
43
  rules: {
44
+ "rad/no-as-unknown-as": "error",
44
45
  "rad/no-incorrect-pkg-imports": "error",
45
46
  "no-barrel-files/no-barrel-files": "error"
46
47
  }
@@ -249,4 +250,3 @@ function eslint_config(options, ...userConfigs) {
249
250
 
250
251
  exports.default = eslint_config;
251
252
  exports.ignores = ignores;
252
- //# sourceMappingURL=eslint.config.cjs.map
@@ -31,6 +31,7 @@ function eslint_config(options, ...userConfigs) {
31
31
  "no-barrel-files": eslintPluginNoBarrelFiles
32
32
  },
33
33
  rules: {
34
+ "rad/no-as-unknown-as": "error",
34
35
  "rad/no-incorrect-pkg-imports": "error",
35
36
  "no-barrel-files/no-barrel-files": "error"
36
37
  }
@@ -238,4 +239,3 @@ function eslint_config(options, ...userConfigs) {
238
239
  }
239
240
 
240
241
  export { eslint_config as default, ignores };
241
- //# sourceMappingURL=eslint.config.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adddog/eslint",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "homepage": "https://github.com/samelie/eslint#readme",
6
6
  "repository": {
@@ -23,30 +23,17 @@
23
23
  "files": [
24
24
  "dist"
25
25
  ],
26
- "scripts": {
27
- "build": "unbuild",
28
- "lint": "eslint .",
29
- "lint:fix": "eslint --fix .",
30
- "types": "tsc -p tsconfig.typecheck.json",
31
- "release": "bumpp --yes --no-push --release patch",
32
- "prepublishOnly": "pnpm run lint && pnpm run types && pnpm run build",
33
- "prepack": "pnpm run prepublishOnly",
34
- "knip": "knip"
35
- },
36
26
  "dependencies": {
37
- "@adddog/eslint-plugin-rules": "^0.0.10",
27
+ "@antfu/eslint-config": "^7.4.3",
38
28
  "eslint-plugin-no-barrel-files": "^1.2.2",
39
- "@antfu/eslint-config": "^5.4.1"
29
+ "@adddog/eslint-plugin-rules": "0.0.11"
40
30
  },
41
31
  "devDependencies": {
42
- "@adddog/build-configs": "^0.0.1",
43
- "@types/node": "^24.7.2",
44
- "bumpp": "^10.3.1",
45
- "eslint": "^9.37.0",
46
- "eslint-flat-config-utils": "^2.1.4",
47
- "eslint-plugin-format": "^1.0.2",
48
- "package-json-type": "^1.0.3",
49
- "package-up": "^5.0.0",
32
+ "@types/node": "^25.2.3",
33
+ "bumpp": "^10.4.1",
34
+ "eslint": "^10.0.0",
35
+ "eslint-plugin-format": "^1.4.0",
36
+ "package-json-type": "^1.1.2",
50
37
  "typescript": "^5.9.3",
51
38
  "unbuild": "^3.6.1"
52
39
  },
@@ -58,5 +45,13 @@
58
45
  "node": ">= 22",
59
46
  "pnpm": ">= 10",
60
47
  "npm": ">= 11"
48
+ },
49
+ "scripts": {
50
+ "build": "unbuild",
51
+ "lint": "eslint .",
52
+ "lint:fix": "eslint --fix .",
53
+ "types": "tsc -p tsconfig.typecheck.json",
54
+ "release": "bumpp --yes --no-push --no-tag --release patch",
55
+ "knip": "knip"
61
56
  }
62
- }
57
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"eslint.config.cjs","sources":["../src/eslint.config.ts"],"sourcesContent":["/**\n * ESLint Configuration based on @antfu/eslint-config\n *\n * This configuration extends Anthony Fu's ESLint config with custom overrides for:\n * - Stylistic preferences (4-space indent, double quotes, semicolons)\n * - Type safety (strict any prevention)\n * - Flexible code organization (allow declaration merging, hoisting)\n * - Custom plugins (rad rules, no-barrel-files)\n *\n * Structure:\n * 1. Base config with stylistic preferences\n * 2. Custom plugin rules\n * 3. General rule overrides\n * 4. Unicorn plugin overrides\n * 5. Stylistic rule overrides\n * 6. TypeScript rule overrides\n *\n * Reference: https://github.com/antfu/eslint-config\n */\n\nimport radPlguins from \"@adddog/eslint-plugin-rules\";\nimport antfu from \"@antfu/eslint-config\";\n\nimport eslintPluginNoBarrelFiles from \"eslint-plugin-no-barrel-files\";\n\nexport const ignores = [\"**/build/**\", \"**/dist/**\", \"README.md\", \"package.json\", \"**/dev-dist/**\", \"**.js\", \"**.vscode/.settings.json\", \"**/node_modules/**\", \"*.html\"];\n\nexport default function (options?: Parameters<typeof antfu>[0] & { ignores?: string[] }, ...userConfigs: Parameters<typeof antfu>[1][]): ReturnType<typeof antfu> {\n return antfu(\n {\n stylistic: {\n indent: 4,\n quotes: \"double\",\n semi: true,\n },\n formatters: { css: true, xml: false },\n react: false,\n jsx: false,\n markdown: false,\n // TypeScript and Vue are auto-detected, you can also explicitly enable them:\n typescript: true,\n ignores: [...ignores, ...(options?.ignores || [])],\n // Disable jsonc and yaml support\n jsonc: false,\n yaml: false,\n vue: false,\n ...options,\n },\n {\n files: [\"**/*.ts\"],\n plugins: {\n \"rad\": radPlguins,\n \"no-barrel-files\": eslintPluginNoBarrelFiles,\n },\n rules: {\n \"rad/no-incorrect-pkg-imports\": \"error\",\n \"no-barrel-files/no-barrel-files\": \"error\",\n },\n },\n // ========================================\n // General overrides\n // ========================================\n {\n rules: {\n // ---- Core ESLint Rules ----\n\n // max-len: Not part of antfu's config by default (would need separate plugin)\n // Turned off to avoid line length restrictions\n \"max-len\": \"off\",\n\n // curly: Not enforced by default in antfu's config\n // Turned off to allow single-line if statements without braces\n \"curly\": \"off\",\n\n // func-style: Not enforced by default\n // Turned off to allow both function declarations and expressions\n \"func-style\": \"off\",\n\n // antfu/curly: Default \"error\" (enforces curly braces with specific style)\n // Turned off to be less opinionated about brace style\n \"antfu/curly\": \"off\",\n\n // accessor-pairs: Default [\"error\", { enforceForClassMembers: true, setWithoutGet: true }]\n // Turned off to allow getters without corresponding setters\n \"accessor-pairs\": \"off\",\n\n // antfu/if-newline: Default \"error\" (enforces newline after if statement)\n // Turned off for more flexible if statement formatting\n \"antfu/if-newline\": \"off\",\n\n // antfu/consistent-list-newline: Default \"error\" (enforces consistent newlines in arrays/objects)\n // Turned off to allow mixed single-line and multi-line arrays/objects\n \"antfu/consistent-list-newline\": \"off\",\n\n // ---- TypeScript Rules ----\n\n // ts/consistent-type-definitions: Default [\"error\", \"interface\"]\n // Turned off to allow both \"interface\" and \"type\" for type definitions\n \"ts/consistent-type-definitions\": \"off\",\n\n // ts/no-redeclare: Default [\"error\", { builtinGlobals: false }]\n // Turned off to allow declaration merging (interfaces, namespaces)\n \"ts/no-redeclare\": \"off\",\n\n // ts/no-unused-expressions: Default [\"error\", { allowShortCircuit: true, allowTaggedTemplates: true, allowTernary: true }]\n // Turned off to allow expressions like optional chaining that may not have side effects\n \"ts/no-unused-expressions\": \"off\",\n\n // ts/no-explicit-any: Default \"off\" in antfu's config\n // Set to \"error\" to enforce strict typing and prevent use of \"any\"\n \"ts/no-explicit-any\": \"error\",\n\n // prefer-arrow-callback: Default [\"error\", { allowNamedFunctions: false, allowUnboundThis: true }]\n // Modified to allow named function expressions in callbacks for better stack traces\n \"prefer-arrow-callback\": [\n \"error\",\n {\n allowNamedFunctions: true, // Changed from false\n allowUnboundThis: true,\n },\n ],\n },\n },\n ...userConfigs,\n )\n // ========================================\n // Unicorn plugin overrides\n // ========================================\n .override(\"antfu/unicorn/rules\", {\n rules: {\n // unicorn/no-new-array: Default \"error\" (enforces array literals over new Array())\n // Turned off to allow new Array(length) for creating arrays with specific length\n \"unicorn/no-new-array\": \"off\",\n\n // Other unicorn rules enabled by default in antfu's config (for reference):\n // - unicorn/consistent-empty-array-spread: \"error\"\n // - unicorn/error-message: \"error\" (require error messages)\n // - unicorn/escape-case: \"error\" (enforce uppercase hex escapes)\n // - unicorn/new-for-builtins: \"error\" (enforce new for builtins)\n // - unicorn/no-instanceof-builtins: \"error\"\n // - unicorn/no-new-buffer: \"error\" (use Buffer.from/Buffer.alloc)\n // - unicorn/number-literal-case: \"error\" (enforce lowercase for number literals)\n // - unicorn/prefer-dom-node-text-content: \"error\"\n // - unicorn/prefer-includes: \"error\" (prefer includes over indexOf)\n // - unicorn/prefer-node-protocol: \"error\" (enforce node: protocol)\n // - unicorn/prefer-number-properties: \"error\" (prefer Number.isNaN over isNaN)\n // - unicorn/prefer-string-starts-ends-with: \"error\"\n // - unicorn/prefer-type-error: \"error\"\n // - unicorn/throw-new-error: \"error\" (require new when throwing errors)\n },\n })\n // ========================================\n // Stylistic overrides\n // ========================================\n .override(\"antfu/stylistic/rules\", {\n rules: {\n // antfu/top-level-function: Default \"error\" (enforces function declarations at top level)\n // Reference: https://github.com/antfu/eslint-config/blob/main/src/configs/stylistic.ts#L61\n // Turned off to allow const/arrow functions at top level\n \"antfu/top-level-function\": \"off\",\n\n // style/arrow-parens: Default depends on stylistic config\n // Set to \"as-needed\" to only require parens when necessary (multiple params, etc)\n \"style/arrow-parens\": [\"error\", \"as-needed\"],\n\n // style/operator-linebreak: Default enforces operators at end/beginning of line\n // Turned off for flexible operator placement in multi-line expressions\n \"style/operator-linebreak\": \"off\",\n\n // style/array-element-newline: Default \"off\" in antfu's config\n // Reference: https://eslint.style/rules/default/array-element-newline\n // Kept off because it causes issues with large objects in arrays\n \"style/array-element-newline\": \"off\",\n\n // style/max-statements-per-line: Default { max: 1 }\n // Increased to 2 to allow simple statements on same line (e.g., case statements)\n \"style/max-statements-per-line\": [\"error\", {\n max: 2,\n }],\n\n // style/function-call-argument-newline: Default varies\n // Set to \"consistent\" so all arguments are either inline or one-per-line\n \"style/function-call-argument-newline\": [\"error\", \"consistent\"],\n\n // style/brace-style: Default depends on stylistic preset\n // Set to \"1tbs\" (one true brace style) with single-line exception\n \"style/brace-style\": [\"error\", \"1tbs\", {\n allowSingleLine: true,\n }],\n\n // Other notable stylistic rules from antfu's config (using your custom config):\n // - indent: 4 (default: 2)\n // - quotes: \"double\" (default: \"single\")\n // - semi: true (default: false)\n // - style/generator-star-spacing: [\"error\", { after: true, before: false }]\n // - style/yield-star-spacing: [\"error\", { after: true, before: false }]\n // - antfu/consistent-chaining: \"error\" (enforces consistent chaining style)\n },\n })\n // ========================================\n // TypeScript-specific overrides\n // ========================================\n // Rules are scoped to names\n // Reference: https://github.com/antfu/eslint-config/blob/93c9e772faf45295a4deb2633a4655954da74491/src/configs/typescript.ts#L110\n .override(\"antfu/typescript/rules\", {\n rules: {\n // ts/no-use-before-define: Default [\"error\", { classes: false, functions: false, variables: true }]\n // Turned off to allow hoisting and more flexible declaration order\n \"ts/no-use-before-define\": \"off\",\n\n // ts/no-unsafe-declaration-merging: Default not explicitly set (likely \"error\")\n // Turned off to allow declaration merging patterns (e.g., interface + namespace)\n \"ts/no-unsafe-declaration-merging\": \"off\",\n\n // no-redeclare: Default [\"error\", { builtinGlobals: false }]\n // Turned off in favor of TypeScript's own redeclaration checks\n \"no-redeclare\": \"off\",\n\n // ts/no-redeclare: Default [\"error\", { builtinGlobals: false }]\n // Turned off to allow declaration merging (same as general overrides)\n \"ts/no-redeclare\": \"off\",\n\n // ts/no-explicit-any: Default \"off\" in antfu's config\n // Set to \"error\" to enforce strict typing and prevent use of \"any\"\n // This is a critical rule for type safety\n \"ts/no-explicit-any\": \"error\",\n\n // ts/unified-signatures: Default \"off\" in antfu's config\n // Set to \"error\" to enforce combining overloaded signatures where possible\n \"ts/unified-signatures\": \"error\",\n\n // ts/no-unused-vars: Default \"off\" in antfu's typescript config (handled by unused-imports plugin)\n // Reference: https://johnnyreilly.com/typescript-eslint-no-unused-vars\n // Configured with strict underscore-prefix ignore pattern for intentionally unused variables\n \"ts/no-unused-vars\": [\n \"error\",\n {\n args: \"all\", // Check all arguments (default: \"after-used\")\n argsIgnorePattern: \"^_\", // Allow _unused arguments\n caughtErrors: \"all\", // Check caught errors (default: \"none\")\n caughtErrorsIgnorePattern: \"^_\", // Allow _error in catch blocks\n destructuredArrayIgnorePattern: \"^_\", // Allow [_skip, value] patterns\n varsIgnorePattern: \"^_\", // Allow _unusedVar\n ignoreRestSiblings: true, // Allow const { removed, ...rest } patterns\n },\n ],\n\n // Other important TypeScript rules from antfu's config (for reference):\n // - ts/ban-ts-comment: [\"error\", { \"ts-expect-error\": \"allow-with-description\" }]\n // - ts/consistent-type-definitions: [\"error\", \"interface\"] (you override to \"off\")\n // - ts/consistent-type-imports: [\"error\", { disallowTypeAnnotations: false, fixStyle: \"separate-type-imports\", prefer: \"type-imports\" }]\n // - ts/method-signature-style: [\"error\", \"property\"] (prefer property syntax)\n // - ts/no-dupe-class-members: \"error\"\n // - ts/no-dynamic-delete: \"off\"\n // - ts/no-empty-object-type: [\"error\", { allowInterfaces: \"always\" }]\n // - ts/no-import-type-side-effects: \"error\"\n // - ts/no-invalid-void-type: \"off\"\n // - ts/no-non-null-assertion: \"off\"\n // - ts/no-require-imports: \"error\"\n // - ts/no-unused-expressions: [\"error\", { allowShortCircuit: true, allowTaggedTemplates: true, allowTernary: true }]\n // - ts/no-useless-constructor: \"off\"\n // - ts/no-wrapper-object-types: \"error\"\n // - ts/triple-slash-reference: \"off\"\n\n // ========================================\n // Notable rules you might want to consider:\n // ========================================\n //\n // Type-aware rules (require tsconfigPath):\n // - ts/await-thenable: \"error\" - Only await thenables\n // - ts/no-floating-promises: \"error\" - Promises must be handled\n // - ts/no-misused-promises: \"error\" - Prevent common promise mistakes\n // - ts/no-unnecessary-type-assertion: \"error\" - Remove redundant assertions\n // - ts/no-unsafe-argument: \"error\" - Prevent any in function arguments\n // - ts/no-unsafe-assignment: \"error\" - Prevent assigning any to typed variables\n // - ts/no-unsafe-call: \"error\" - Prevent calling any as function\n // - ts/no-unsafe-member-access: \"error\" - Prevent accessing properties of any\n // - ts/no-unsafe-return: \"error\" - Prevent returning any from typed functions\n // - ts/strict-boolean-expressions: \"error\" - Strict boolean checks in conditions\n // - ts/switch-exhaustiveness-check: \"error\" - Ensure all cases handled in switch\n //\n // Naming conventions:\n // - ts/naming-convention: Configure consistent naming patterns\n //\n // Import organization:\n // - ts/consistent-type-imports: [\"error\", { prefer: \"type-imports\" }] (already enabled in antfu)\n // - perfectionist/sort-imports: \"error\" (available in antfu's perfectionist config)\n //\n // Code quality:\n // - complexity: [\"error\", 10] - Limit cyclomatic complexity\n // - max-depth: [\"error\", 4] - Limit nesting depth\n // - max-nested-callbacks: [\"error\", 3] - Limit callback nesting\n },\n });\n}\n"],"names":["antfu","radPlguins","eslintPluginNoBarrelFiles"],"mappings":";;;;;;;;;;;;;;AAyBO,MAAM,OAAA,GAAU,CAAC,aAAA,EAAe,YAAA,EAAc,WAAA,EAAa,gBAAgB,gBAAA,EAAkB,OAAA,EAAS,0BAAA,EAA4B,oBAAA,EAAsB,QAAQ;AAEvK,sBAAA,CAAyB,YAAmE,WAAA,EAAsE;AAC9J,EAAA,OAAOA,cAAA;AAAA,IACH;AAAA,MACI,SAAA,EAAW;AAAA,QACP,MAAA,EAAQ,CAAA;AAAA,QACR,MAAA,EAAQ,QAAA;AAAA,QACR,IAAA,EAAM;AAAA,OACV;AAAA,MACA,UAAA,EAAY,EAAE,GAAA,EAAK,IAAA,EAAM,KAAK,KAAA,EAAM;AAAA,MACpC,KAAA,EAAO,KAAA;AAAA,MACP,GAAA,EAAK,KAAA;AAAA,MACL,QAAA,EAAU,KAAA;AAAA;AAAA,MAEV,UAAA,EAAY,IAAA;AAAA,MACZ,OAAA,EAAS,CAAC,GAAG,OAAA,EAAS,GAAI,OAAA,EAAS,OAAA,IAAW,EAAG,CAAA;AAAA;AAAA,MAEjD,KAAA,EAAO,KAAA;AAAA,MACP,IAAA,EAAM,KAAA;AAAA,MACN,GAAA,EAAK,KAAA;AAAA,MACL,GAAG;AAAA,KACP;AAAA,IACA;AAAA,MACI,KAAA,EAAO,CAAC,SAAS,CAAA;AAAA,MACjB,OAAA,EAAS;AAAA,QACL,KAAA,EAAOC,mBAAA;AAAA,QACP,iBAAA,EAAmBC;AAAA,OACvB;AAAA,MACA,KAAA,EAAO;AAAA,QACH,8BAAA,EAAgC,OAAA;AAAA,QAChC,iCAAA,EAAmC;AAAA;AACvC,KACJ;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,MACI,KAA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CJ,GACH,CAAA;AACT;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"eslint.config.mjs","sources":["../src/eslint.config.ts"],"sourcesContent":["/**\n * ESLint Configuration based on @antfu/eslint-config\n *\n * This configuration extends Anthony Fu's ESLint config with custom overrides for:\n * - Stylistic preferences (4-space indent, double quotes, semicolons)\n * - Type safety (strict any prevention)\n * - Flexible code organization (allow declaration merging, hoisting)\n * - Custom plugins (rad rules, no-barrel-files)\n *\n * Structure:\n * 1. Base config with stylistic preferences\n * 2. Custom plugin rules\n * 3. General rule overrides\n * 4. Unicorn plugin overrides\n * 5. Stylistic rule overrides\n * 6. TypeScript rule overrides\n *\n * Reference: https://github.com/antfu/eslint-config\n */\n\nimport radPlguins from \"@adddog/eslint-plugin-rules\";\nimport antfu from \"@antfu/eslint-config\";\n\nimport eslintPluginNoBarrelFiles from \"eslint-plugin-no-barrel-files\";\n\nexport const ignores = [\"**/build/**\", \"**/dist/**\", \"README.md\", \"package.json\", \"**/dev-dist/**\", \"**.js\", \"**.vscode/.settings.json\", \"**/node_modules/**\", \"*.html\"];\n\nexport default function (options?: Parameters<typeof antfu>[0] & { ignores?: string[] }, ...userConfigs: Parameters<typeof antfu>[1][]): ReturnType<typeof antfu> {\n return antfu(\n {\n stylistic: {\n indent: 4,\n quotes: \"double\",\n semi: true,\n },\n formatters: { css: true, xml: false },\n react: false,\n jsx: false,\n markdown: false,\n // TypeScript and Vue are auto-detected, you can also explicitly enable them:\n typescript: true,\n ignores: [...ignores, ...(options?.ignores || [])],\n // Disable jsonc and yaml support\n jsonc: false,\n yaml: false,\n vue: false,\n ...options,\n },\n {\n files: [\"**/*.ts\"],\n plugins: {\n \"rad\": radPlguins,\n \"no-barrel-files\": eslintPluginNoBarrelFiles,\n },\n rules: {\n \"rad/no-incorrect-pkg-imports\": \"error\",\n \"no-barrel-files/no-barrel-files\": \"error\",\n },\n },\n // ========================================\n // General overrides\n // ========================================\n {\n rules: {\n // ---- Core ESLint Rules ----\n\n // max-len: Not part of antfu's config by default (would need separate plugin)\n // Turned off to avoid line length restrictions\n \"max-len\": \"off\",\n\n // curly: Not enforced by default in antfu's config\n // Turned off to allow single-line if statements without braces\n \"curly\": \"off\",\n\n // func-style: Not enforced by default\n // Turned off to allow both function declarations and expressions\n \"func-style\": \"off\",\n\n // antfu/curly: Default \"error\" (enforces curly braces with specific style)\n // Turned off to be less opinionated about brace style\n \"antfu/curly\": \"off\",\n\n // accessor-pairs: Default [\"error\", { enforceForClassMembers: true, setWithoutGet: true }]\n // Turned off to allow getters without corresponding setters\n \"accessor-pairs\": \"off\",\n\n // antfu/if-newline: Default \"error\" (enforces newline after if statement)\n // Turned off for more flexible if statement formatting\n \"antfu/if-newline\": \"off\",\n\n // antfu/consistent-list-newline: Default \"error\" (enforces consistent newlines in arrays/objects)\n // Turned off to allow mixed single-line and multi-line arrays/objects\n \"antfu/consistent-list-newline\": \"off\",\n\n // ---- TypeScript Rules ----\n\n // ts/consistent-type-definitions: Default [\"error\", \"interface\"]\n // Turned off to allow both \"interface\" and \"type\" for type definitions\n \"ts/consistent-type-definitions\": \"off\",\n\n // ts/no-redeclare: Default [\"error\", { builtinGlobals: false }]\n // Turned off to allow declaration merging (interfaces, namespaces)\n \"ts/no-redeclare\": \"off\",\n\n // ts/no-unused-expressions: Default [\"error\", { allowShortCircuit: true, allowTaggedTemplates: true, allowTernary: true }]\n // Turned off to allow expressions like optional chaining that may not have side effects\n \"ts/no-unused-expressions\": \"off\",\n\n // ts/no-explicit-any: Default \"off\" in antfu's config\n // Set to \"error\" to enforce strict typing and prevent use of \"any\"\n \"ts/no-explicit-any\": \"error\",\n\n // prefer-arrow-callback: Default [\"error\", { allowNamedFunctions: false, allowUnboundThis: true }]\n // Modified to allow named function expressions in callbacks for better stack traces\n \"prefer-arrow-callback\": [\n \"error\",\n {\n allowNamedFunctions: true, // Changed from false\n allowUnboundThis: true,\n },\n ],\n },\n },\n ...userConfigs,\n )\n // ========================================\n // Unicorn plugin overrides\n // ========================================\n .override(\"antfu/unicorn/rules\", {\n rules: {\n // unicorn/no-new-array: Default \"error\" (enforces array literals over new Array())\n // Turned off to allow new Array(length) for creating arrays with specific length\n \"unicorn/no-new-array\": \"off\",\n\n // Other unicorn rules enabled by default in antfu's config (for reference):\n // - unicorn/consistent-empty-array-spread: \"error\"\n // - unicorn/error-message: \"error\" (require error messages)\n // - unicorn/escape-case: \"error\" (enforce uppercase hex escapes)\n // - unicorn/new-for-builtins: \"error\" (enforce new for builtins)\n // - unicorn/no-instanceof-builtins: \"error\"\n // - unicorn/no-new-buffer: \"error\" (use Buffer.from/Buffer.alloc)\n // - unicorn/number-literal-case: \"error\" (enforce lowercase for number literals)\n // - unicorn/prefer-dom-node-text-content: \"error\"\n // - unicorn/prefer-includes: \"error\" (prefer includes over indexOf)\n // - unicorn/prefer-node-protocol: \"error\" (enforce node: protocol)\n // - unicorn/prefer-number-properties: \"error\" (prefer Number.isNaN over isNaN)\n // - unicorn/prefer-string-starts-ends-with: \"error\"\n // - unicorn/prefer-type-error: \"error\"\n // - unicorn/throw-new-error: \"error\" (require new when throwing errors)\n },\n })\n // ========================================\n // Stylistic overrides\n // ========================================\n .override(\"antfu/stylistic/rules\", {\n rules: {\n // antfu/top-level-function: Default \"error\" (enforces function declarations at top level)\n // Reference: https://github.com/antfu/eslint-config/blob/main/src/configs/stylistic.ts#L61\n // Turned off to allow const/arrow functions at top level\n \"antfu/top-level-function\": \"off\",\n\n // style/arrow-parens: Default depends on stylistic config\n // Set to \"as-needed\" to only require parens when necessary (multiple params, etc)\n \"style/arrow-parens\": [\"error\", \"as-needed\"],\n\n // style/operator-linebreak: Default enforces operators at end/beginning of line\n // Turned off for flexible operator placement in multi-line expressions\n \"style/operator-linebreak\": \"off\",\n\n // style/array-element-newline: Default \"off\" in antfu's config\n // Reference: https://eslint.style/rules/default/array-element-newline\n // Kept off because it causes issues with large objects in arrays\n \"style/array-element-newline\": \"off\",\n\n // style/max-statements-per-line: Default { max: 1 }\n // Increased to 2 to allow simple statements on same line (e.g., case statements)\n \"style/max-statements-per-line\": [\"error\", {\n max: 2,\n }],\n\n // style/function-call-argument-newline: Default varies\n // Set to \"consistent\" so all arguments are either inline or one-per-line\n \"style/function-call-argument-newline\": [\"error\", \"consistent\"],\n\n // style/brace-style: Default depends on stylistic preset\n // Set to \"1tbs\" (one true brace style) with single-line exception\n \"style/brace-style\": [\"error\", \"1tbs\", {\n allowSingleLine: true,\n }],\n\n // Other notable stylistic rules from antfu's config (using your custom config):\n // - indent: 4 (default: 2)\n // - quotes: \"double\" (default: \"single\")\n // - semi: true (default: false)\n // - style/generator-star-spacing: [\"error\", { after: true, before: false }]\n // - style/yield-star-spacing: [\"error\", { after: true, before: false }]\n // - antfu/consistent-chaining: \"error\" (enforces consistent chaining style)\n },\n })\n // ========================================\n // TypeScript-specific overrides\n // ========================================\n // Rules are scoped to names\n // Reference: https://github.com/antfu/eslint-config/blob/93c9e772faf45295a4deb2633a4655954da74491/src/configs/typescript.ts#L110\n .override(\"antfu/typescript/rules\", {\n rules: {\n // ts/no-use-before-define: Default [\"error\", { classes: false, functions: false, variables: true }]\n // Turned off to allow hoisting and more flexible declaration order\n \"ts/no-use-before-define\": \"off\",\n\n // ts/no-unsafe-declaration-merging: Default not explicitly set (likely \"error\")\n // Turned off to allow declaration merging patterns (e.g., interface + namespace)\n \"ts/no-unsafe-declaration-merging\": \"off\",\n\n // no-redeclare: Default [\"error\", { builtinGlobals: false }]\n // Turned off in favor of TypeScript's own redeclaration checks\n \"no-redeclare\": \"off\",\n\n // ts/no-redeclare: Default [\"error\", { builtinGlobals: false }]\n // Turned off to allow declaration merging (same as general overrides)\n \"ts/no-redeclare\": \"off\",\n\n // ts/no-explicit-any: Default \"off\" in antfu's config\n // Set to \"error\" to enforce strict typing and prevent use of \"any\"\n // This is a critical rule for type safety\n \"ts/no-explicit-any\": \"error\",\n\n // ts/unified-signatures: Default \"off\" in antfu's config\n // Set to \"error\" to enforce combining overloaded signatures where possible\n \"ts/unified-signatures\": \"error\",\n\n // ts/no-unused-vars: Default \"off\" in antfu's typescript config (handled by unused-imports plugin)\n // Reference: https://johnnyreilly.com/typescript-eslint-no-unused-vars\n // Configured with strict underscore-prefix ignore pattern for intentionally unused variables\n \"ts/no-unused-vars\": [\n \"error\",\n {\n args: \"all\", // Check all arguments (default: \"after-used\")\n argsIgnorePattern: \"^_\", // Allow _unused arguments\n caughtErrors: \"all\", // Check caught errors (default: \"none\")\n caughtErrorsIgnorePattern: \"^_\", // Allow _error in catch blocks\n destructuredArrayIgnorePattern: \"^_\", // Allow [_skip, value] patterns\n varsIgnorePattern: \"^_\", // Allow _unusedVar\n ignoreRestSiblings: true, // Allow const { removed, ...rest } patterns\n },\n ],\n\n // Other important TypeScript rules from antfu's config (for reference):\n // - ts/ban-ts-comment: [\"error\", { \"ts-expect-error\": \"allow-with-description\" }]\n // - ts/consistent-type-definitions: [\"error\", \"interface\"] (you override to \"off\")\n // - ts/consistent-type-imports: [\"error\", { disallowTypeAnnotations: false, fixStyle: \"separate-type-imports\", prefer: \"type-imports\" }]\n // - ts/method-signature-style: [\"error\", \"property\"] (prefer property syntax)\n // - ts/no-dupe-class-members: \"error\"\n // - ts/no-dynamic-delete: \"off\"\n // - ts/no-empty-object-type: [\"error\", { allowInterfaces: \"always\" }]\n // - ts/no-import-type-side-effects: \"error\"\n // - ts/no-invalid-void-type: \"off\"\n // - ts/no-non-null-assertion: \"off\"\n // - ts/no-require-imports: \"error\"\n // - ts/no-unused-expressions: [\"error\", { allowShortCircuit: true, allowTaggedTemplates: true, allowTernary: true }]\n // - ts/no-useless-constructor: \"off\"\n // - ts/no-wrapper-object-types: \"error\"\n // - ts/triple-slash-reference: \"off\"\n\n // ========================================\n // Notable rules you might want to consider:\n // ========================================\n //\n // Type-aware rules (require tsconfigPath):\n // - ts/await-thenable: \"error\" - Only await thenables\n // - ts/no-floating-promises: \"error\" - Promises must be handled\n // - ts/no-misused-promises: \"error\" - Prevent common promise mistakes\n // - ts/no-unnecessary-type-assertion: \"error\" - Remove redundant assertions\n // - ts/no-unsafe-argument: \"error\" - Prevent any in function arguments\n // - ts/no-unsafe-assignment: \"error\" - Prevent assigning any to typed variables\n // - ts/no-unsafe-call: \"error\" - Prevent calling any as function\n // - ts/no-unsafe-member-access: \"error\" - Prevent accessing properties of any\n // - ts/no-unsafe-return: \"error\" - Prevent returning any from typed functions\n // - ts/strict-boolean-expressions: \"error\" - Strict boolean checks in conditions\n // - ts/switch-exhaustiveness-check: \"error\" - Ensure all cases handled in switch\n //\n // Naming conventions:\n // - ts/naming-convention: Configure consistent naming patterns\n //\n // Import organization:\n // - ts/consistent-type-imports: [\"error\", { prefer: \"type-imports\" }] (already enabled in antfu)\n // - perfectionist/sort-imports: \"error\" (available in antfu's perfectionist config)\n //\n // Code quality:\n // - complexity: [\"error\", 10] - Limit cyclomatic complexity\n // - max-depth: [\"error\", 4] - Limit nesting depth\n // - max-nested-callbacks: [\"error\", 3] - Limit callback nesting\n },\n });\n}\n"],"names":[],"mappings":";;;;AAyBO,MAAM,OAAA,GAAU,CAAC,aAAA,EAAe,YAAA,EAAc,WAAA,EAAa,gBAAgB,gBAAA,EAAkB,OAAA,EAAS,0BAAA,EAA4B,oBAAA,EAAsB,QAAQ;AAEvK,sBAAA,CAAyB,YAAmE,WAAA,EAAsE;AAC9J,EAAA,OAAO,KAAA;AAAA,IACH;AAAA,MACI,SAAA,EAAW;AAAA,QACP,MAAA,EAAQ,CAAA;AAAA,QACR,MAAA,EAAQ,QAAA;AAAA,QACR,IAAA,EAAM;AAAA,OACV;AAAA,MACA,UAAA,EAAY,EAAE,GAAA,EAAK,IAAA,EAAM,KAAK,KAAA,EAAM;AAAA,MACpC,KAAA,EAAO,KAAA;AAAA,MACP,GAAA,EAAK,KAAA;AAAA,MACL,QAAA,EAAU,KAAA;AAAA;AAAA,MAEV,UAAA,EAAY,IAAA;AAAA,MACZ,OAAA,EAAS,CAAC,GAAG,OAAA,EAAS,GAAI,OAAA,EAAS,OAA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