@djangocfg/typescript-config
v2.1.82
Published
Shared TypeScript configurations for Next.js, React libraries, and Node.js projects with strict type checking
Downloads
10,125
Maintainers
Readme
@djangocfg/typescript-config
Shared TypeScript configurations for Next.js, React libraries, and Node.js projects with strict type checking
Part of DjangoCFG — a modern Django framework for building production-ready SaaS applications. All @djangocfg/* packages are designed to work together, providing type-safe configuration, real-time features, and beautiful admin interfaces out of the box.
Overview
@djangocfg/typescript-config provides battle-tested TypeScript configurations for modern web development. It includes presets for Next.js applications, React component libraries, and general TypeScript projects.
Features
- Strict Mode - Maximum type safety with strict compiler options
- Next.js Preset - Optimized for Next.js App Router
- React Library Preset - Configured for publishing React packages
- Path Aliases - Standard path mapping configuration
- Modern Target - ES2022 output for modern runtimes
Installation
npm install -D @djangocfg/typescript-config
# or
pnpm add -D @djangocfg/typescript-config
# or
yarn add -D @djangocfg/typescript-configUsage
Next.js Application
{
"extends": "@djangocfg/typescript-config/nextjs.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}React Library
{
"extends": "@djangocfg/typescript-config/react-library.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}Base Configuration
{
"extends": "@djangocfg/typescript-config/base.json",
"compilerOptions": {
"outDir": "dist"
}
}Available Configs
| Config | Description |
|--------|-------------|
| base.json | Base strict TypeScript configuration |
| nextjs.json | Next.js App Router configuration |
| react-library.json | React component library configuration |
Compiler Options
All configurations include these strict options:
{
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"forceConsistentCasingInFileNames": true
}Documentation
Full documentation available at djangocfg.com
Contributing
Issues and pull requests are welcome at GitHub
License
MIT - see LICENSE for details
