/** * @factory/config — shared toolchain configuration. * * The canonical artifacts live next to this module; they are also exported * from here so tooling (build scripts, codegen, CI checks) can consume them * programmatically without hardcoding paths: * * ```ts * import { baseCompilerOptions, prettierBase, eslintBaseConfig } from "@factory/config"; * ``` * * JSON is loaded via `createRequire` — static JSON imports would need import * attributes on Node, and this keeps the package importable both in Node * (source-first) and in any bundler. */ import { createRequire } from "node:module"; import eslintBaseConfig from "./eslint.base.js"; const require = createRequire(import.meta.url); interface TsconfigBaseShape { compilerOptions: Record; } /** Compiler options shared by every package and app (see tsconfig.base.json). */ export const baseCompilerOptions: Record = ( require("./tsconfig.base.json") as TsconfigBaseShape ).compilerOptions; /** Prettier settings shared by every package and app (mirrors root .prettierrc.json). */ export const prettierBase: Record = require("./prettier.base.json"); /** * ESLint base (eslintrc shape, matching root .eslintrc.json conventions). * Named re-export so `import { eslintBaseConfig } from "@factory/config"`. */ export { eslintBaseConfig }; export type EslintBaseConfig = typeof eslintBaseConfig; /** * Convenience: the `extends` entry a new package tsconfig should use (relative * to packages//), plus the include globs. */ export const newPackageTsconfig = { extends: "../../tsconfig.json", compilerOptions: { noEmit: true }, include: ["src"], } as const;