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

dts-critic

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dts-critic

Checks a new .d.ts against the Javascript source and tells you what problems it has

  • 2.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20K
decreased by-36.61%
Maintainers
1
Weekly downloads
 
Created
Source

dts-critic

Checks a new dts against the Javascript sources and tells you what problems it has.

To use:

$ node index.js path-to-d.ts [path-to-source]

If the d.ts path is to a file named index.d.ts, the name of the directory will be used as the package name instead. For example ~/dt/types/jquery/index.d.ts will use jquery as the name.

path-to-source is optional; if you leave it off, the code will check npm for a package with the same name as the d.ts.

Current checks

  1. If no local path to source is provided, an npm package with the same name as the d.ts must exist.
  2. The d.ts and the source path must have the same name.
  3. If the d.ts has a Definitely Typed header and npm is used to obtain the path to the source, the homepage property of npm must be one of the entries in the Project field of the DT header.
  4. If the d.ts has a DT header and npm is used and the header specifies that the d.ts is for a non-npm package, the name of the d.ts must not conflict with an existing npm package.

Planned work

  1. Make sure your module structure fits the source.
  2. Make sure your exported symbols match the source.
  3. Make sure your types match the source types???
  4. Download source based on npm homepage (if it is github).

Note that for real use on Definitely Typed, a lot of these checks need to be pretty loose.

Also

$ node dt.js

Will run dts-critic on every directory inside ../DefinitelyTyped and print errors.

Keywords

FAQs

Package last updated on 31 Dec 2019

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