Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tsserver-lean

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsserver-lean

lean subset of tsserver that only supports typechecking

  • 0.0.0-pre-alpha.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
Maintainers
1
Weekly downloads
 
Created
Source

lean-tsserver

Implements a tiny sub-set of tsserver, also using different internal APIs. Its reason d'etré is to i) emit diagnostics for a particular TypeScript module; ii) doing the least amount of work possible.

High-level working description

Whenever a request for diagnostics for module a.ts is issued, it finds a.ts' project , and creates a TypescriptProject and a ProjectService for the a.ts' project. The former is essentially a wrapper to 's config options (references, fileNames, compilerOptions, etc), while the latter is a wrapper to LanguageService.

So, the overview of the process becomes:

  1. We find and resolve all of a.ts' direct dependencies
  2. For all of those dependencies, emit their declaration files; here, if the import statement is a named specifier (import x from 'project/a/b'), we only emit for b.ts
  3. Create/read from memory a.ts' ProjectService
  4. Call projectService.languageService.getSemanticDiagnostic and languageService.getSyntacticDiagnostic
  5. Immediately write to stdout through a callback

Supported commands

Type check a module

{ "command": "geterr", "type": "request", "seq": 0, "arguments": { "files": ["path/a/.ts", "path/b/.ts"] } }

{ "command": "geterr", "type": "request", "seq": 0, "arguments": { "files": ["/workspaces/client-web/packages/hybridspace/hybridspace-places-selector/src/components/PlacesFinderResult.tsx"] } }

Handshake

Used as a first message sent to stdout to indicate a successful start-up.

{ "command": "handhsake", "type": "request", "seq": 0 }

FAQs

Package last updated on 11 Apr 2023

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