π Search Terms
expose tsconfig.json types to developers
β
Viability Checklist
β Suggestion
It'd be nice if TypeScript developers could enforce that an object is consistent with tsconfig.json.
π Motivating Example
If you're creating a tool that initializes a project that uses TypeScript, you can ensure the tsconfig.json you're composing in your source code is valid.
const tsConfig: TSConfig = {
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"strict": true,
"module": "NodeNext"
}
};
fs.writeFileSync(
path.join(root, "tsconfig.json"),
JSON.stringify(tsConfig, null, 2)
);
π» Use Cases
- What do you want to use this for?
I'm building a tool that initializes a TypeScript project with other dependencies.
It'd be kind of nice if I could be 100% certain the tsconfig.json I'm composing in my source code is valid.
fs.writeFileSync(
path.join(root, "tsconfig.json"),
JSON.stringify(
{
compilerOptions: {
target: "ESNext",
module: "CommonJS",
jsx: "react-jsx",
},
include: ["src"],
exclude: ["node_modules"],
},
null,
2
)
);
- What shortcomings exist with current approaches?
In .ts source code, TypeScript doesn't verify if a tsconfig.json file being written to disk is valid or not.
- What workarounds are you using in the meantime?
I'm copying over an existing tsconfig.json file from a template/ subdirectory.
π Search Terms
expose
tsconfig.jsontypes to developersβ Viability Checklist
β Suggestion
It'd be nice if TypeScript developers could enforce that an object is consistent with
tsconfig.json.π Motivating Example
If you're creating a tool that initializes a project that uses TypeScript, you can ensure the
tsconfig.jsonyou're composing in your source code is valid.π» Use Cases
I'm building a tool that initializes a TypeScript project with other dependencies.
It'd be kind of nice if I could be 100% certain the
tsconfig.jsonI'm composing in my source code is valid.In
.tssource code, TypeScript doesn't verify if atsconfig.jsonfile being written to disk is valid or not.I'm copying over an existing
tsconfig.jsonfile from atemplate/subdirectory.