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

@hootool/typescript-config

v0.1.3

Published

共享 TypeScript 配置基准

Readme

@hootool/typescript-config

共享 TypeScript 配置基准,提供 5 种场景的 tsconfig。

安装

pnpm add -D @hootool/typescript-config typescript

可用配置

| 配置文件 | 适用场景 | |---------|---------| | tsconfig.base.json | 通用严格模式基准(其他配置继承自此) | | tsconfig.react-web.json | React/H5/Web 项目 | | tsconfig.react-native.json | React Native 项目(无 DOM lib) | | tsconfig.vue.json | Vue 3 项目 | | tsconfig.node.json | Node.js/CLI 工具(NodeNext 模块) |

使用

// tsconfig.json(React/H5 项目)
{
  "extends": "@hootool/typescript-config/tsconfig.react-web.json",
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["src"]
}

路径别名(paths)和 include 需在消费者项目中自行定义,共享配置不包含相对路径设置。

基准配置要点(tsconfig.base.json)

  • target: ES2022
  • strict: true(完整严格模式)
  • moduleResolution: bundler
  • verbatimModuleSyntax: true(类型导入使用 import { type Foo } 或纯类型文件的 import type,与 ESLint 内联 type specifier 对齐)
  • moduleDetection: force
  • noImplicitOverride: true
  • noUnusedLocals / noUnusedParameters: true
  • skipLibCheck: true

各场景差异

| 配置 | jsx | lib | module | noEmit | |------|-----|-----|--------|--------| | react-web | react-jsx | ES2022 + DOM | ESNext | true | | react-native | react-jsx | ES2022(无 DOM) | ESNext | true | | vue | preserve | ES2022 + DOM | ESNext | true | | node | - | ES2022 | NodeNext | false(输出到 dist) |

注意

  • node 场景使用 NodeNext 模块 + verbatimModuleSyntax,要求消费者项目 package.json 设置 "type": "module"
  • 装饰器(experimentalDecorators)未包含在基准中,需要时请在项目中自行开启