@venizia/dev-configs 0.4.2 → 0.4.4

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.
Files changed (106) hide show
  1. package/LICENSE.md +2 -5
  2. package/README.md +20 -5
  3. package/dist/checks/catalog.d.ts +39 -0
  4. package/dist/checks/catalog.d.ts.map +1 -0
  5. package/dist/checks/catalog.js +94 -0
  6. package/dist/checks/catalog.js.map +1 -0
  7. package/dist/checks/index.d.ts +11 -0
  8. package/dist/checks/index.d.ts.map +1 -0
  9. package/dist/checks/index.js +27 -0
  10. package/dist/checks/index.js.map +1 -0
  11. package/dist/checks/module-cycles.d.ts +22 -0
  12. package/dist/checks/module-cycles.d.ts.map +1 -0
  13. package/dist/checks/module-cycles.js +149 -0
  14. package/dist/checks/module-cycles.js.map +1 -0
  15. package/dist/checks/purity/manifest.d.ts +94 -0
  16. package/dist/checks/purity/manifest.d.ts.map +1 -0
  17. package/dist/checks/purity/manifest.js +177 -0
  18. package/dist/checks/purity/manifest.js.map +1 -0
  19. package/dist/checks/purity/probe.d.ts +68 -0
  20. package/dist/checks/purity/probe.d.ts.map +1 -0
  21. package/dist/checks/purity/probe.js +295 -0
  22. package/dist/checks/purity/probe.js.map +1 -0
  23. package/dist/checks/purity/run.d.ts +47 -0
  24. package/dist/checks/purity/run.d.ts.map +1 -0
  25. package/dist/checks/purity/run.js +121 -0
  26. package/dist/checks/purity/run.js.map +1 -0
  27. package/dist/checks/split-report.d.ts +19 -0
  28. package/dist/checks/split-report.d.ts.map +1 -0
  29. package/dist/checks/split-report.js +123 -0
  30. package/dist/checks/split-report.js.map +1 -0
  31. package/dist/cli/check.d.ts +10 -0
  32. package/dist/cli/check.d.ts.map +1 -0
  33. package/dist/cli/check.js +206 -0
  34. package/dist/cli/check.js.map +1 -0
  35. package/dist/cli/clean.d.ts +2 -1
  36. package/dist/cli/clean.d.ts.map +1 -1
  37. package/dist/cli/clean.js +18 -1
  38. package/dist/cli/clean.js.map +1 -1
  39. package/dist/cli/codemod/const-classes.d.ts +80 -0
  40. package/dist/cli/codemod/const-classes.d.ts.map +1 -0
  41. package/dist/cli/codemod/const-classes.js +603 -0
  42. package/dist/cli/codemod/const-classes.js.map +1 -0
  43. package/dist/cli/codemod/drop-redundant-casts.d.ts +112 -0
  44. package/dist/cli/codemod/drop-redundant-casts.d.ts.map +1 -0
  45. package/dist/cli/codemod/drop-redundant-casts.js +780 -0
  46. package/dist/cli/codemod/drop-redundant-casts.js.map +1 -0
  47. package/dist/cli/codemod/files.d.ts +22 -0
  48. package/dist/cli/codemod/files.d.ts.map +1 -0
  49. package/dist/cli/codemod/files.js +68 -0
  50. package/dist/cli/codemod/files.js.map +1 -0
  51. package/dist/cli/codemod/index.d.ts +5 -4
  52. package/dist/cli/codemod/index.d.ts.map +1 -1
  53. package/dist/cli/codemod/index.js +77 -36
  54. package/dist/cli/codemod/index.js.map +1 -1
  55. package/dist/cli/codemod/model-settings.d.ts +2 -1
  56. package/dist/cli/codemod/model-settings.d.ts.map +1 -1
  57. package/dist/cli/codemod/model-settings.js +77 -3
  58. package/dist/cli/codemod/model-settings.js.map +1 -1
  59. package/dist/cli/index.js +21 -2
  60. package/dist/cli/index.js.map +1 -1
  61. package/dist/linters/house/common.d.ts +1 -0
  62. package/dist/linters/house/common.d.ts.map +1 -1
  63. package/dist/linters/house/common.js +1 -0
  64. package/dist/linters/house/common.js.map +1 -1
  65. package/dist/linters/house/configs.d.ts.map +1 -1
  66. package/dist/linters/house/configs.js +20 -1
  67. package/dist/linters/house/configs.js.map +1 -1
  68. package/dist/linters/house/const-class-values.rule.d.ts +7 -4
  69. package/dist/linters/house/const-class-values.rule.d.ts.map +1 -1
  70. package/dist/linters/house/const-class-values.rule.js +73 -21
  71. package/dist/linters/house/const-class-values.rule.js.map +1 -1
  72. package/dist/linters/rules/common.d.ts +48 -1
  73. package/dist/linters/rules/common.d.ts.map +1 -1
  74. package/dist/linters/rules/common.js +53 -0
  75. package/dist/linters/rules/common.js.map +1 -1
  76. package/dist/linters/rules/eqeqeq.rule.d.ts +2 -2
  77. package/dist/linters/rules/eqeqeq.rule.d.ts.map +1 -1
  78. package/dist/linters/rules/eqeqeq.rule.js +2 -1
  79. package/dist/linters/rules/eqeqeq.rule.js.map +1 -1
  80. package/dist/linters/rules/no-unused-vars.rule.d.ts +3 -3
  81. package/dist/linters/rules/no-unused-vars.rule.d.ts.map +1 -1
  82. package/dist/linters/rules/no-unused-vars.rule.js +2 -1
  83. package/dist/linters/rules/no-unused-vars.rule.js.map +1 -1
  84. package/dist/linters/rules/switch-case-braces.rule.d.ts +2 -2
  85. package/dist/linters/rules/switch-case-braces.rule.d.ts.map +1 -1
  86. package/dist/linters/rules/switch-case-braces.rule.js +2 -1
  87. package/dist/linters/rules/switch-case-braces.rule.js.map +1 -1
  88. package/dist/testing/index.d.ts +2 -0
  89. package/dist/testing/index.d.ts.map +1 -1
  90. package/dist/testing/index.js +2 -0
  91. package/dist/testing/index.js.map +1 -1
  92. package/dist/testing/repo-tmp.d.ts +12 -0
  93. package/dist/testing/repo-tmp.d.ts.map +1 -0
  94. package/dist/testing/repo-tmp.js +67 -0
  95. package/dist/testing/repo-tmp.js.map +1 -0
  96. package/dist/testing/spawn.helper.d.ts +13 -0
  97. package/dist/testing/spawn.helper.d.ts.map +1 -0
  98. package/dist/testing/spawn.helper.js +22 -0
  99. package/dist/testing/spawn.helper.js.map +1 -0
  100. package/dist/testing/tmpdir-preload.d.ts +2 -0
  101. package/dist/testing/tmpdir-preload.d.ts.map +1 -0
  102. package/dist/testing/tmpdir-preload.js +9 -0
  103. package/dist/testing/tmpdir-preload.js.map +1 -0
  104. package/package.json +9 -1
  105. package/src/tsconfig/tsconfig.base.json +5 -2
  106. package/src/tsconfig/tsconfig.common.json +2 -2
