UNPKG

@aristobyte-ui/typescript-config

Version:

Shared TypeScript config presets used across AristoByteUI platform and packages.

152 lines (116 loc) โ€ข 5.04 kB
# `@aristobyte-ui/typescript-config` <p align="center"> <img src="https://img.shields.io/badge/TypeScript-5.8-blue?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript" /> <img src="https://img.shields.io/badge/Build-Turbo-green?style=for-the-badge&logo=turbo&logoColor=white" alt="TurboRepo" /> <img src="https://img.shields.io/badge/Lint-Strict-red?style=for-the-badge&logo=eslint&logoColor=white" alt="ESLint" /> <img src="https://img.shields.io/badge/License-MIT-black?style=for-the-badge&logo=open-source-initiative&logoColor=white" alt="License" /> <img src="https://img.shields.io/badge/AristoByte-UI-purple?style=for-the-badge&logo=react&logoColor=white" alt="AristoByte UI" /> <img src="https://img.shields.io/badge/Node-20.17.0+-339933?style=for-the-badge&logo=node.js&logoColor=white" alt="Node.js >=20.17.0" /> <img src="https://img.shields.io/badge/Yarn-1.22+-2C8EBB?style=for-the-badge&logo=yarn&logoColor=white" alt="Yarn >=1.22" /> <img src="https://img.shields.io/badge/NPM-10.8+-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="NPM >=10.8" /> </p> Centralized **TypeScript configuration presets** for the AristoByte UI ecosystem. Opinionated, consistent, and production-ready. ## ๐Ÿš€ Overview `@aristobyte-ui/typescript-config` provides **shared TypeScript configurations** that enforce strict standards across all AristoByte UI packages. This ensures: - ๐Ÿ”’ **Consistency** across the monorepo ecosystem. - โšก **Developer Velocity** by removing redundant boilerplate. - ๐Ÿ“ฆ **Scalability** with unified upgrades and evolving presets. - ๐Ÿงน **Clean output** with correct declaration mapping for distributable packages. ## ๐Ÿ“ฆ Installation ```bash # Install via Yarn yarn add -D @aristobyte-ui/typescript-config # Or via npm npm install -D @aristobyte-ui/typescript-config # Or via pnpm pnpm add -D @aristobyte-ui/typescript-config ``` ## ๐Ÿ›  Usage In your `tsconfig.json,` extend one of the provided presets. **Base configuration (for libraries):** ```json { "extends": "@aristobyte-ui/typescript-config/base", "compilerOptions": { "outDir": "dist", "declarationDir": "dist/types" }, "include": ["src", "index.ts"] } ``` **React packages:** ```json { "extends": "@aristobyte-ui/typescript-config/react", "include": ["components", "index.ts"], "exclude": ["dist", "node_modules"] } ``` **Next.js projects:** ```json { "extends": "@aristobyte-ui/typescript-config/next", "include": ["app", "pages", "components"], "exclude": ["dist", "node_modules"] } ``` **Package-ready builds (library publishing):** ```json { "extends": "@aristobyte-ui/typescript-config/package", "include": ["src"], "exclude": ["dist", "node_modules"] } ``` ## ๐Ÿ“‚ Presets Available - `base` โ†’ Strict, modern TypeScript defaults for libraries. - `react` โ†’ Extends `base` with React + JSX optimizations. - `next` โ†’ Opinionated config optimized for Next.js projects. - `package` โ†’ Publishing-friendly output with declarations and ESNext module resolution. ## ๐Ÿ”ง Example in a Package `package.json`: ```json { "name": "@aristobyte-ui/button", "version": "1.0.0", "scripts": { "build": "tsup" }, "devDependencies": { "@aristobyte-ui/typescript-config": "*", "typescript": "^5.8.3" } } ``` `tsconfig.json`: ```json { "extends": "@aristobyte-ui/typescript-config/react", "include": ["components", "index.ts"] } ``` ## ๐Ÿ“Š Why This Matters | Feature | Benefit | | -------------------------------- | ------------------------------------- | | `strict: true` | Eliminates runtime edge cases early | | `noUncheckedIndexedAccess: true` | Safer array/object access | | `declaration: true` | Ensures correct `.d.ts` output | | `jsx: react-jsx` | Optimized for React 17+ and beyond | | `incremental` | Faster rebuilds in monorepo workflows | | `moduleResolution: NodeNext` | Modern interoperability for ESM/CJS | ## ๐Ÿ† Philosophy At **AristoByte UI**, we believe **configuration should empower, not obstruct**. This package encapsulates our best practices into **ready-to-consume presets** that evolve alongside the ecosystem. ## ๐Ÿ“œ License [MIT](./LICENSE) ยฉ AristoByte ## ๐Ÿ›ก Shields Showcase <p align="center"> <img src="https://img.shields.io/badge/Consistency-100%25-green?style=for-the-badge&logo=typescript" /> <img src="https://img.shields.io/badge/Maintained-Active-brightgreen?style=for-the-badge&logo=github" /> <img src="https://img.shields.io/badge/Strictness-High-critical?style=for-the-badge&logo=eslint" /> <img src="https://img.shields.io/badge/Declarations-Enabled-blue?style=for-the-badge&logo=typescript" /> <img src="https://img.shields.io/badge/Monorepo-Turbo-green?style=for-the-badge&logo=monorepo" /> <img src="https://img.shields.io/badge/Interop-ESM%2FCJS-orange?style=for-the-badge&logo=javascript" /> </p>