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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tsconfigs

v5.0.0

Published

Reusable TypeScript configuration files to extend from.

Downloads

6,008

Readme

⚙️ tsconfigs ✨

Renovate enabled Build Status Badge: npm version badge for package tsconfigs

Reusable TypeScript configuration files

Contents

Overview

Say you're starting a new TypeScript project. And you're setting up the tsconfig.json. If you're a TypeScript wizard 🧙‍ you quickly fill in some options and you're done. But If you're a meer mortal like most of us, you go back to the documentation every time 🤔. After several times of that I decided to write this little project 💡.

If your project is one of the following kinds of projects, you could extend from one of them, instead of writing your own from blank. And then you could override any options necessary.

Project kinds

| | Module ⚙️ | Executable 🚄 | |-| ------ | ---------- | | Browser 🌐 | browser-module | browser-executable | | Web Worker ⛏️ | webworker-module | | Node.js ⬡ | nodejs-module | nodejs-executable | | Agnostic 🏳️ | agnostic-module |

Example

Install this package (tsconfigs) and in your tsconfig.json:

{
  "extends": "tsconfigs/nodejs-executable", // 🎆
  "compilerOptions": {
    "outDir": "lib"
  },
  "include": [
    "src/**/*"
  ]
}

Scope

Executable project options

| Option | Default value | Our value | Comment | | ------ | ------------------ | --------- | ----------- | | composite | true | false | It seems to have no benefit for executables and it necessitates generation of declaration files, which seem useless in executables, as well.

Module project options

| Option | Default value | Our value | Comment | | ------ | ------------------ | --------- | ----------- | | declaration | false | true | Because we'd like to provide the importer with type definitions. |

Environment

Browser project options

| Option | Default value | Our value | | ------ | ------------------ | --------- | | lib | depends | ["ESNext","DOM"] | | module | depends | "ESNext" |

Web Worker project options

| Option | Default value | Our value | | ------ | ------------------ | --------- | | lib | depends | ["ESNext","WebWorker"] | | module | depends | "ESNext" |

Node.js project options

| Option | Default value | Our value | Comment | | ------ | ------------------ | --------- | ------- | | lib | depends | ["ESNext"]. | You'd most likely also like to install the @types/node package. | | module | depends | "CommonJS" |

Agnostic project options

| Option | Default value | Our value | Comment | | ------ | ------------------ | --------- | ------- | | lib | depends | ["ESNext"] | | module | depends | "CommonJS" | While for small packages, CommonJS could be just fine, for larger packages, where the ability to perform tree shaking is desirable, it seems that the agnostic project author should consider providing two builds. One CommonJS build and one ES modules build.

Common project options

| Option | Default value | Our value | Comment | | ------ | ------------------ | --------- | ----------- | | allowSyntheticDefaultImports | depends | true | Stack Overflow question | | esModuleInterop | false | true | Stack Overflow question | forceConsistentCasingInFileNames | false | true | While it does not enforce case sensitivity, it at least enforces consistent casing across references. | | moduleResolution | depends | "node" | The de-facto standard. | | newLine | depends | "LF" | For the sake of consistent build artifacts cross-platform. | | noErrorTruncation | false | true | Screenshots: false / true | | resolveJsonModule | false | true | Seems like a popular feature that does not involve drawbacks. | | sourceMap | false | true | We have chosen regular source maps because it seems like the simple choice that would serve most projects. | strict | false | true | See Strictness. | | target | "es3" | "esnext" | Down-transpilation is outside the scope of this project. Also, consider using Babel instead of TypeScript for that. |

Strictness

We presume that strict type checking is generally desirable.

New type checking features in future releases of TypeScript are, per policy, turned off by default, for backward compatibility. Effectively making new type features, opt-in.

The strict option, however, turns on a set of strict type checking options. New strict options from future TypeScript releases will be included in it, effectively making new type checking features opt-out.

tsconfigs maintains the opt-out behavior: we turn strict on and yet keep the individual type check options that it includes, off.

Paths

We would love to include some path options like include and outDir but we feel that it would not be reliable, because TypeScript resolves relative paths from the configuration file in which they appear and not from the end-configuration file. See this issue.

Test coverage

There are both unit and integration tests for each config.