@oldbros/tsconfig

1.0.2 • Public • Published

@oldbros/tsconfig

OldBros recommended typescript configuration

Installing

npm install --save-dev @oldbros/tsconfig

Usage

Add this line to your tsconfig.json file:

{
  "extends": "@oldbros/tsconfig"
}

Add check script to your package.json file:

{
  "scripts": {
    "check": "npx tsc --project ."
  }
}

Run npm run check command to check js files with ts compiler

Code examples

Features

  • Support latest ECMAScript2022 language features
  • Uses ECMAScript Modules
  • Recommended for NodeJS v18 and higher
  • No typescript experimental features

Description

This configuration is to check JavaScript with TypeScript compiler.

Why doesn't OldBros use TypeScript as a main language:

  1. There is no TypeScript RFC. Nobody knows what TypeScript actually is in details.
  2. TypeScript is not a JavaScript superset. It does not support all JavaScript syntax such as await new and many others
  3. TypeScript specific features. Enums, Namespaces, Decorators, private keyword (there are native js private fields)

Why OldBros uses TypeScript compiler for JavaScript:

  1. Explicit interfaces. They are especially useful for designing libraries and applications.
  2. IDE autocompletion and hints. Those are quite useful during development time.
  3. More elegant than JSDoc. The problem with JSDoc - it is quite heavy compare to TypeScript types.
  4. Disctinct types and interfaces declarations with d.ts files are sometimes useful.

Package Sidebar

Install

npm i @oldbros/tsconfig

Weekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

3.84 kB

Total Files

4

Last publish

Collaborators

  • georgoldenb