npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tker/tsconfig

v2.0.0

Published

共享的 TypeScript 配置包,提供多种场景的 TSConfig 预设配置。

Readme

@tker/tsconfig

共享的 TypeScript 配置包,提供多种场景的 TSConfig 预设配置。

安装

pnpm add -D @tker/tsconfig

使用方式

在项目根目录创建 tsconfig.json,继承对应的配置:

Web 项目

适用于前端 Vue/React 项目:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@tker/tsconfig/web",
  "include": ["src"],
  "exclude": ["node_modules", "dist"]
}

Node.js 项目

适用于 Node.js 后端/脚本项目:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@tker/tsconfig/node",
  "include": ["src"],
  "exclude": ["node_modules", "dist"]
}

库项目

适用于需要生成类型声明文件的库项目:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@tker/tsconfig/library",
  "include": ["src"],
  "exclude": ["node_modules", "dist"]
}

配置说明

base.json

基础配置,包含所有场景共用的规则:

| 选项 | 值 | 说明 | |------|-----|------| | target | ESNext | 编译目标 | | module | ESNext | 模块系统 | | moduleResolution | bundler | 模块解析策略 | | strict | true | 严格模式 | | noUnusedLocals | true | 检查未使用变量 | | noUnusedParameters | true | 检查未使用参数 | | noImplicitAny | true | 禁止隐式 any | | verbatimModuleSyntax | true | 精确模块语法 | | skipLibCheck | true | 跳过类型库检查 |

web.json

Web 项目配置,继承 base.json 并添加:

| 选项 | 值 | 说明 | |------|-----|------| | jsx | preserve | JSX 保留原样 | | jsxImportSource | vue | Vue JSX 导入源 | | lib | ESNext, DOM, DOM.Iterable | 包含 DOM 类型 | | types | vite/client | Vite 客户端类型 | | useDefineForClassFields | true | 类字段定义方式 |

node.json

Node.js 项目配置,继承 base.json 并添加:

| 选项 | 值 | 说明 | |------|-----|------| | lib | ESNext | 仅 ES 类型 | | types | node | Node.js 类型 | | moduleResolution | bundler | Bundler 解析策略 |

library.json

库项目配置,继承 base.json 并添加:

| 选项 | 值 | 说明 | |------|-----|------| | jsx | preserve | JSX 保留原样 | | lib | ESNext, DOM, DOM.Iterable | 包含 DOM 类型 | | declaration | true | 生成 .d.ts 文件 | | noEmit | false | 允许输出文件 | | moduleResolution | node16 | Node16 解析策略 |

自定义配置

可以覆盖继承的配置:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "extends": "@tker/tsconfig/web",
  "compilerOptions": {
    "strictNullChecks": false,
    "noUnusedLocals": false
  },
  "include": ["src", "types"],
  "exclude": ["node_modules", "dist", "**/*.test.ts"]
}

严格规则说明

base.json 启用了以下严格检查:

  • strict - 启用所有严格选项
  • strictNullChecks - 严格的 null 检查
  • noImplicitAny - 禁止隐式 any 类型
  • noImplicitOverride - 要求 override 关键字
  • noImplicitThis - 禁止隐式 this
  • noUncheckedIndexedAccess - 索引访问返回 undefined
  • noFallthroughCasesInSwitch - 禁止 switch 穿透

License

MIT