@denaro-config/tsconfig

1.4.8 • Public • Published

@denaro-config/tsconfig

🎉 前端工程化中的 tsconfig 通用配置, 提供多种打包场景的 tsconfig 配置, 您可以执行进行继承使用。

npm (scoped) NPM

GitHub repo size GitHub Repo stars GitHub issues GitHub top language

npm jsDelivr hits (npm scoped)

参考官网地址

tsconfig.json

安装至您的项目

npm install -D @denaro-config/tsconfig
# or
pnpm install -D @denaro-config/tsconfig
# or
yarn add -D @denaro-config/tsconfig

使用

在项目根目录下创建 tsconfig.json 文件, 参考配置内容如下:

  • CommonJS
{
  "extends": "@denaro-config/tsconfig/tsconfig.json"
}
  • ESNext
{
  "extends": "@denaro-config/tsconfig/tsconfig.esnext.json"
}
  • Vue3
{
  "extends": "@denaro-config/tsconfig/tsconfig.vue3.json"
}
  • Vite+Vue 项目

  • tsconfig.json

{
  "files": [],
  "references": [
    {
      "path": "./tsconfig.node.json"
    },
    {
      "path": "./tsconfig.app.json"
    }
  ]
}
  • tsconfig.app.json
{
  "extends": "@denaro-config/tsconfig/tsconfig.vue3.json",

  "include": [
    "env.d.ts",
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "tests/**/*.ts",
    "tests/**/*.tsx"
  ],

  "exclude": ["src/**/__tests__/*", "node_modules", "lib", "dist"]
}
  • tsconfig.node.json
{
  "extends": "@denaro-config/tsconfig/tsconfig.node.json",

  "include": [
    "vite.config.*",
    "vitest.config.*",
    "cypress.config.*",
    "nightwatch.conf.*",
    "playwright.config.*"
  ]
}

结合 eslint 使用

参考 typescript

Package Sidebar

Install

npm i @denaro-config/tsconfig

Weekly Downloads

12

Version

1.4.8

License

MIT

Unpacked Size

7.95 kB

Total Files

10

Last publish

Collaborators

  • vxhly