@venizia/dev-configs 0.4.8-0 → 0.4.8-1
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.
- package/dist/checks/catalog.d.ts +15 -2
- package/dist/checks/catalog.js +1 -0
- package/dist/checks/catalog.js.map +1 -1
- package/dist/checks/module-cycles.d.ts +2 -0
- package/dist/checks/module-cycles.js +2 -0
- package/dist/checks/module-cycles.js.map +1 -1
- package/dist/checks/purity/manifest.d.ts +6 -1
- package/dist/checks/purity/manifest.js.map +1 -1
- package/dist/checks/purity/probe.d.ts +4 -1
- package/dist/checks/purity/probe.js +1 -0
- package/dist/checks/purity/probe.js.map +1 -1
- package/dist/checks/purity/run.d.ts +3 -0
- package/dist/checks/purity/run.js +1 -0
- package/dist/checks/purity/run.js.map +1 -1
- package/dist/checks/split-report.d.ts +1 -0
- package/dist/checks/split-report.js +1 -0
- package/dist/checks/split-report.js.map +1 -1
- package/dist/checks/test-controls.d.ts +11 -2
- package/dist/checks/test-controls.js +1 -0
- package/dist/checks/test-controls.js.map +1 -1
- package/dist/checks/test-dead-code.d.ts +1 -0
- package/dist/checks/test-dead-code.js +1 -0
- package/dist/checks/test-dead-code.js.map +1 -1
- package/dist/checks/test-mutate.d.ts +14 -2
- package/dist/checks/test-mutate.js +1 -0
- package/dist/checks/test-mutate.js.map +1 -1
- package/dist/checks/test-weight.d.ts +3 -0
- package/dist/checks/test-weight.js +1 -0
- package/dist/checks/test-weight.js.map +1 -1
- package/dist/linters/house/max-params-own.rule.d.ts +3 -1
- package/dist/linters/house/max-params-own.rule.js +1 -1
- package/dist/linters/house/max-params-own.rule.js.map +1 -1
- package/dist/linters/oxlint.d.ts +6 -1
- package/dist/linters/oxlint.js.map +1 -1
- package/dist/linters/rules/no-unused-vars.rule.d.ts +6 -1
- package/dist/linters/rules/no-unused-vars.rule.js +1 -1
- package/dist/linters/rules/no-unused-vars.rule.js.map +1 -1
- package/dist/testing/rejection.helper.d.ts +1 -0
- package/dist/testing/rejection.helper.js +1 -0
- package/dist/testing/rejection.helper.js.map +1 -1
- package/dist/testing/repo-tmp.d.ts +1 -0
- package/dist/testing/repo-tmp.js +1 -0
- package/dist/testing/repo-tmp.js.map +1 -1
- package/dist/testing/spawn.helper.d.ts +1 -0
- package/dist/testing/spawn.helper.js +1 -0
- package/dist/testing/spawn.helper.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.js","sourceRoot":"","sources":["../../src/linters/oxlint.ts"],"names":[],"mappings":";;;AACA,qCAAsC;AACtC,mCAMiB;AAEjB,0CAA0C;AAC1C,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACjE,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC,CAAC;AAEjF;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,aAAa,GAAiB;IACzC,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;IAClC,UAAU,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAClC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;IAC5B,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IACtB,cAAc,EAAE,CAAC,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC;IACzF,KAAK,EAAE;QACL,qBAAqB;QACrB,mBAAmB,EAAE,OAAO;QAC5B,eAAe,EAAE,OAAO;QACxB,eAAe,EAAE,OAAO;QACxB,2BAA2B,EAAE,OAAO;QACpC,sBAAsB,EAAE,OAAO;QAC/B,iBAAiB,EAAE,OAAO;QAC1B,qBAAqB,EAAE,OAAO;QAC9B,gBAAgB,EAAE,OAAO;QACzB,iBAAiB,EAAE,OAAO;QAC1B,+BAA+B,EAAE,OAAO;QACxC,uBA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,CAAC,IAAI,CAAC,EAAE,mCAA2B,CAAC,KAAK,CAAC;wBACpE,gBAAgB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;qBACjD,CAAC;iBACH;aACF;YACH,CAAC,CAAC,qBAAa,CAAC;QAElB,OAAO,mBAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;CACF;AAhBD,sCAgBC","sourcesContent":["import type { OxlintConfig } from 'oxlint';\nimport { LintIgnore } from './ignore';\nimport {\n EqeqeqRule,\n NoRestrictedImportsRule,\n NoUnusedVarsRule,\n PreferNullishCoalescingRule,\n SwitchCaseBracesRule,\n} from './rules';\n\n/** File globs the rules are scoped to. */\nconst TS_FILES = ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'];\nconst JS_TS_FILES = ['**/*.js', '**/*.cjs', '**/*.mjs', '**/*.jsx', ...TS_FILES];\n\n/**\n * The oxlint port of `eslintConfigs`, generated with `@oxlint/migrate` and kept rule for rule.\n * Type-aware rules (`no-floating-promises`, `return-await`, ...) need `oxlint-tsgolint` installed.\n *\n * Not ported: `@typescript-eslint/naming-convention` (oxlint has no equivalent yet - keep it in\n * ESLint), `@typescript-eslint/prefer-optional-chain` (oxlint nursery), `no-invalid-this` (covered\n * by `noImplicitThis` in `tsconfig.base.json`). `n/prefer-node-protocol` maps to the unicorn rule.\n *\n * ```ts\n * // .configs/lints/oxlint.config.mts\n * import { defineConfig } from 'oxlint';\n * import { oxlintConfigs } from '@venizia/dev-configs/linters/oxlint';\n *\n * export default defineConfig(oxlintConfigs);\n * ```\n *\n * `OxlintConfigs.create({ lenientFallback: true })` is the same preset with `||` allowed on string\n * and number operands.\n */\nexport const oxlintConfigs: OxlintConfig = {\n plugins: ['typescript', 'unicorn'],\n categories: { correctness: 'off' },\n options: { typeAware: true },\n env: { builtin: true },\n ignorePatterns: ['**/node_modules/', '**/*.d.ts', '**/build/', '**/dist/', '**/release/'],\n rules: {\n // eslint:recommended\n 'constructor-super': 'error',\n 'for-direction': 'error',\n 'getter-return': 'error',\n 'no-async-promise-executor': 'error',\n 'no-case-declarations': 'error',\n 'no-class-assign': 'error',\n 'no-compare-neg-zero': 'error',\n 'no-cond-assign': 'error',\n 'no-const-assign': 'error',\n 'no-constant-binary-expression': 'error',\n 'no-constant-condition': 'error',\n 'no-control-regex': 'error',\n 'no-debugger': 'error',\n 'no-delete-var': 'error',\n 'no-dupe-else-if': 'error',\n 'no-dupe-keys': 'error',\n 'no-duplicate-case': 'error',\n 'no-empty': 'error',\n 'no-empty-character-class': 'error',\n 'no-empty-pattern': 'error',\n 'no-empty-static-block': 'error',\n 'no-ex-assign': 'error',\n 'no-extra-boolean-cast': 'error',\n 'no-fallthrough': 'error',\n 'no-func-assign': 'error',\n 'no-global-assign': 'error',\n 'no-import-assign': 'error',\n 'no-invalid-regexp': 'error',\n 'no-irregular-whitespace': 'error',\n 'no-loss-of-precision': 'error',\n 'no-misleading-character-class': 'error',\n 'no-new-native-nonconstructor': 'error',\n 'no-nonoctal-decimal-escape': 'error',\n 'no-obj-calls': 'error',\n 'no-prototype-builtins': 'error',\n 'no-regex-spaces': 'error',\n 'no-self-assign': 'error',\n 'no-setter-return': 'error',\n 'no-shadow-restricted-names': 'error',\n 'no-sparse-arrays': 'error',\n 'no-this-before-super': 'error',\n 'no-unassigned-vars': 'error',\n 'no-unreachable': 'error',\n 'no-unsafe-finally': 'error',\n 'no-unsafe-negation': 'error',\n 'no-unsafe-optional-chaining': 'error',\n 'no-unused-labels': 'error',\n 'no-unused-private-class-members': 'error',\n 'no-useless-backreference': 'error',\n 'no-useless-catch': 'error',\n 'no-with': 'error',\n 'preserve-caught-error': 'error',\n 'require-yield': 'error',\n 'use-isnan': 'error',\n 'valid-typeof': 'error',\n 'no-array-constructor': 'error',\n\n // Strict rules on top\n [NoUnusedVarsRule.NAME]: NoUnusedVarsRule.build(),\n 'no-useless-escape': 'warn',\n 'no-unused-expressions': 'error',\n 'no-new-wrappers': 'error',\n 'no-throw-literal': 'error',\n [EqeqeqRule.NAME]: EqeqeqRule.build(),\n 'no-void': 'error',\n 'no-caller': 'error',\n 'no-shadow': 'error',\n 'no-use-before-define': 'error',\n [SwitchCaseBracesRule.NAME]: SwitchCaseBracesRule.build(),\n 'unicorn/prefer-node-protocol': 'error',\n\n // typescript-eslint\n 'typescript/ban-ts-comment': 'error',\n 'typescript/no-duplicate-enum-values': 'error',\n 'typescript/no-empty-object-type': 'error',\n 'typescript/no-extra-non-null-assertion': 'error',\n 'typescript/no-misused-new': 'error',\n 'typescript/no-namespace': 'error',\n 'typescript/no-non-null-asserted-optional-chain': 'error',\n 'typescript/no-this-alias': 'error',\n 'typescript/no-unnecessary-type-constraint': 'error',\n 'typescript/no-unsafe-declaration-merging': 'error',\n 'typescript/no-unsafe-function-type': 'error',\n 'typescript/no-wrapper-object-types': 'error',\n 'typescript/prefer-as-const': 'error',\n 'typescript/prefer-namespace-keyword': 'error',\n 'typescript/triple-slash-reference': 'error',\n 'typescript/adjacent-overload-signatures': 'error',\n 'typescript/prefer-for-of': 'error',\n 'typescript/unified-signatures': 'error',\n\n // typescript-eslint, type-aware\n 'typescript/await-thenable': 'error',\n 'typescript/no-floating-promises': 'error',\n [PreferNullishCoalescingRule.NAME]: PreferNullishCoalescingRule.build(),\n 'typescript/return-await': 'error',\n },\n overrides: [\n {\n // TypeScript itself reports these.\n files: TS_FILES,\n rules: {\n 'constructor-super': 'off',\n 'getter-return': 'off',\n 'no-class-assign': 'off',\n 'no-const-assign': 'off',\n 'no-dupe-keys': 'off',\n 'no-func-assign': 'off',\n 'no-import-assign': 'off',\n 'no-new-native-nonconstructor': 'off',\n 'no-obj-calls': 'off',\n 'no-setter-return': 'off',\n 'no-this-before-super': 'off',\n 'no-unreachable': 'off',\n 'no-unsafe-negation': 'off',\n 'no-with': 'off',\n 'no-var': 'error',\n 'prefer-const': 'error',\n 'prefer-rest-params': 'error',\n 'prefer-spread': 'error',\n // A value import of a type becomes a runtime import when Bun runs a decorated class's source\n // (emitDecoratorMetadata) and fails with `Export named 'X' not found`. `import('pkg').T` type\n // annotations stay allowed: they are type-only by construction, and type an optional peer.\n 'typescript/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n fixStyle: 'inline-type-imports',\n disallowTypeAnnotations: false,\n },\n ],\n },\n },\n {\n files: JS_TS_FILES,\n rules: {\n 'no-constant-condition': 'off',\n 'prefer-const': 'error',\n 'no-var': 'error',\n curly: ['error', 'all'],\n [NoRestrictedImportsRule.NAME]: NoRestrictedImportsRule.build(),\n 'typescript/no-unsafe-function-type': 'off',\n 'typescript/no-this-alias': 'off',\n 'typescript/no-empty-object-type': 'off',\n },\n },\n ],\n};\n\nexport interface IOxlintPresetOptions {\n /**\n * Allow `||` / `||=` where the left side is a string or a number, so `name || 'guest'` and\n * `limit || 20` pass: `''` and `0` fall back on purpose. Off by default - the base catches a real\n * `''` or `0` swallowed by `||`.\n */\n lenientFallback?: boolean;\n /**\n * Project paths to skip - generated files, vendored code - as in `--ignore-pattern`: `src/gen/**`.\n * Every rule is turned off for them (oxlint cannot ignore a project path from `.configs/`).\n * Share the list with ESLint through `LintIgnore`.\n */\n ignore?: string[];\n}\n\n/**\n * Builds `oxlintConfigs` with options. Without any it returns the base preset unchanged.\n *\n * ```ts\n * // .configs/lints/oxlint.config.mts\n * import { defineConfig } from 'oxlint';\n * import { OxlintConfigs } from '@venizia/dev-configs/linters/oxlint';\n *\n * export default defineConfig(OxlintConfigs.create({ lenientFallback: true }));\n * ```\n */\nexport class OxlintConfigs {\n static create(opts: IOxlintPresetOptions = {}): OxlintConfig {\n const config: OxlintConfig = opts.lenientFallback\n ? {\n ...oxlintConfigs,\n rules: {\n ...oxlintConfigs.rules,\n [PreferNullishCoalescingRule.NAME]: PreferNullishCoalescingRule.build({\n ignorePrimitives: { string: true, number: true },\n }),\n },\n }\n : oxlintConfigs;\n\n return LintIgnore.oxlint({ config, patterns: opts.ignore ?? [] });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"oxlint.js","sourceRoot":"","sources":["../../src/linters/oxlint.ts"],"names":[],"mappings":";;;AACA,qCAAsC;AACtC,mCAMiB;AAEjB,0CAA0C;AAC1C,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AACjE,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC,CAAC;AAEjF;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,aAAa,GAAiB;IACzC,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;IAClC,UAAU,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAClC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;IAC5B,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;IACtB,cAAc,EAAE,CAAC,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC;IACzF,KAAK,EAAE;QACL,qBAAqB;QACrB,mBAAmB,EAAE,OAAO;QAC5B,eAAe,EAAE,OAAO;QACxB,eAAe,EAAE,OAAO;QACxB,2BAA2B,EAAE,OAAO;QACpC,sBAAsB,EAAE,OAAO;QAC/B,iBAAiB,EAAE,OAAO;QAC1B,qBAAqB,EAAE,OAAO;QAC9B,gBAAgB,EAAE,OAAO;QACzB,iBAAiB,EAAE,OAAO;QAC1B,+BAA+B,EAAE,OAAO;QACxC,uBAAuB,EAAE,OAAO;QAChC,kBAAkB,EAAE,OAAO;QAC3B,aAAa,EAAE,OAAO;QACtB,eAAe,EAAE,OAAO;QACxB,iBAAiB,EAAE,OAAO;QAC1B,cAAc,EAAE,OAAO;QACvB,mBAAmB,EAAE,OAAO;QAC5B,UAAU,EAAE,OAAO;QACnB,0BAA0B,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M,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;CACF;AAhBD,sCAgBC","sourcesContent":["import type { OxlintConfig } from 'oxlint';\nimport { LintIgnore } from './ignore';\nimport {\n EqeqeqRule,\n NoRestrictedImportsRule,\n NoUnusedVarsRule,\n PreferNullishCoalescingRule,\n SwitchCaseBracesRule,\n} from './rules';\n\n/** File globs the rules are scoped to. */\nconst TS_FILES = ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'];\nconst JS_TS_FILES = ['**/*.js', '**/*.cjs', '**/*.mjs', '**/*.jsx', ...TS_FILES];\n\n/**\n * The oxlint port of `eslintConfigs`, generated with `@oxlint/migrate` and kept rule for rule.\n * Type-aware rules (`no-floating-promises`, `return-await`, ...) need `oxlint-tsgolint` installed.\n *\n * Not ported: `@typescript-eslint/naming-convention` (oxlint has no equivalent yet - keep it in\n * ESLint), `@typescript-eslint/prefer-optional-chain` (oxlint nursery), `no-invalid-this` (covered\n * by `noImplicitThis` in `tsconfig.base.json`). `n/prefer-node-protocol` maps to the unicorn rule.\n *\n * ```ts\n * // .configs/lints/oxlint.config.mts\n * import { defineConfig } from 'oxlint';\n * import { oxlintConfigs } from '@venizia/dev-configs/linters/oxlint';\n *\n * export default defineConfig(oxlintConfigs);\n * ```\n *\n * `OxlintConfigs.create({ lenientFallback: true })` is the same preset with `||` allowed on string\n * and number operands.\n */\nexport const oxlintConfigs: OxlintConfig = {\n plugins: ['typescript', 'unicorn'],\n categories: { correctness: 'off' },\n options: { typeAware: true },\n env: { builtin: true },\n ignorePatterns: ['**/node_modules/', '**/*.d.ts', '**/build/', '**/dist/', '**/release/'],\n rules: {\n // eslint:recommended\n 'constructor-super': 'error',\n 'for-direction': 'error',\n 'getter-return': 'error',\n 'no-async-promise-executor': 'error',\n 'no-case-declarations': 'error',\n 'no-class-assign': 'error',\n 'no-compare-neg-zero': 'error',\n 'no-cond-assign': 'error',\n 'no-const-assign': 'error',\n 'no-constant-binary-expression': 'error',\n 'no-constant-condition': 'error',\n 'no-control-regex': 'error',\n 'no-debugger': 'error',\n 'no-delete-var': 'error',\n 'no-dupe-else-if': 'error',\n 'no-dupe-keys': 'error',\n 'no-duplicate-case': 'error',\n 'no-empty': 'error',\n 'no-empty-character-class': 'error',\n 'no-empty-pattern': 'error',\n 'no-empty-static-block': 'error',\n 'no-ex-assign': 'error',\n 'no-extra-boolean-cast': 'error',\n 'no-fallthrough': 'error',\n 'no-func-assign': 'error',\n 'no-global-assign': 'error',\n 'no-import-assign': 'error',\n 'no-invalid-regexp': 'error',\n 'no-irregular-whitespace': 'error',\n 'no-loss-of-precision': 'error',\n 'no-misleading-character-class': 'error',\n 'no-new-native-nonconstructor': 'error',\n 'no-nonoctal-decimal-escape': 'error',\n 'no-obj-calls': 'error',\n 'no-prototype-builtins': 'error',\n 'no-regex-spaces': 'error',\n 'no-self-assign': 'error',\n 'no-setter-return': 'error',\n 'no-shadow-restricted-names': 'error',\n 'no-sparse-arrays': 'error',\n 'no-this-before-super': 'error',\n 'no-unassigned-vars': 'error',\n 'no-unreachable': 'error',\n 'no-unsafe-finally': 'error',\n 'no-unsafe-negation': 'error',\n 'no-unsafe-optional-chaining': 'error',\n 'no-unused-labels': 'error',\n 'no-unused-private-class-members': 'error',\n 'no-useless-backreference': 'error',\n 'no-useless-catch': 'error',\n 'no-with': 'error',\n 'preserve-caught-error': 'error',\n 'require-yield': 'error',\n 'use-isnan': 'error',\n 'valid-typeof': 'error',\n 'no-array-constructor': 'error',\n\n // Strict rules on top\n [NoUnusedVarsRule.NAME]: NoUnusedVarsRule.build(),\n 'no-useless-escape': 'warn',\n 'no-unused-expressions': 'error',\n 'no-new-wrappers': 'error',\n 'no-throw-literal': 'error',\n [EqeqeqRule.NAME]: EqeqeqRule.build(),\n 'no-void': 'error',\n 'no-caller': 'error',\n 'no-shadow': 'error',\n 'no-use-before-define': 'error',\n [SwitchCaseBracesRule.NAME]: SwitchCaseBracesRule.build(),\n 'unicorn/prefer-node-protocol': 'error',\n\n // typescript-eslint\n 'typescript/ban-ts-comment': 'error',\n 'typescript/no-duplicate-enum-values': 'error',\n 'typescript/no-empty-object-type': 'error',\n 'typescript/no-extra-non-null-assertion': 'error',\n 'typescript/no-misused-new': 'error',\n 'typescript/no-namespace': 'error',\n 'typescript/no-non-null-asserted-optional-chain': 'error',\n 'typescript/no-this-alias': 'error',\n 'typescript/no-unnecessary-type-constraint': 'error',\n 'typescript/no-unsafe-declaration-merging': 'error',\n 'typescript/no-unsafe-function-type': 'error',\n 'typescript/no-wrapper-object-types': 'error',\n 'typescript/prefer-as-const': 'error',\n 'typescript/prefer-namespace-keyword': 'error',\n 'typescript/triple-slash-reference': 'error',\n 'typescript/adjacent-overload-signatures': 'error',\n 'typescript/prefer-for-of': 'error',\n 'typescript/unified-signatures': 'error',\n\n // typescript-eslint, type-aware\n 'typescript/await-thenable': 'error',\n 'typescript/no-floating-promises': 'error',\n [PreferNullishCoalescingRule.NAME]: PreferNullishCoalescingRule.build(),\n 'typescript/return-await': 'error',\n },\n overrides: [\n {\n // TypeScript itself reports these.\n files: TS_FILES,\n rules: {\n 'constructor-super': 'off',\n 'getter-return': 'off',\n 'no-class-assign': 'off',\n 'no-const-assign': 'off',\n 'no-dupe-keys': 'off',\n 'no-func-assign': 'off',\n 'no-import-assign': 'off',\n 'no-new-native-nonconstructor': 'off',\n 'no-obj-calls': 'off',\n 'no-setter-return': 'off',\n 'no-this-before-super': 'off',\n 'no-unreachable': 'off',\n 'no-unsafe-negation': 'off',\n 'no-with': 'off',\n 'no-var': 'error',\n 'prefer-const': 'error',\n 'prefer-rest-params': 'error',\n 'prefer-spread': 'error',\n // A value import of a type becomes a runtime import when Bun runs a decorated class's source\n // (emitDecoratorMetadata) and fails with `Export named 'X' not found`. `import('pkg').T` type\n // annotations stay allowed: they are type-only by construction, and type an optional peer.\n 'typescript/consistent-type-imports': [\n 'error',\n {\n prefer: 'type-imports',\n fixStyle: 'inline-type-imports',\n disallowTypeAnnotations: false,\n },\n ],\n },\n },\n {\n files: JS_TS_FILES,\n rules: {\n 'no-constant-condition': 'off',\n 'prefer-const': 'error',\n 'no-var': 'error',\n curly: ['error', 'all'],\n [NoRestrictedImportsRule.NAME]: NoRestrictedImportsRule.build(),\n 'typescript/no-unsafe-function-type': 'off',\n 'typescript/no-this-alias': 'off',\n 'typescript/no-empty-object-type': 'off',\n },\n },\n ],\n};\n\n/** Options of `OxlintConfigs.create`. */\nexport interface IOxlintPresetOptions {\n /**\n * Allow `||` / `||=` where the left side is a string or a number, so `name || 'guest'` and\n * `limit || 20` pass: `''` and `0` fall back on purpose. Left off, the base catches a real\n * `''` or `0` swallowed by `||`.\n *\n * @default false\n */\n lenientFallback?: boolean;\n /**\n * Project paths to skip - generated files, vendored code - as in `--ignore-pattern`: `src/gen/**`.\n * Every rule is turned off for them (oxlint cannot ignore a project path from `.configs/`).\n * Share the list with ESLint through `LintIgnore`.\n *\n * @default []\n */\n ignore?: string[];\n}\n\n/**\n * Builds `oxlintConfigs` with options. Without any it returns the base preset unchanged.\n *\n * ```ts\n * // .configs/lints/oxlint.config.mts\n * import { defineConfig } from 'oxlint';\n * import { OxlintConfigs } from '@venizia/dev-configs/linters/oxlint';\n *\n * export default defineConfig(OxlintConfigs.create({ lenientFallback: true }));\n * ```\n */\nexport class OxlintConfigs {\n static create(opts: IOxlintPresetOptions = {}): OxlintConfig {\n const config: OxlintConfig = opts.lenientFallback\n ? {\n ...oxlintConfigs,\n rules: {\n ...oxlintConfigs.rules,\n [PreferNullishCoalescingRule.NAME]: PreferNullishCoalescingRule.build({\n ignorePrimitives: { string: true, number: true },\n }),\n },\n }\n : oxlintConfigs;\n\n return LintIgnore.oxlint({ config, patterns: opts.ignore ?? [] });\n }\n}\n"]}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import { type TOxlintRuleEntry, type TRuleSeverity, type TUnusedArgsMode, type TUnusedVarsScope } from './common';
|
|
2
|
-
/** `no-unused-vars`. Unused arguments pass
|
|
2
|
+
/** `no-unused-vars`. Unused arguments pass: 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
|
+
/** @default 'error' */
|
|
6
7
|
severity?: TRuleSeverity;
|
|
8
|
+
/** @default 'all' */
|
|
7
9
|
vars?: TUnusedVarsScope;
|
|
10
|
+
/** @default 'none' */
|
|
8
11
|
args?: TUnusedArgsMode;
|
|
12
|
+
/** @default false */
|
|
9
13
|
ignoreRestSiblings?: boolean;
|
|
10
14
|
/** Names that may stay unused, e.g. `^_` - a placeholder a signature needs. */
|
|
11
15
|
argsIgnorePattern?: string;
|
|
16
|
+
/** @default '^_' */
|
|
12
17
|
varsIgnorePattern?: string;
|
|
13
18
|
caughtErrorsIgnorePattern?: string;
|
|
14
19
|
destructuredArrayIgnorePattern?: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NoUnusedVarsRule = void 0;
|
|
4
4
|
const common_1 = require("./common");
|
|
5
|
-
/** `no-unused-vars`. Unused arguments pass
|
|
5
|
+
/** `no-unused-vars`. Unused arguments pass: an override keeps its signature. A `_name` variable is an omitted value (`{ page: _page, ...rest }`) and passes too. */
|
|
6
6
|
class NoUnusedVarsRule {
|
|
7
7
|
static { this.NAME = 'no-unused-vars'; }
|
|
8
8
|
static build(opts = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-unused-vars.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/no-unused-vars.rule.ts"],"names":[],"mappings":";;;AAAA,qCAOkB;AAElB
|
|
1
|
+
{"version":3,"file":"no-unused-vars.rule.js","sourceRoot":"","sources":["../../../src/linters/rules/no-unused-vars.rule.ts"],"names":[],"mappings":";;;AAAA,qCAOkB;AAElB,oKAAoK;AACpK,MAAa,gBAAgB;aACX,SAAI,GAAG,gBAAgB,CAAC;IAExC,MAAM,CAAC,KAAK,CACV,OAeI,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;QAET,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;IACxF,CAAC;;AA/BH,4CAgCC","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: 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 /** @default 'error' */\n severity?: TRuleSeverity;\n /** @default 'all' */\n vars?: TUnusedVarsScope;\n /** @default 'none' */\n args?: TUnusedArgsMode;\n /** @default false */\n ignoreRestSiblings?: boolean;\n /** Names that may stay unused, e.g. `^_` - a placeholder a signature needs. */\n argsIgnorePattern?: string;\n /** @default '^_' */\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\n return [severity, { vars, args, ignoreRestSiblings, varsIgnorePattern, ...patterns }];\n }\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Test helpers for asserting that a promise rejects, without the typing and un-awaited-assertion pitfalls of `expect(task).rejects`. */
|
|
1
2
|
export declare class RejectionHelper {
|
|
2
3
|
/**
|
|
3
4
|
* Awaits a task that must reject and returns what it rejected with; throws when the task resolves.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RejectionHelper = void 0;
|
|
4
4
|
const bun_test_1 = require("bun:test");
|
|
5
|
+
/** Test helpers for asserting that a promise rejects, without the typing and un-awaited-assertion pitfalls of `expect(task).rejects`. */
|
|
5
6
|
class RejectionHelper {
|
|
6
7
|
/**
|
|
7
8
|
* Awaits a task that must reject and returns what it rejected with; throws when the task resolves.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rejection.helper.js","sourceRoot":"","sources":["../../src/testing/rejection.helper.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC,MAAa,eAAe;IAC1B;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAgC;QACvD,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,iBAAM,CAAC,WAAW,CAAC,8CAA8C,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,IAG5B;QACC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAE3D,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACrC,IAAA,iBAAM,EAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrF,CAAC;CACF;AArCD,0CAqCC","sourcesContent":["import { expect } from 'bun:test';\n\nexport class RejectionHelper {\n /**\n * Awaits a task that must reject and returns what it rejected with; throws when the task resolves.\n *\n * bun types the async matchers (`expect(task).rejects` / `.resolves`) as `void`, so\n * `await expect(task).rejects.toThrow()` is refused by `await-thenable` - and left un-awaited the\n * assertion never runs. Awaiting the task itself needs no matcher and no cast:\n * `RejectionHelper.expectRejection({ task, message })` or\n * `expect(await RejectionHelper.rejectionOf({ task })).toBeInstanceOf(Error)`,\n * and for a resolution `expect(await task).toMatchObject(...)`.\n */\n static async rejectionOf(opts: { task: Promise<unknown> }): Promise<unknown> {\n try {\n await opts.task;\n } catch (error) {\n return error;\n }\n\n return expect.unreachable('Expected the task to reject, but it resolved');\n }\n\n /**\n * The task rejects with an Error whose message contains `message` (a string) or matches it (a\n * RegExp). The message is compared as a string on purpose: bun 1.4.2 `toMatchObject` with an\n * asymmetric matcher overwrites the matched property on the object it checks, so a later read of\n * `error.message` gets the matcher back.\n */\n static async expectRejection(opts: {\n task: Promise<unknown>;\n message: string | RegExp;\n }): Promise<void> {\n const { task, message } = opts;\n const reason = await RejectionHelper.rejectionOf({ task });\n\n expect(reason).toBeInstanceOf(Error);\n expect(reason instanceof Error ? reason.message : String(reason)).toMatch(message);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rejection.helper.js","sourceRoot":"","sources":["../../src/testing/rejection.helper.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC,yIAAyI;AACzI,MAAa,eAAe;IAC1B;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAgC;QACvD,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,iBAAM,CAAC,WAAW,CAAC,8CAA8C,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,IAG5B;QACC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAE3D,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACrC,IAAA,iBAAM,EAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrF,CAAC;CACF;AArCD,0CAqCC","sourcesContent":["import { expect } from 'bun:test';\n\n/** Test helpers for asserting that a promise rejects, without the typing and un-awaited-assertion pitfalls of `expect(task).rejects`. */\nexport class RejectionHelper {\n /**\n * Awaits a task that must reject and returns what it rejected with; throws when the task resolves.\n *\n * bun types the async matchers (`expect(task).rejects` / `.resolves`) as `void`, so\n * `await expect(task).rejects.toThrow()` is refused by `await-thenable` - and left un-awaited the\n * assertion never runs. Awaiting the task itself needs no matcher and no cast:\n * `RejectionHelper.expectRejection({ task, message })` or\n * `expect(await RejectionHelper.rejectionOf({ task })).toBeInstanceOf(Error)`,\n * and for a resolution `expect(await task).toMatchObject(...)`.\n */\n static async rejectionOf(opts: { task: Promise<unknown> }): Promise<unknown> {\n try {\n await opts.task;\n } catch (error) {\n return error;\n }\n\n return expect.unreachable('Expected the task to reject, but it resolved');\n }\n\n /**\n * The task rejects with an Error whose message contains `message` (a string) or matches it (a\n * RegExp). The message is compared as a string on purpose: bun 1.4.2 `toMatchObject` with an\n * asymmetric matcher overwrites the matched property on the object it checks, so a later read of\n * `error.message` gets the matcher back.\n */\n static async expectRejection(opts: {\n task: Promise<unknown>;\n message: string | RegExp;\n }): Promise<void> {\n const { task, message } = opts;\n const reason = await RejectionHelper.rejectionOf({ task });\n\n expect(reason).toBeInstanceOf(Error);\n expect(reason instanceof Error ? reason.message : String(reason)).toMatch(message);\n }\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** The folder under the repository root that holds a test run's temp folders. */
|
|
2
2
|
export declare const REPO_TMP_DIRECTORY: string;
|
|
3
|
+
/** Routes test temp folders into the repository: `apply` sets `TMPDIR` and `GIT_CEILING_DIRECTORIES` and makes `Bun.spawn` children inherit them. */
|
|
3
4
|
export declare class RepoTmp {
|
|
4
5
|
/** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */
|
|
5
6
|
static findRoot(opts?: {
|
package/dist/testing/repo-tmp.js
CHANGED
|
@@ -13,6 +13,7 @@ const node_fs_1 = require("node:fs");
|
|
|
13
13
|
const node_path_1 = require("node:path");
|
|
14
14
|
/** The folder under the repository root that holds a test run's temp folders. */
|
|
15
15
|
exports.REPO_TMP_DIRECTORY = (0, node_path_1.join)('.agents', 'local', 'tmp', 'tests');
|
|
16
|
+
/** Routes test temp folders into the repository: `apply` sets `TMPDIR` and `GIT_CEILING_DIRECTORIES` and makes `Bun.spawn` children inherit them. */
|
|
16
17
|
class RepoTmp {
|
|
17
18
|
/** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */
|
|
18
19
|
static findRoot(opts = {}) {
|
|
@@ -1 +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;AAI3E,MAAa,OAAO;IACl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J,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,OAA0B,EAAE;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,IAAA,gBAAI,EAAC,IAAI,EAAE,0BAAkB,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;QAEnC,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;YACxF,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,IAAA,mBAAS,EAAC,IAAA,gBAAI,EAAC,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,OAAO,CAAC;QAC9C,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,cAAc,CAChC,GAAG,CAAC,KAA0B,CACA,CAAC;QACjC,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,cAAc,CACpC,GAAG,CAAC,SAA8B,CACA,CAAC;QAErC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAlED,0BAkEC","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\ntype TSpawn = (...args: unknown[]) => unknown;\n\nexport class RepoTmp {\n /** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */\n static findRoot(opts: { start?: string } = {}): string {\n const { start = process.cwd() } = opts;\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\n if (parent === current) {\n return resolve(start);\n }\n\n current = parent;\n }\n }\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 */\n private static 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 */\n static apply(opts: { root?: string } = {}): string {\n const root = opts.root ?? RepoTmp.findRoot();\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 = RepoTmp.withCurrentEnv(\n Bun.spawn as unknown as TSpawn,\n ) as unknown as typeof Bun.spawn;\n Bun.spawnSync = RepoTmp.withCurrentEnv(\n Bun.spawnSync as unknown as TSpawn,\n ) as unknown as typeof Bun.spawnSync;\n\n return testTmp;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","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\ntype TSpawn = (...args: unknown[]) => unknown;\n\n/** Routes test temp folders into the repository: `apply` sets `TMPDIR` and `GIT_CEILING_DIRECTORIES` and makes `Bun.spawn` children inherit them. */\nexport class RepoTmp {\n /** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */\n static findRoot(opts: { start?: string } = {}): string {\n const { start = process.cwd() } = opts;\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\n if (parent === current) {\n return resolve(start);\n }\n\n current = parent;\n }\n }\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 */\n private static 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 */\n static apply(opts: { root?: string } = {}): string {\n const root = opts.root ?? RepoTmp.findRoot();\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 = RepoTmp.withCurrentEnv(\n Bun.spawn as unknown as TSpawn,\n ) as unknown as typeof Bun.spawn;\n Bun.spawnSync = RepoTmp.withCurrentEnv(\n Bun.spawnSync as unknown as TSpawn,\n ) as unknown as typeof Bun.spawnSync;\n\n return testTmp;\n }\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Long enough for a cold `bun build` under a loaded parallel run; it bounds a stall, not a slow run. */
|
|
2
2
|
export declare const SPAWN_TIMEOUT_MS = 120000;
|
|
3
|
+
/** Bounded wrappers around `Bun.spawn*` for tests, so a stuck child cannot stall a suite. */
|
|
3
4
|
export declare class SpawnHelper {
|
|
4
5
|
/**
|
|
5
6
|
* `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SpawnHelper = exports.SPAWN_TIMEOUT_MS = void 0;
|
|
4
4
|
/** Long enough for a cold `bun build` under a loaded parallel run; it bounds a stall, not a slow run. */
|
|
5
5
|
exports.SPAWN_TIMEOUT_MS = 120_000;
|
|
6
|
+
/** Bounded wrappers around `Bun.spawn*` for tests, so a stuck child cannot stall a suite. */
|
|
6
7
|
class SpawnHelper {
|
|
7
8
|
/**
|
|
8
9
|
* `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot
|
|
@@ -1 +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,MAAa,WAAW;IACtB;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAIrB,IAA6F;QAC7F,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,wBAAgB,CAAC;QACjD,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAe;YACzC,GAAG,IAAI;YACP,OAAO;YACP,UAAU,EAAE,SAAkB;SAC/B,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC9B,sGAAsG;YACtG,MAAM,IAAI,KAAK,CACb,sDAAsD,OAAO,sBAAsB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CACtH,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA5BD,kCA4BC","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\nexport class SpawnHelper {\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 */\n static 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 >(opts: Bun.SpawnOptions.SpawnSyncOptions<In, Out, Err> & { cmd: string[]; onExit?: undefined }) {\n const timeout = opts.timeout ?? SPAWN_TIMEOUT_MS;\n const result = Bun.spawnSync<In, Out, Err>({\n ...opts,\n timeout,\n killSignal: 'SIGKILL' as const,\n });\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 `[SpawnHelper.spawnSyncBounded] did not exit within ${timeout} ms, killed | cmd: ${opts.cmd.join(' ').slice(0, 200)}`,\n );\n }\n\n return result;\n }\n}\n"]}
|
|
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,6FAA6F;AAC7F,MAAa,WAAW;IACtB;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAIrB,IAA6F;QAC7F,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,wBAAgB,CAAC;QACjD,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAe;YACzC,GAAG,IAAI;YACP,OAAO;YACP,UAAU,EAAE,SAAkB;SAC/B,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC9B,sGAAsG;YACtG,MAAM,IAAI,KAAK,CACb,sDAAsD,OAAO,sBAAsB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CACtH,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA5BD,kCA4BC","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/** Bounded wrappers around `Bun.spawn*` for tests, so a stuck child cannot stall a suite. */\nexport class SpawnHelper {\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 */\n static 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 >(opts: Bun.SpawnOptions.SpawnSyncOptions<In, Out, Err> & { cmd: string[]; onExit?: undefined }) {\n const timeout = opts.timeout ?? SPAWN_TIMEOUT_MS;\n const result = Bun.spawnSync<In, Out, Err>({\n ...opts,\n timeout,\n killSignal: 'SIGKILL' as const,\n });\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 `[SpawnHelper.spawnSyncBounded] did not exit within ${timeout} ms, killed | cmd: ${opts.cmd.join(' ').slice(0, 200)}`,\n );\n }\n\n return result;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/dev-configs",
|
|
3
|
-
"version": "0.4.8-
|
|
3
|
+
"version": "0.4.8-1",
|
|
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",
|