New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cuckoointernet/tsconfig

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cuckoointernet/tsconfig

These are base shared `tsconfig.json`s from which all other `tsconfig.json`'s inherit from.

  • 0.1.5
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-85.71%
Maintainers
0
Weekly downloads
 
Created
Source

tsconfig

These are base shared tsconfig.jsons from which all other tsconfig.json's inherit from.

@cuckoointernet/tsconfig/base.json
├── @cuckoointernet/tsconfig/esm.json
│   └── @cuckoointernet/tsconfig/esm-jsx.json
├── @cuckoointernet/tsconfig/cjs.json
│   └── @cuckoointernet/tsconfig/cjs-jsx.json
└── @cuckoointernet/tsconfig/nextjs.json

Usage

Finding source files

Define include, exclude, compilerOptions.rootDir, and compilerOptions.outDir yourself.

{
  "extends": "@cuckoointernet/tsconfig/nextjs.json",
  "include": ["next-env.d.ts", "src/**/*.mdx", "src/**/*.ts", "src/**/*.tsx"],
  "exclude": ["node_modules", "out"],
  "compilerOptions": {
    "rootDir": "./src",
    "outDir": "./dist"
  }
}

Managing test files

  1. If you include test files in your tsconfig.json
    • ✅ TypeScript and VSCode will type check your test files
    • ❌ Test files will end up in your ./dist
  2. If you exclude test files from your tsconfig.json
    • ❌ TypeScript and VSCode will not type check your test files
    • ✅ Test files will not end up in your ./dist

To avoid this, use your tsconfig.json for type checking everything (source and tests) but define separate eg. tsconfig.build.json files which exclude your tests when building your project.

Example

{
  "main": "./dist/cjs/index.js",
  "types": "./dist/esm/index.d.ts",
  "exports": {
    ".": {
      "import": "./dist/esm/index.js",
      "require": "./dist/cjs/index.js"
    }
  },
  "files": ["./dist/**"],
  "scripts": {
    "build:cjs": "tsc --project tsconfig.cjs.json",
    "build:esm": "tsc --project tsconfig.esm.json",
    "build": "npm run clean && npm run build:esm && npm run build:cjs",
    "clean": "rm -rf dist",
    "dev:cjs": "tsc --watch --project tsconfig.cjs.json",
    "dev:esm": "tsc --watch --project tsconfig.esm.json",
    "dev": "concurrently 'npm:dev:esm' 'npm:dev:cjs'"
  }
}

Summary

@cuckoointernet/tsconfig/base.json

The Default/Base/Root config which everything else inherits from, here we define how strict we want our packages to be by default.

@cuckoointernet/tsconfig/esm.json

To be used when building for modern browsers.

@cuckoointernet/tsconfig/esm-jsx.json

To be used when building React projects for modern browsers.

@cuckoointernet/tsconfig/cjs.json

To be used when building for older browsers.

@cuckoointernet/tsconfig/cjs-jsx.json

To be used when building React projects for older browsers.

@cuckoointernet/tsconfig/nextjs.json

To be used with Next.js projects.

FAQs

Package last updated on 03 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc