npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@clockblocker/ts7-plugin-sort-import-suggestions

v2.0.0

Published

Customize the priority of TypeScript auto-import suggestions, including TypeScript 7

Readme

@clockblocker/ts7-plugin-sort-import-suggestions

Customize the priority of TypeScript auto-import completions and missing-import quick fixes.

This fork supports both TypeScript generations:

  • TypeScript 5.3–6.x uses the original tsserver language-service plugin.
  • TypeScript 7 uses a small LSP proxy because the native TypeScript language server does not load JavaScript tsserver plugins.

The proxy only changes completion sortText values and the order of import code actions. Every other LSP message passes through unchanged to the project’s installed TypeScript 7 server.

| | Before | After | | ------------- | ----------- | ----- | | Auto complete | | | | Code fix | | |

TypeScript 7 setup

npm install -D typescript@^7 @clockblocker/ts7-plugin-sort-import-suggestions

If TypeScript 7 is already installed:

npm install -D @clockblocker/ts7-plugin-sort-import-suggestions

Keep the sorting configuration in tsconfig.json:

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@clockblocker/ts7-plugin-sort-import-suggestions",
        // Promote aliases and relative imports.
        "moveUpPatterns": ["@/", "\\.{1,2}/"],
        // Demote generated or build-output imports.
        "moveDownPatterns": ["dist"]
      }
    ]
  }
}

For VS Code, select the proxy as the workspace TypeScript 7 SDK in .vscode/settings.json:

{
  "js/ts.experimental.useTsgo": true,
  "js/ts.tsdk.path": "./node_modules/@clockblocker/ts7-plugin-sort-import-suggestions/bin"
}

Reload VS Code and accept the prompt to use the workspace TypeScript version. The workspace must be trusted because this setting launches code from node_modules.

For another LSP-capable editor, configure its TypeScript language-server command as:

node_modules/@clockblocker/ts7-plugin-sort-import-suggestions/bin/tsgo --lsp --stdio

The proxy locates and launches the TypeScript 7 installation belonging to the current project.

TypeScript 5.3–6.x setup

Install the fork and configure the plugin:

npm install -D @clockblocker/ts7-plugin-sort-import-suggestions
{
  "compilerOptions": {
    "plugins": [
      {
        "name": "@clockblocker/ts7-plugin-sort-import-suggestions",
        "moveUpPatterns": ["@/", "\\.{1,2}/"],
        "moveDownPatterns": ["dist"]
      }
    ]
  }
}

Configure the editor to use TypeScript from the project’s node_modules. In VS Code, run TypeScript: Select TypeScript Version and choose Use Workspace Version.

Configuration

moveUpPatterns and moveDownPatterns are arrays of JavaScript regular-expression strings matched against the import module specifier. Invalid patterns are ignored and reported on stderr by the TS7 proxy.

Defaults:

{
  "moveUpPatterns": ["@/", "\\.{1,2}/"],
  "moveDownPatterns": []
}

The nearest tsconfig.json or jsconfig.json is used for each document. Relative and package-based extends configurations are supported.

Development

Requirements: Node.js 18 or newer.

npm install
npm test
npm run typecheck

The test suite exercises the legacy TypeScript 6 plugin, the sorting functions, and a real TypeScript 7 native language-server process.

For background on TypeScript 7’s native language server and plugin transition, see Microsoft’s TypeScript 7 announcement and API extensibility roadmap.