Editor setup

Type-checked JavaScript in Sublime Text

  • Sublime Text
  • LSP + LSP-typescript packages

Sublime Text talks to language servers through the LSP package. The LSP-typescript package adds JavaScript and TypeScript support on top of it by running typescript-language-server, which wraps TypeScript's own server, so the errors in a checked .js file are tsc's errors.

Install both from Package Control and restart. LSP-typescript installs and updates the server itself (its server_path setting is auto), so there is nothing to install with npm.

At a glance

EditorSublime Text
What to installLSP + LSP-typescript packages
What checks the codeThe LSP package, with the LSP-typescript helper package running typescript-language-server
Where its TypeScript comes fromDecided by typescript-language-server, which LSP-typescript installs and updates itself; it can use the workspace's TypeScript or a tsserver.path you set
Readsjsconfig.json, tsconfig.json
How this page was checkedNot run in Sublime Text for this page. The settings are from the LSP package's documentation and the LSP-typescript README and default settings linked below; what the server reports comes from TypeScript's language service, which the site's tests run.

Settings, and loose files without a jsconfig.json

Open Preferences: LSP-typescript Settings from the Command Palette. In a project with a jsconfig.json, the server reads checkJs and the rest from that file. For JavaScript files outside any project, the package's default settings have implicitProjectConfiguration.checkJs set to false; set it to true to check them too, like VS Code's js/ts.implicitProjectConfig.checkJs.

LSP-typescript.sublime-settings
{
  "settings": {
    // check .js files that no jsconfig.json covers
    "implicitProjectConfiguration.checkJs": true
  }
}

Which TypeScript it runs

The package's initialization_options include tsserver.path, empty by default. Per the typescript-language-server documentation, the server then uses the workspace's TypeScript when it can find one, and otherwise a fallback or its bundled copy; tsserver.path takes the path to a typescript/lib directory or its tsserver.js. Keeping typescript in the project's dev dependencies gives it the same version npm run lint runs.

What differs from tsc

Diagnostics show as underlines and gutter icons in open files; the Goto Diagnostic command lists them. TypeScript's suggestions arrive too, though tsc never prints them. The server's diagnostics.ignoredCodes setting can hide codes in the editor, which then disagrees with tsc on purpose: leave it empty unless you also silence those codes in the build.

Make sure it matches tsc

Run npm run lint in a terminal (or as a Sublime build system), open a reported file, and compare the codes. If the editor shows nothing for a file tsc reports, check that the file is inside the folder you opened: the LSP package filters out diagnostics for files outside the workspace folders.

Gotchas

  • In Sublime Text 3 the TypeScript and TSX syntaxes need extra packages; Sublime Text 4 has them built in, per the LSP-typescript README.
  • For Flow projects the README shows how to narrow the package's selector so the server leaves Flow files alone.

Sources

Last reviewed 20 October 2026.