@@ -1,3 +1,56 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SwitchCaseBracesModes = exports.UnusedArgsModes = exports.UnusedVarsScopes = exports.EqeqeqModes = exports.RuleSeverities = void 0;
4
+ /** A rule's severity, as both oxlint and ESLint accept it. */
5
+ class RuleSeverities {
6
+ static { this.OFF = 'off'; }
7
+ static { this.WARN = 'warn'; }
8
+ static { this.ERROR = 'error'; }
9
+ static { this.SCHEME_SET = new Set([this.OFF, this.WARN, this.ERROR]); }
10
+ static isValid(value) {
11
+ return this.SCHEME_SET.has(value);
12
+ }
13
+ }
14
+ exports.RuleSeverities = RuleSeverities;
15
+ /** `eqeqeq` modes: ALWAYS wants `===` everywhere, SMART still allows `== null` and comparing two literals. */
16
+ class EqeqeqModes {
17
+ static { this.ALWAYS = 'always'; }
18
+ static { this.SMART = 'smart'; }
19
+ static { this.SCHEME_SET = new Set([this.ALWAYS, this.SMART]); }
20
+ static isValid(value) {
21
+ return this.SCHEME_SET.has(value);
22
+ }
23
+ }
24
+ exports.EqeqeqModes = EqeqeqModes;
25
+ /** `no-unused-vars` `vars`: ALL checks globals too, LOCAL only the variables of the file. */
26
+ class UnusedVarsScopes {
27
+ static { this.ALL = 'all'; }
28
+ static { this.LOCAL = 'local'; }
29
+ static { this.SCHEME_SET = new Set([this.ALL, this.LOCAL]); }
30
+ static isValid(value) {
31
+ return this.SCHEME_SET.has(value);
32
+ }
33
+ }
34
+ exports.UnusedVarsScopes = UnusedVarsScopes;
35
+ /** `no-unused-vars` `args`: ALL checks every argument, AFTER_USED those after the last used one, NONE no argument. */
36
+ class UnusedArgsModes {
37
+ static { this.ALL = 'all'; }
38
+ static { this.AFTER_USED = 'after-used'; }
39
+ static { this.NONE = 'none'; }
40
+ static { this.SCHEME_SET = new Set([this.ALL, this.AFTER_USED, this.NONE]); }
41
+ static isValid(value) {
42
+ return this.SCHEME_SET.has(value);
43
+ }
44
+ }
45
+ exports.UnusedArgsModes = UnusedArgsModes;
46
+ /** `switch-case-braces` modes: ALWAYS gives every case its own block, AVOID drops braces that hold nothing that needs a scope. */
47
+ class SwitchCaseBracesModes {
48
+ static { this.ALWAYS = 'always'; }
49
+ static { this.AVOID = 'avoid'; }
50
+ static { this.SCHEME_SET = new Set([this.ALWAYS, this.AVOID]); }
51
+ static isValid(value) {
52
+ return this.SCHEME_SET.has(value);
53
+ }
54
+ }
55
+ exports.SwitchCaseBracesModes = SwitchCaseBracesModes;
3
56
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/linters/rules/common.ts"],"names":[],"mappings":"","sourcesContent":["import type { OxlintConfig } from 'oxlint';\n\n/** A rule's severity, as both oxlint and ESLint accept it. */\nexport type TRuleSeverity = 'off' | 'warn' | 'error';\n\n/** The entry oxlint's own types allow for rule `TName`, options included. */\nexport type TOxlintRuleEntry<TName extends string> = NonNullable<\n NonNullable<OxlintConfig['rules']>[TName]\n>;\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/linters/rules/common.ts"],"names":[],"mappings":";;;AAKA,8DAA8D;AAC9D,MAAa,cAAc;aACT,QAAG,GAAG,KAAK,CAAC;aACZ,SAAI,GAAG,MAAM,CAAC;aACd,UAAK,GAAG,OAAO,CAAC;aAEhB,eAAU,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAEhF,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AATH,wCAUC;AAKD,8GAA8G;AAC9G,MAAa,WAAW;aACN,WAAM,GAAG,QAAQ,CAAC;aAClB,UAAK,GAAG,OAAO,CAAC;aAEhB,eAAU,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAExE,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AARH,kCASC;AAKD,6FAA6F;AAC7F,MAAa,gBAAgB;aACX,QAAG,GAAG,KAAK,CAAC;aACZ,UAAK,GAAG,OAAO,CAAC;aAEhB,eAAU,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAErE,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AARH,4CASC;AAKD,sHAAsH;AACtH,MAAa,eAAe;aACV,QAAG,GAAG,KAAK,CAAC;aACZ,eAAU,GAAG,YAAY,CAAC;aAC1B,SAAI,GAAG,MAAM,CAAC;aAEd,eAAU,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAErF,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AATH,0CAUC;AAKD,kIAAkI;AAClI,MAAa,qBAAqB;aAChB,WAAM,GAAG,QAAQ,CAAC;aAClB,UAAK,GAAG,OAAO,CAAC;aAEhB,eAAU,GAAG,IAAI,GAAG,CAAS,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAExE,MAAM,CAAC,OAAO,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;;AARH,sDASC","sourcesContent":["import type { OxlintConfig } from 'oxlint';\n\n/** The string values of a const class: its static members that are strings, as literal types. */\nexport type TConstValue<T> = Extract<T[keyof T], string> & {};\n\n/** A rule's severity, as both oxlint and ESLint accept it. */\nexport class RuleSeverities {\n static readonly OFF = 'off';\n static readonly WARN = 'warn';\n static readonly ERROR = 'error';\n\n static readonly SCHEME_SET = new Set<string>([this.OFF, this.WARN, this.ERROR]);\n\n static isValid(value: string): value is TRuleSeverity {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** Valid rule severity values. */\nexport type TRuleSeverity = TConstValue<typeof RuleSeverities>;\n\n/** `eqeqeq` modes: ALWAYS wants `===` everywhere, SMART still allows `== null` and comparing two literals. */\nexport class EqeqeqModes {\n static readonly ALWAYS = 'always';\n static readonly SMART = 'smart';\n\n static readonly SCHEME_SET = new Set<string>([this.ALWAYS, this.SMART]);\n\n static isValid(value: string): value is TEqeqeqMode {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** Valid eqeqeq mode values. */\nexport type TEqeqeqMode = TConstValue<typeof EqeqeqModes>;\n\n/** `no-unused-vars` `vars`: ALL checks globals too, LOCAL only the variables of the file. */\nexport class UnusedVarsScopes {\n static readonly ALL = 'all';\n static readonly LOCAL = 'local';\n\n static readonly SCHEME_SET = new Set<string>([this.ALL, this.LOCAL]);\n\n static isValid(value: string): value is TUnusedVarsScope {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** Valid unused vars scope values. */\nexport type TUnusedVarsScope = TConstValue<typeof UnusedVarsScopes>;\n\n/** `no-unused-vars` `args`: ALL checks every argument, AFTER_USED those after the last used one, NONE no argument. */\nexport class UnusedArgsModes {\n static readonly ALL = 'all';\n static readonly AFTER_USED = 'after-used';\n static readonly NONE = 'none';\n\n static readonly SCHEME_SET = new Set<string>([this.ALL, this.AFTER_USED, this.NONE]);\n\n static isValid(value: string): value is TUnusedArgsMode {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** Valid unused args mode values. */\nexport type TUnusedArgsMode = TConstValue<typeof UnusedArgsModes>;\n\n/** `switch-case-braces` modes: ALWAYS gives every case its own block, AVOID drops braces that hold nothing that needs a scope. */\nexport class SwitchCaseBracesModes {\n static readonly ALWAYS = 'always';\n static readonly AVOID = 'avoid';\n\n static readonly SCHEME_SET = new Set<string>([this.ALWAYS, this.AVOID]);\n\n static isValid(value: string): value is TSwitchCaseBracesMode {\n return this.SCHEME_SET.has(value);\n }\n}\n\n/** Valid switch case braces mode values. */\nexport type TSwitchCaseBracesMode = TConstValue<typeof SwitchCaseBracesModes>;\n\n/** The entry oxlint's own types allow for rule `TName`, options included. */\nexport type TOxlintRuleEntry<TName extends string> = NonNullable<\n NonNullable<OxlintConfig['rules']>[TName]\n>;\n"]}
@@ -1,10 +1,10 @@
1
- import type { TOxlintRuleEntry, TRuleSeverity } from './common';
1
+ import { type TEqeqeqMode, type TOxlintRuleEntry, type TRuleSeverity } from './common';
2
2
  /** `eqeqeq`. `smart` still allows `== null` and comparing two literals. */
3
3
  export declare class EqeqeqRule {
4
4
  static readonly NAME = "eqeqeq";
5
5
  static build(opts?: {
6
6
  severity?: TRuleSeverity;
7
- mode?: 'always' | 'smart';
7
+ mode?: TEqeqeqMode;
8
8
  }): TOxlintRuleEntry<'eqeqeq'>;
9
9
  }
10
10
  //# sourceMappingURL=eqeqeq.rule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eqeqeq.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/eqeqeq.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhE,2EAA2E;AAC3E,qBAAa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,IAAI,YAAY;IAEhC,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;KAAO,GACjE,gBAAgB,CAAC,QAAQ,CAAC;CAI9B"}
1
+ {"version":3,"file":"eqeqeq.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/eqeqeq.rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAEpG,2EAA2E;AAC3E,qBAAa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,IAAI,YAAY;IAEhC,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAC,IAAI,CAAC,EAAE,WAAW,CAAA;KAAO,GAC1D,gBAAgB,CAAC,QAAQ,CAAC;CAI9B"}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EqeqeqRule = void 0;
4
+ const common_1 = require("./common");
4
5
  /** `eqeqeq`. `smart` still allows `== null` and comparing two literals. */
5
6
  class EqeqeqRule {
6
7
  static { this.NAME = 'eqeqeq'; }
7
8
  static build(opts = {}) {
8
- const { severity = 'error', mode = 'smart' } = opts;
9
+ const { severity = 'error', mode = common_1.EqeqeqModes.SMART } = opts;
9
10
  return [severity, mode];
10
11
  }
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"eqeqeq.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/eqeqeq.rule.ts"],"names":[],"mappings":";;;AAEA,2EAA2E;AAC3E,MAAa,UAAU;aACL,SAAI,GAAG,QAAQ,CAAC;IAEhC,MAAM,CAAC,KAAK,CACV,OAAgE,EAAE;QAElE,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,IAAI,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;QACpD,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;;AARH,gCASC","sourcesContent":["import type { TOxlintRuleEntry, TRuleSeverity } from './common';\n\n/** `eqeqeq`. `smart` still allows `== null` and comparing two literals. */\nexport class EqeqeqRule {\n static readonly NAME = 'eqeqeq';\n\n static build(\n opts: { severity?: TRuleSeverity; mode?: 'always' | 'smart' } = {},\n ): TOxlintRuleEntry<'eqeqeq'> {\n const { severity = 'error', mode = 'smart' } = opts;\n return [severity, mode];\n }\n}\n"]}
1
+ {"version":3,"file":"eqeqeq.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/eqeqeq.rule.ts"],"names":[],"mappings":";;;AAAA,qCAAoG;AAEpG,2EAA2E;AAC3E,MAAa,UAAU;aACL,SAAI,GAAG,QAAQ,CAAC;IAEhC,MAAM,CAAC,KAAK,CACV,OAAyD,EAAE;QAE3D,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,IAAI,GAAG,oBAAW,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC;QAC9D,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;;AARH,gCASC","sourcesContent":["import { EqeqeqModes, type TEqeqeqMode, type TOxlintRuleEntry, type TRuleSeverity } from './common';\n\n/** `eqeqeq`. `smart` still allows `== null` and comparing two literals. */\nexport class EqeqeqRule {\n static readonly NAME = 'eqeqeq';\n\n static build(\n opts: { severity?: TRuleSeverity; mode?: TEqeqeqMode } = {},\n ): TOxlintRuleEntry<'eqeqeq'> {\n const { severity = 'error', mode = EqeqeqModes.SMART } = opts;\n return [severity, mode];\n }\n}\n"]}
@@ -1,11 +1,11 @@
1
- import type { TOxlintRuleEntry, TRuleSeverity } from './common';
1
+ import { type TOxlintRuleEntry, type TRuleSeverity, type TUnusedArgsMode, type TUnusedVarsScope } from './common';
2
2
  /** `no-unused-vars`. Unused arguments pass by default: an override keeps its signature. A `_name` variable is an omitted value (`{ page: _page, ...rest }`) and passes too. */
3
3
  export declare class NoUnusedVarsRule {
4
4
  static readonly NAME = "no-unused-vars";
5
5
  static build(opts?: {
6
6
  severity?: TRuleSeverity;
7
- vars?: 'all' | 'local';
8
- args?: 'all' | 'after-used' | 'none';
7
+ vars?: TUnusedVarsScope;
8
+ args?: TUnusedArgsMode;
9
9
  ignoreRestSiblings?: boolean;
10
10
  /** Names that may stay unused, e.g. `^_` - a placeholder a signature needs. */
11
11
  argsIgnorePattern?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"no-unused-vars.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/no-unused-vars.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhE,+KAA+K;AAC/K,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,IAAI,oBAAoB;IAExC,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QACJ,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC;QACrC,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,+EAA+E;QAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,yBAAyB,CAAC,EAAE,MAAM,CAAC;QACnC,8BAA8B,CAAC,EAAE,MAAM,CAAC;KACpC,GACL,gBAAgB,CAAC,gBAAgB,CAAC;CAWtC"}
1
+ {"version":3,"file":"no-unused-vars.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/no-unused-vars.rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAElB,+KAA+K;AAC/K,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,IAAI,oBAAoB;IAExC,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QACJ,QAAQ,CAAC,EAAE,aAAa,CAAC;QACzB,IAAI,CAAC,EAAE,gBAAgB,CAAC;QACxB,IAAI,CAAC,EAAE,eAAe,CAAC;QACvB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,+EAA+E;QAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,yBAAyB,CAAC,EAAE,MAAM,CAAC;QACnC,8BAA8B,CAAC,EAAE,MAAM,CAAC;KACpC,GACL,gBAAgB,CAAC,gBAAgB,CAAC;CAWtC"}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NoUnusedVarsRule = void 0;
4
+ const common_1 = require("./common");
4
5
  /** `no-unused-vars`. Unused arguments pass by default: an override keeps its signature. A `_name` variable is an omitted value (`{ page: _page, ...rest }`) and passes too. */
5
6
  class NoUnusedVarsRule {
6
7
  static { this.NAME = 'no-unused-vars'; }
7
8
  static build(opts = {}) {
8
- const { severity = 'error', vars = 'all', args = 'none', ignoreRestSiblings = false, varsIgnorePattern = '^_', ...patterns } = opts;
9
+ const { severity = 'error', vars = common_1.UnusedVarsScopes.ALL, args = common_1.UnusedArgsModes.NONE, ignoreRestSiblings = false, varsIgnorePattern = '^_', ...patterns } = opts;
9
10
  return [severity, { vars, args, ignoreRestSiblings, varsIgnorePattern, ...patterns }];
10
11
  }
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"no-unused-vars.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/no-unused-vars.rule.ts"],"names":[],"mappings":";;;AAEA,+KAA+K;AAC/K,MAAa,gBAAgB;aACX,SAAI,GAAG,gBAAgB,CAAC;IAExC,MAAM,CAAC,KAAK,CACV,OAUI,EAAE;QAEN,MAAM,EACJ,QAAQ,GAAG,OAAO,EAClB,IAAI,GAAG,KAAK,EACZ,IAAI,GAAG,MAAM,EACb,kBAAkB,GAAG,KAAK,EAC1B,iBAAiB,GAAG,IAAI,EACxB,GAAG,QAAQ,EACZ,GAAG,IAAI,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;IACxF,CAAC;;AAzBH,4CA0BC","sourcesContent":["import type { TOxlintRuleEntry, TRuleSeverity } from './common';\n\n/** `no-unused-vars`. Unused arguments pass by default: an override keeps its signature. A `_name` variable is an omitted value (`{ page: _page, ...rest }`) and passes too. */\nexport class NoUnusedVarsRule {\n static readonly NAME = 'no-unused-vars';\n\n static build(\n opts: {\n severity?: TRuleSeverity;\n vars?: 'all' | 'local';\n args?: 'all' | 'after-used' | 'none';\n ignoreRestSiblings?: boolean;\n /** Names that may stay unused, e.g. `^_` - a placeholder a signature needs. */\n argsIgnorePattern?: string;\n varsIgnorePattern?: string;\n caughtErrorsIgnorePattern?: string;\n destructuredArrayIgnorePattern?: string;\n } = {},\n ): TOxlintRuleEntry<'no-unused-vars'> {\n const {\n severity = 'error',\n vars = 'all',\n args = 'none',\n ignoreRestSiblings = false,\n varsIgnorePattern = '^_',\n ...patterns\n } = opts;\n return [severity, { vars, args, ignoreRestSiblings, varsIgnorePattern, ...patterns }];\n }\n}\n"]}
1
+ {"version":3,"file":"no-unused-vars.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/no-unused-vars.rule.ts"],"names":[],"mappings":";;;AAAA,qCAOkB;AAElB,+KAA+K;AAC/K,MAAa,gBAAgB;aACX,SAAI,GAAG,gBAAgB,CAAC;IAExC,MAAM,CAAC,KAAK,CACV,OAUI,EAAE;QAEN,MAAM,EACJ,QAAQ,GAAG,OAAO,EAClB,IAAI,GAAG,yBAAgB,CAAC,GAAG,EAC3B,IAAI,GAAG,wBAAe,CAAC,IAAI,EAC3B,kBAAkB,GAAG,KAAK,EAC1B,iBAAiB,GAAG,IAAI,EACxB,GAAG,QAAQ,EACZ,GAAG,IAAI,CAAC;QACT,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;IACxF,CAAC;;AAzBH,4CA0BC","sourcesContent":["import {\n UnusedArgsModes,\n UnusedVarsScopes,\n type TOxlintRuleEntry,\n type TRuleSeverity,\n type TUnusedArgsMode,\n type TUnusedVarsScope,\n} from './common';\n\n/** `no-unused-vars`. Unused arguments pass by default: an override keeps its signature. A `_name` variable is an omitted value (`{ page: _page, ...rest }`) and passes too. */\nexport class NoUnusedVarsRule {\n static readonly NAME = 'no-unused-vars';\n\n static build(\n opts: {\n severity?: TRuleSeverity;\n vars?: TUnusedVarsScope;\n args?: TUnusedArgsMode;\n ignoreRestSiblings?: boolean;\n /** Names that may stay unused, e.g. `^_` - a placeholder a signature needs. */\n argsIgnorePattern?: string;\n varsIgnorePattern?: string;\n caughtErrorsIgnorePattern?: string;\n destructuredArrayIgnorePattern?: string;\n } = {},\n ): TOxlintRuleEntry<'no-unused-vars'> {\n const {\n severity = 'error',\n vars = UnusedVarsScopes.ALL,\n args = UnusedArgsModes.NONE,\n ignoreRestSiblings = false,\n varsIgnorePattern = '^_',\n ...patterns\n } = opts;\n return [severity, { vars, args, ignoreRestSiblings, varsIgnorePattern, ...patterns }];\n }\n}\n"]}
@@ -1,10 +1,10 @@
1
- import type { TOxlintRuleEntry, TRuleSeverity } from './common';
1
+ import { type TOxlintRuleEntry, type TRuleSeverity, type TSwitchCaseBracesMode } from './common';
2
2
  /** `unicorn/switch-case-braces`. `always` gives every case its own block scope. */
3
3
  export declare class SwitchCaseBracesRule {
4
4
  static readonly NAME = "unicorn/switch-case-braces";
5
5
  static build(opts?: {
6
6
  severity?: TRuleSeverity;
7
- mode?: 'always' | 'avoid';
7
+ mode?: TSwitchCaseBracesMode;
8
8
  }): TOxlintRuleEntry<'unicorn/switch-case-braces'>;
9
9
  }
10
10
  //# sourceMappingURL=switch-case-braces.rule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch-case-braces.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/switch-case-braces.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhE,mFAAmF;AACnF,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,QAAQ,CAAC,IAAI,gCAAgC;IAEpD,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAA;KAAO,GACjE,gBAAgB,CAAC,4BAA4B,CAAC;CAIlD"}
1
+ {"version":3,"file":"switch-case-braces.rule.d.ts","sourceRoot":"","sources":["../../../src/linters/rules/switch-case-braces.rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC3B,MAAM,UAAU,CAAC;AAElB,mFAAmF;AACnF,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,QAAQ,CAAC,IAAI,gCAAgC;IAEpD,MAAM,CAAC,KAAK,CACV,IAAI,GAAE;QAAE,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAC,IAAI,CAAC,EAAE,qBAAqB,CAAA;KAAO,GACpE,gBAAgB,CAAC,4BAA4B,CAAC;CAIlD"}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SwitchCaseBracesRule = void 0;
4
+ const common_1 = require("./common");
4
5
  /** `unicorn/switch-case-braces`. `always` gives every case its own block scope. */
5
6
  class SwitchCaseBracesRule {
6
7
  static { this.NAME = 'unicorn/switch-case-braces'; }
7
8
  static build(opts = {}) {
8
- const { severity = 'error', mode = 'always' } = opts;
9
+ const { severity = 'error', mode = common_1.SwitchCaseBracesModes.ALWAYS } = opts;
9
10
  return [severity, mode];
10
11
  }
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"switch-case-braces.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/switch-case-braces.rule.ts"],"names":[],"mappings":";;;AAEA,mFAAmF;AACnF,MAAa,oBAAoB;aACf,SAAI,GAAG,4BAA4B,CAAC;IAEpD,MAAM,CAAC,KAAK,CACV,OAAgE,EAAE;QAElE,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,IAAI,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;QACrD,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;;AARH,oDASC","sourcesContent":["import type { TOxlintRuleEntry, TRuleSeverity } from './common';\n\n/** `unicorn/switch-case-braces`. `always` gives every case its own block scope. */\nexport class SwitchCaseBracesRule {\n static readonly NAME = 'unicorn/switch-case-braces';\n\n static build(\n opts: { severity?: TRuleSeverity; mode?: 'always' | 'avoid' } = {},\n ): TOxlintRuleEntry<'unicorn/switch-case-braces'> {\n const { severity = 'error', mode = 'always' } = opts;\n return [severity, mode];\n }\n}\n"]}
1
+ {"version":3,"file":"switch-case-braces.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/switch-case-braces.rule.ts"],"names":[],"mappings":";;;AAAA,qCAKkB;AAElB,mFAAmF;AACnF,MAAa,oBAAoB;aACf,SAAI,GAAG,4BAA4B,CAAC;IAEpD,MAAM,CAAC,KAAK,CACV,OAAmE,EAAE;QAErE,MAAM,EAAE,QAAQ,GAAG,OAAO,EAAE,IAAI,GAAG,8BAAqB,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;QACzE,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC;;AARH,oDASC","sourcesContent":["import {\n SwitchCaseBracesModes,\n type TOxlintRuleEntry,\n type TRuleSeverity,\n type TSwitchCaseBracesMode,\n} from './common';\n\n/** `unicorn/switch-case-braces`. `always` gives every case its own block scope. */\nexport class SwitchCaseBracesRule {\n static readonly NAME = 'unicorn/switch-case-braces';\n\n static build(\n opts: { severity?: TRuleSeverity; mode?: TSwitchCaseBracesMode } = {},\n ): TOxlintRuleEntry<'unicorn/switch-case-braces'> {\n const { severity = 'error', mode = SwitchCaseBracesModes.ALWAYS } = opts;\n return [severity, mode];\n }\n}\n"]}
@@ -1,2 +1,4 @@
1
1
  export * from './rejection.helper';
2
+ export * from './repo-tmp';
3
+ export * from './spawn.helper';
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC"}
@@ -15,4 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./rejection.helper"), exports);
18
+ __exportStar(require("./repo-tmp"), exports);
19
+ __exportStar(require("./spawn.helper"), exports);
18
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC","sourcesContent":["export * from './rejection.helper';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,6CAA2B;AAC3B,iDAA+B","sourcesContent":["export * from './rejection.helper';\nexport * from './repo-tmp';\nexport * from './spawn.helper';\n"]}
@@ -0,0 +1,12 @@
1
+ /** The folder under the repository root that holds a test run's temp folders. */
2
+ export declare const REPO_TMP_DIRECTORY: string;
3
+ /** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */
4
+ export declare const findRepositoryRoot: (start?: string) => string;
5
+ /**
6
+ * Points TMPDIR at the repository's test folder unless it is already inside it (make's value, or a
7
+ * private folder a caller made there), and returns the folder now in force. Idempotent.
8
+ */
9
+ export declare const useRepoTmp: (opts?: {
10
+ root?: string;
11
+ }) => string;
12
+ //# sourceMappingURL=repo-tmp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo-tmp.d.ts","sourceRoot":"","sources":["../../src/testing/repo-tmp.ts"],"names":[],"mappings":"AAWA,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,QAA2C,CAAC;AAE3E,+GAA+G;AAC/G,eAAO,MAAM,kBAAkB,GAAI,QAAO,MAAsB,KAAG,MAelE,CAAC;AAwBF;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,OAAM;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,KAAG,MAkBzD,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useRepoTmp = exports.findRepositoryRoot = exports.REPO_TMP_DIRECTORY = void 0;
4
+ /**
5
+ * Where a test makes its temp folders: `.agents/local/tmp/tests` of the repository, never the system
6
+ * temp. `make test` sets TMPDIR to a folder like it; this does the same for a run without make - a
7
+ * bare `bun test` on one file - and is the one place that knows the path.
8
+ *
9
+ * The empty `.git` marker in it stops git and bun's ignore lookup from reading the enclosing
10
+ * repository, so GIT_CEILING_DIRECTORIES is set to the same folder.
11
+ */
12
+ const node_fs_1 = require("node:fs");
13
+ const node_path_1 = require("node:path");
14
+ /** The folder under the repository root that holds a test run's temp folders. */
15
+ exports.REPO_TMP_DIRECTORY = (0, node_path_1.join)('.agents', 'local', 'tmp', 'tests');
16
+ /** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */
17
+ const findRepositoryRoot = (start = process.cwd()) => {
18
+ let current = (0, node_path_1.resolve)(start);
19
+ for (;;) {
20
+ if ((0, node_fs_1.existsSync)((0, node_path_1.join)(current, '.git'))) {
21
+ return current;
22
+ }
23
+ const parent = (0, node_path_1.dirname)(current);
24
+ if (parent === current) {
25
+ return (0, node_path_1.resolve)(start);
26
+ }
27
+ current = parent;
28
+ }
29
+ };
30
+ exports.findRepositoryRoot = findRepositoryRoot;
31
+ /**
32
+ * `Bun.spawn` and `Bun.spawnSync` hand a child the environment the process started with, not the one
33
+ * it has now, so a TMPDIR set here would never reach it. Wrapped to default to the current one; an
34
+ * `env` a caller passes wins. `spawn(cmd, options)` and `spawn({ cmd, ...options })` are both handled.
35
+ */
36
+ const withCurrentEnv = (spawn) => {
37
+ return (...args) => {
38
+ const [first, second] = args;
39
+ const options = Array.isArray(first) ? second : first;
40
+ if (options?.env !== undefined) {
41
+ return spawn(...args);
42
+ }
43
+ return Array.isArray(first)
44
+ ? spawn(first, { ...second, env: process.env })
45
+ : spawn({ ...first, env: process.env });
46
+ };
47
+ };
48
+ /**
49
+ * Points TMPDIR at the repository's test folder unless it is already inside it (make's value, or a
50
+ * private folder a caller made there), and returns the folder now in force. Idempotent.
51
+ */
52
+ const useRepoTmp = (opts = {}) => {
53
+ const root = opts.root ?? (0, exports.findRepositoryRoot)();
54
+ const testTmp = (0, node_path_1.join)(root, exports.REPO_TMP_DIRECTORY);
55
+ const current = process.env.TMPDIR;
56
+ if (current !== undefined && `${(0, node_path_1.resolve)(current)}${node_path_1.sep}`.startsWith(`${testTmp}${node_path_1.sep}`)) {
57
+ return current;
58
+ }
59
+ (0, node_fs_1.mkdirSync)((0, node_path_1.join)(testTmp, '.git'), { recursive: true });
60
+ process.env.TMPDIR = testTmp;
61
+ process.env.GIT_CEILING_DIRECTORIES = testTmp;
62
+ Bun.spawn = withCurrentEnv(Bun.spawn);
63
+ Bun.spawnSync = withCurrentEnv(Bun.spawnSync);
64
+ return testTmp;
65
+ };
66
+ exports.useRepoTmp = useRepoTmp;
67
+ //# sourceMappingURL=repo-tmp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo-tmp.js","sourceRoot":"","sources":["../../src/testing/repo-tmp.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,qCAAgD;AAChD,yCAAwD;AAExD,iFAAiF;AACpE,QAAA,kBAAkB,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAE3E,+GAA+G;AACxG,MAAM,kBAAkB,GAAG,CAAC,QAAgB,OAAO,CAAC,GAAG,EAAE,EAAU,EAAE;IAC1E,IAAI,OAAO,GAAG,IAAA,mBAAO,EAAC,KAAK,CAAC,CAAC;IAE7B,SAAS,CAAC;QACR,IAAI,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;YACtC,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,mBAAO,EAAC,OAAO,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,OAAO,IAAA,mBAAO,EAAC,KAAK,CAAC,CAAC;QACxB,CAAC;QAED,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;AACH,CAAC,CAAC;AAfW,QAAA,kBAAkB,sBAe7B;AAIF;;;;GAIG;AACH,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE;IAC/C,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE;QACjB,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;QAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;QAEtD,IAAK,OAAyC,EAAE,GAAG,KAAK,SAAS,EAAE,CAAC;YAClE,OAAO,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QACxB,CAAC;QAED,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACzB,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,GAAI,MAAiB,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;YAC3D,CAAC,CAAC,KAAK,CAAC,EAAE,GAAI,KAAgB,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACxD,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,UAAU,GAAG,CAAC,OAA0B,EAAE,EAAU,EAAE;IACjE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAA,0BAAkB,GAAE,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAA,gBAAI,EAAC,IAAI,EAAE,0BAAkB,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;IAEnC,IAAI,OAAO,KAAK,SAAS,IAAI,GAAG,IAAA,mBAAO,EAAC,OAAO,CAAC,GAAG,eAAG,EAAE,CAAC,UAAU,CAAC,GAAG,OAAO,GAAG,eAAG,EAAE,CAAC,EAAE,CAAC;QACxF,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,IAAA,mBAAS,EAAC,IAAA,gBAAI,EAAC,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,OAAO,CAAC;IAC9C,GAAG,CAAC,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,KAA0B,CAAgC,CAAC;IAC1F,GAAG,CAAC,SAAS,GAAG,cAAc,CAC5B,GAAG,CAAC,SAA8B,CACA,CAAC;IAErC,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAlBW,QAAA,UAAU,cAkBrB","sourcesContent":["/**\n * Where a test makes its temp folders: `.agents/local/tmp/tests` of the repository, never the system\n * temp. `make test` sets TMPDIR to a folder like it; this does the same for a run without make - a\n * bare `bun test` on one file - and is the one place that knows the path.\n *\n * The empty `.git` marker in it stops git and bun's ignore lookup from reading the enclosing\n * repository, so GIT_CEILING_DIRECTORIES is set to the same folder.\n */\nimport { existsSync, mkdirSync } from 'node:fs';\nimport { dirname, join, resolve, sep } from 'node:path';\n\n/** The folder under the repository root that holds a test run's temp folders. */\nexport const REPO_TMP_DIRECTORY = join('.agents', 'local', 'tmp', 'tests');\n\n/** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */\nexport const findRepositoryRoot = (start: string = process.cwd()): string => {\n let current = resolve(start);\n\n for (;;) {\n if (existsSync(join(current, '.git'))) {\n return current;\n }\n\n const parent = dirname(current);\n if (parent === current) {\n return resolve(start);\n }\n\n current = parent;\n }\n};\n\ntype TSpawn = (...args: unknown[]) => unknown;\n\n/**\n * `Bun.spawn` and `Bun.spawnSync` hand a child the environment the process started with, not the one\n * it has now, so a TMPDIR set here would never reach it. Wrapped to default to the current one; an\n * `env` a caller passes wins. `spawn(cmd, options)` and `spawn({ cmd, ...options })` are both handled.\n */\nconst withCurrentEnv = (spawn: TSpawn): TSpawn => {\n return (...args) => {\n const [first, second] = args;\n const options = Array.isArray(first) ? second : first;\n\n if ((options as { env?: unknown } | undefined)?.env !== undefined) {\n return spawn(...args);\n }\n\n return Array.isArray(first)\n ? spawn(first, { ...(second as object), env: process.env })\n : spawn({ ...(first as object), env: process.env });\n };\n};\n\n/**\n * Points TMPDIR at the repository's test folder unless it is already inside it (make's value, or a\n * private folder a caller made there), and returns the folder now in force. Idempotent.\n */\nexport const useRepoTmp = (opts: { root?: string } = {}): string => {\n const root = opts.root ?? findRepositoryRoot();\n const testTmp = join(root, REPO_TMP_DIRECTORY);\n const current = process.env.TMPDIR;\n\n if (current !== undefined && `${resolve(current)}${sep}`.startsWith(`${testTmp}${sep}`)) {\n return current;\n }\n\n mkdirSync(join(testTmp, '.git'), { recursive: true });\n process.env.TMPDIR = testTmp;\n process.env.GIT_CEILING_DIRECTORIES = testTmp;\n Bun.spawn = withCurrentEnv(Bun.spawn as unknown as TSpawn) as unknown as typeof Bun.spawn;\n Bun.spawnSync = withCurrentEnv(\n Bun.spawnSync as unknown as TSpawn,\n ) as unknown as typeof Bun.spawnSync;\n\n return testTmp;\n};\n"]}
@@ -0,0 +1,13 @@
1
+ /** Long enough for a cold `bun build` under a loaded parallel run; it bounds a stall, not a slow run. */
2
+ export declare const SPAWN_TIMEOUT_MS = 120000;
3
+ /**
4
+ * `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot
5
+ * fire while it waits: the `timeout` option is the only bound. Its default signal, SIGTERM, can be
6
+ * outlived by a stuck child - one such child once stalled a whole suite for 770s - so this kills with
7
+ * SIGKILL, and throws naming the command instead of returning a half-finished result.
8
+ */
9
+ export declare const spawnSyncBounded: <const In extends Bun.SpawnOptions.Writable = "ignore", const Out extends Bun.SpawnOptions.Readable = "pipe", const Err extends Bun.SpawnOptions.Readable = "pipe">(opts: Bun.SpawnOptions.SpawnSyncOptions<In, Out, Err> & {
10
+ cmd: string[];
11
+ onExit?: undefined;
12
+ }) => Bun.SyncSubprocess<Out, Err>;
13
+ //# sourceMappingURL=spawn.helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.helper.d.ts","sourceRoot":"","sources":["../../src/testing/spawn.helper.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,eAAO,MAAM,gBAAgB,SAAU,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,KAAK,CAAC,EAAE,SAAS,GAAG,CAAC,YAAY,CAAC,QAAQ,GAAG,QAAQ,EACrD,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,YAAY,CAAC,QAAQ,GAAG,MAAM,EACpD,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,YAAY,CAAC,QAAQ,GAAG,MAAM,EAEpD,MAAM,GAAG,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,iCAa9F,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.spawnSyncBounded = exports.SPAWN_TIMEOUT_MS = void 0;
4
+ /** Long enough for a cold `bun build` under a loaded parallel run; it bounds a stall, not a slow run. */
5
+ exports.SPAWN_TIMEOUT_MS = 120_000;
6
+ /**
7
+ * `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot
8
+ * fire while it waits: the `timeout` option is the only bound. Its default signal, SIGTERM, can be
9
+ * outlived by a stuck child - one such child once stalled a whole suite for 770s - so this kills with
10
+ * SIGKILL, and throws naming the command instead of returning a half-finished result.
11
+ */
12
+ const spawnSyncBounded = (opts) => {
13
+ const timeout = opts.timeout ?? exports.SPAWN_TIMEOUT_MS;
14
+ const result = Bun.spawnSync({ ...opts, timeout, killSignal: 'SIGKILL' });
15
+ if (result.exitedDueToTimeout) {
16
+ // eslint-disable-next-line venizia/no-new-error -- getError would be a dev-configs -> inversion cycle
17
+ throw new Error(`[spawnSyncBounded] did not exit within ${timeout} ms, killed | cmd: ${opts.cmd.join(' ').slice(0, 200)}`);
18
+ }
19
+ return result;
20
+ };
21
+ exports.spawnSyncBounded = spawnSyncBounded;
22
+ //# sourceMappingURL=spawn.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.helper.js","sourceRoot":"","sources":["../../src/testing/spawn.helper.ts"],"names":[],"mappings":";;;AAAA,yGAAyG;AAC5F,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAExC;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAK9B,IAA6F,EAC7F,EAAE;IACF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,wBAAgB,CAAC;IACjD,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAe,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,SAAkB,EAAE,CAAC,CAAC;IAEjG,IAAI,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC9B,sGAAsG;QACtG,MAAM,IAAI,KAAK,CACb,0CAA0C,OAAO,sBAAsB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAC1G,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAlBW,QAAA,gBAAgB,oBAkB3B","sourcesContent":["/** Long enough for a cold `bun build` under a loaded parallel run; it bounds a stall, not a slow run. */\nexport const SPAWN_TIMEOUT_MS = 120_000;\n\n/**\n * `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot\n * fire while it waits: the `timeout` option is the only bound. Its default signal, SIGTERM, can be\n * outlived by a stuck child - one such child once stalled a whole suite for 770s - so this kills with\n * SIGKILL, and throws naming the command instead of returning a half-finished result.\n */\nexport const spawnSyncBounded = <\n const In extends Bun.SpawnOptions.Writable = 'ignore',\n const Out extends Bun.SpawnOptions.Readable = 'pipe',\n const Err extends Bun.SpawnOptions.Readable = 'pipe',\n>(\n opts: Bun.SpawnOptions.SpawnSyncOptions<In, Out, Err> & { cmd: string[]; onExit?: undefined },\n) => {\n const timeout = opts.timeout ?? SPAWN_TIMEOUT_MS;\n const result = Bun.spawnSync<In, Out, Err>({ ...opts, timeout, killSignal: 'SIGKILL' as const });\n\n if (result.exitedDueToTimeout) {\n // eslint-disable-next-line venizia/no-new-error -- getError would be a dev-configs -> inversion cycle\n throw new Error(\n `[spawnSyncBounded] did not exit within ${timeout} ms, killed | cmd: ${opts.cmd.join(' ').slice(0, 200)}`,\n );\n }\n\n return result;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=tmpdir-preload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tmpdir-preload.d.ts","sourceRoot":"","sources":["../../src/testing/tmpdir-preload.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Test preload: `[test] preload = ["@venizia/dev-configs/testing/tmpdir-preload"]` in a bunfig makes
5
+ * a bare `bun test` keep its temp folders in the repository, like `make test` does.
6
+ */
7
+ const repo_tmp_1 = require("./repo-tmp");
8
+ (0, repo_tmp_1.useRepoTmp)();
9
+ //# sourceMappingURL=tmpdir-preload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tmpdir-preload.js","sourceRoot":"","sources":["../../src/testing/tmpdir-preload.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,yCAAwC;AAExC,IAAA,qBAAU,GAAE,CAAC","sourcesContent":["/**\n * Test preload: `[test] preload = [\"@venizia/dev-configs/testing/tmpdir-preload\"]` in a bunfig makes\n * a bare `bun test` keep its temp folders in the repository, like `make test` does.\n */\nimport { useRepoTmp } from './repo-tmp';\n\nuseRepoTmp();\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/dev-configs",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Shareable development configurations for TypeScript projects: oxlint presets with per-rule builders, the ESLint naming-convention rule, the legacy ESLint flat config, and TypeScript compiler options with critical decorator support (experimentalDecorators, emitDecoratorMetadata, useDefineForClassFields). Single source of truth for consistent code style, type checking, and build settings across monorepo packages.",
5
5
  "keywords": [
6
6
  "build-tools",
@@ -83,10 +83,18 @@
83
83
  "types": "./dist/linters/oxlint-presets.d.ts",
84
84
  "default": "./dist/linters/oxlint-presets.js"
85
85
  },
86
+ "./checks": {
87
+ "types": "./dist/checks/index.d.ts",
88
+ "default": "./dist/checks/index.js"
89
+ },
86
90
  "./testing": {
87
91
  "types": "./dist/testing/index.d.ts",
88
92
  "default": "./dist/testing/index.js"
89
93
  },
94
+ "./testing/tmpdir-preload": {
95
+ "types": "./dist/testing/tmpdir-preload.d.ts",
96
+ "default": "./dist/testing/tmpdir-preload.js"
97
+ },
90
98
  "./tsconfig.base.json": "./src/tsconfig/tsconfig.base.json",
91
99
  "./tsconfig.common.json": "./src/tsconfig/tsconfig.common.json",
92
100
  "./tsconfig.browser.json": "./src/tsconfig/tsconfig.browser.json",
@@ -11,8 +11,11 @@
11
11
  "useDefineForClassFields": false,
12
12
 
13
13
  /* Modules */
14
- "module": "Node16",
15
- "moduleResolution": "node16",
14
+ /* IGNIS runs on Bun and ships ES modules only. Bundler resolution reads every import through the "import" condition, so a package whose type is unset resolves the same types as one that says "module". Node16 would read a CommonJS file through "require" and see a second copy of every dual package (drizzle-orm). */
15
+ "module": "esnext",
16
+ "moduleResolution": "bundler",
17
+ /* TypeScript 6 checks "import 'x'"; a side-effect import such as 'dotenv-flow/config' has no types to find. */
18
+ "noUncheckedSideEffectImports": false,
16
19
  "resolveJsonModule": true,
17
20
  "isolatedModules": true,
18
21
  "forceConsistentCasingInFileNames": true,
@@ -3,8 +3,8 @@
3
3
  "extends": "./tsconfig.base.json",
4
4
  "compilerOptions": {
5
5
  "target": "ES2025",
6
- "module": "nodenext",
7
- "moduleResolution": "nodenext"
6
+ "module": "esnext",
7
+ "moduleResolution": "bundler"
8
8
  },
9
9
  "ts-node": {
10
10
  "transpileOnly": true