Reusable TypeScript configs.
npm install @rajzik/config-typescriptFactory functions for creating preset TypeScript configurations.
Primarily used in unison with the Lumos CLI.
Update package.json:
``json`
{
"lumos": {
"typescript": {
"allowSyntheticDefaultImports": true
}
}
}
Create file in configs folder:
configs/typescript.js
`js`
modules.exports = {
allowSyntheticDefaultImports: true,
};
`ts`
export interface TypeScriptOptions {
buildFolder: string;
includeTests?: boolean;
library?: boolean;
next?: boolean;
node?: boolean;
react?: boolean;
usingNext?: boolean;
srcFolder: string;
testsFolder: string;
typesFolder: string;
workspaces?: string[];
emitDeclarationOnly?: boolean;
allowJs?: boolean;
skipLibCheck?: boolean;
}
`ts`
{
library = false,
next = false,
node = false,
react = false,
usingNext = false,
emitDeclarationOnly = false,
srcFolder = 'src',
allowJs = false,
skipLibCheck = false,
}
- --[no-]cleanoutDir
- clean the target before transpiling. Defaults to true.--reference-workspaces
- / --reference-workspaces=false
- automatically generate project references based on workspace dependency graph. Defaults to
.--emitDeclarationOnly
- --noEmit
- emit d.ts files only
- --buildFolder=
- include tests
- --srcFolder=
- sets build folder
- --testsFolder=
- sets src folder
- --typesFolder=
- sets tests folder
-
- sets types folder
Example:
`bash``
lumos typescript --emitDeclarationOnly --typesFolder=types