@wsxjs/wsx-tsconfig
v0.0.17
Published
Shared TypeScript configuration for WSX Framework projects
Maintainers
Readme
@wsxjs/wsx-tsconfig
Shared TypeScript configuration for WSX Framework projects.
Installation
npm install --save-dev @wsxjs/wsx-tsconfigUsage
Basic Setup
Extend the base configuration in your tsconfig.json:
{
"extends": "@wsxjs/wsx-tsconfig/tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist"
},
"include": ["src/**/*"]
}With Build Output
If you need to emit declaration files:
{
"extends": "@wsxjs/wsx-tsconfig/tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*"],
"exclude": ["dist", "node_modules"]
}Development Only (No Emit)
For development projects that don't need to emit files:
{
"extends": "@wsxjs/wsx-tsconfig/tsconfig.json",
"include": ["src/**/*"]
}What's Included
The base configuration includes:
- ✅ JSX Support:
jsx: "react-jsx"withjsxImportSource: "@wsxjs/wsx-core" - ✅ Decorator Support:
experimentalDecorators: trueanduseDefineForClassFields: false(required for@statedecorator) - ✅ Modern ES Features: ES2020 target with ESNext modules
- ✅ Type Safety: Strict mode enabled with additional checks
- ✅ WSX Types: Automatically includes
@wsxjs/wsx-coretypes
Configuration Details
Required Options for @state Decorator
The configuration includes these critical options for @state decorator support:
{
"experimentalDecorators": true,
"useDefineForClassFields": false
}Important: Without these options, the @state decorator will not work correctly.
Examples
Vite Project
{
"extends": "@wsxjs/wsx-tsconfig/tsconfig.base.json",
"compilerOptions": {
"noEmit": true
},
"include": ["src/**/*", "src/**/*.wsx"]
}Library Package
{
"extends": "@wsxjs/wsx-tsconfig/tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"declaration": true,
"declarationMap": true
},
"include": ["src/**/*"],
"exclude": ["dist", "node_modules", "**/__tests__/**"]
}Test Configuration
{
"extends": "@wsxjs/wsx-tsconfig/tsconfig.base.json",
"compilerOptions": {
"types": [
"@wsxjs/wsx-core",
"@testing-library/jest-dom",
"vitest/globals"
]
},
"include": ["src/**/*", "src/**/*.test.ts"]
}Related Packages
@wsxjs/wsx-core- Core WSX Framework@wsxjs/wsx-vite-plugin- Vite plugin (required for@statedecorator)
License
MIT
