Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

check-dts

ai5.5kMIT0.8.2

Unit tests for .d.ts TypeScript definitions

typescript, types, test, check

readme

Check TypeScript Definitions

Unit tests for .d.ts TypeScript definitions in your JavaScript open source library.

It is useful for non-TypeScript project, which wants to provide typing support for TypeScript users and autocompletion for IDE and text editors.

It becomes especially useful for complex types with generics, like we have in Nano Events or Storeon.

// Negative test: test/index.errors.ts
import lib = require('../')

interface Events {
  'set': (a: string, b: number) => void
}
// THROWS Expected 3 arguments, but got 2
lib.on<Events>('set', 2)
// Positive test: test/index.types.ts
import lib = require('../')

interface Events {
  'set': (a: string, b: number) => void
}
lib.on<Events>('set', 'prop', 1)
Print Snapshots example Sponsored by Evil Martians

Docs

Read full docs here.

changelog

Change Log

This project adheres to Semantic Versioning.

0.8.2

  • Fixed regression.

0.8.1

  • Fixed undefined error message on non-string errors from TS.
  • Fix CLI output on error during TS check.

0.8.0

  • Fixed reporting errors not associated with a file (by @nawatts).
  • Removed Node.js 14 and Node.js 16 support.

0.7.2

  • Fix rare TypeScript errors support (by Brian Takita).

0.7.1

  • Fixed support of extends in tsconfig.json (by Bijela Gora).

0.7

  • Removed Node.js 12 support.
  • Fixed comments support in tsconfig.json (by @shrpne).

0.6.7

  • Updated nanospinner.

0.6.6

  • Updated nanospinner.

0.6.5

  • Updated nanospinner.

0.6.4

  • Fixed TypeScript 4.5 support.

0.6.3

  • Updated nanospinner.

0.6.2

  • Fixed spinner.

0.6.1

  • Fixed typescript peer dependencies.

0.6

  • Moved TypeScript to peer dependencies.
  • Replaced nanocolors dependency with picocolors.
  • Replaced mico-spinner dependency with nanospinner.
  • Reduced dependencies by moving from globby to fast-glob.

0.5.6

  • Replaced coloretter dependency with nanocolors.

0.5.5

  • Fixed for missed allowJs in custom tsconfig.json.

0.5.4

  • Fixed custom tsconfig.json support (by Vladimir Dementyev).

0.5.3

  • Fixed package.engines (by @chenaski).

0.5.2

  • Fixed Windows support (by Vasilii Kovalev).

0.5.1

  • Removed development dependency.

0.5

  • Dropped Node.js 10 support.
  • Reduced dependencies.

0.4.4

  • Fixed ES modules support.

0.4.3

  • Fixed module support in custom tsconfig.json.

0.4.2

  • Fixed moduleResolution support in custom tsconfig.json.

0.4.1

  • Reduced dependencies number.

0.4

  • Added files arguments (by Budleigh Salterton).
  • Changed output to be able to click on line.

0.3.3

  • Use TypeScript 4.

0.3.2

  • Replace color output library.

0.3.1

  • Reduce dependencies.

0.3

  • Use custom tsconfig.json.

0.2

  • Prohibit implicit any.

0.1.4

  • Show errors from node_modules.

0.1.3

  • Allow to put type tests outside of test/.

0.1.2

  • Fix Node.js 10 support.

0.1.1

  • Fix tests list.

0.1

  • Initial release.