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

import-sort-style-tenforce

v1.0.71

Published

Tenforce's import-sort style

Readme

import-sort-style-tenforce

GitHub package.json version (subfolder of monorepo) npm NPM

Tenforce's import style for import-sort. Based on import-sort-style-renke.

This is intended to be used as a custom style in conjuction with the import-sort library.

Setup guide

Add "import-sort-style-tenforce" as a (dev)dependency to your project (by inserting it in package.json) or adding it directly with:

yarn add import-sort-style-tenforce --dev

or

npm i import-sort-style-tenforce --save-dev

Using import-sort

In Visual Studio Code (as a plugin)

  1. Install the import-sort plugin in VSC.

  2. Configure the plugin by adding the following code snippet in your package.json

    "importSort": {
        ".js, .jsx, .es6, .es, .mjs, .ts, .tsx": {
            "parser": "babylon",
            "style": "tenforce"
        }
    }
  1. Done! The sorting gets triggered when hitting save or you can call it manually by selecting the "Sort imports" command (ctrl+shift+P). To save a file without sorting the imports select the "Save file without sorting imports" command.

Command Line

You can modify files and sort their imports automatically via the command line with the help of import-sort-cli.

Instructions (from the creator)


Sort your imports from the command line. Useful to sort all your files in bulk or from a script in your package.json.

Install it with npm install --save-dev import-sort-cli or use it directly with npx import-sort-cli.

ATTENTION: Since version 4 --write modifies file in-place. The old --overwrite flag was removed. The CLI now behaves closer to prettier's CLI. Also, the exit code is now 0 even when unsorted were sorted (unless --list-different is used.)

Usage: import-sort [OPTION]... [FILE/GLOB]...

Options:
  --list-different, -l  Print the names of files that are not sorted.  [boolean]
  --write               Edit files in-place.                           [boolean]
  --with-node-modules   Process files inside 'node_modules' directory..[boolean]
  --version, -v         Show version number                            [boolean]
  --help, -h            Show help                                      [boolean]

Tip: To sort the imports in all .ts/.tsx files in your project run:

(npx) import-sort-cli --write "./**/*.ts{,x}"

How it works

The imports are grouped and later sorted within those groups. New lines are added between certain groups.

Note: Global imports are imports outside the current page, local imports are inside it

The ordering and categorizing is as follows:

  • Absolute modules that aren't from tenforce and have no member

    import "Something"

New line

  • Absolute modules (not from tenforce) that have a namespace or default member

    import React from "react"

New line

  • Tenforce modules

    import { Action, ActionType } from "@tenforce/toolbox-button-push-react"

New line

  • Relative global imports that are not .tsx files and have no member

    import "../../../Defaults.scss"

  • Relative global imports that are not .tsx files

    import GlobalState from "../../../redux/global"

New line

  • Relative (local) imports that are not .tsx files and have no member

    import "./Page.scss"

  • Relative (local) imports that are not .tsx files

    import actions from "../../actions"

New line

  • Relative global imports (.tsx)

    import GridItem from "../../../components/widgets/components/GridItem"

  • Relative local imports (.tsx)

    import List from "../List.tsx"

New line