Skip to content

ras-sh/typescript-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@ras-sh/typescript-config

⚙️ Shared TypeScript configuration for ras.sh projects.

Installation

pnpm add -D @ras-sh/typescript-config

Usage

Choose the configuration that matches your project type and extend it in your tsconfig.json:

TanStack Start

For TanStack Start applications with file-based routing and server functions:

{
  "extends": "@ras-sh/typescript-config/tanstack-start.json",
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "~/*": ["./src/*"]
    }
  },
  "include": ["**/*.ts", "**/*.tsx"],
  "exclude": ["node_modules", "dist"]
}

Next.js

For Next.js applications (App Router or Pages Router):

{
  "extends": "@ras-sh/typescript-config/nextjs.json",
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
  "exclude": ["node_modules", ".next"]
}

React Library

For React component libraries built with bundlers (tsup, Vite, Rollup):

{
  "extends": "@ras-sh/typescript-config/react-library.json",
  "include": ["src/**/*.ts", "src/**/*.tsx"],
  "exclude": ["node_modules", "dist"]
}

Base

For Node.js packages and libraries:

{
  "extends": "@ras-sh/typescript-config/base.json",
  "compilerOptions": {
    "outDir": "dist",
    "rootDir": "src"
  },
  "include": ["src/**/*.ts"],
  "exclude": ["node_modules", "dist"]
}

Available Configurations

  • nextjs.json - for Next.js projects
  • tanstack-start.json - for TanStack Start projects
  • react-library.json - for React libraries
  • base.json - the base configuration

License

MIT License - see the LICENSE file for details.

About

⚙️ Shared TypeScript configuration for ras.sh projects.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published