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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@helljs/eslint-import-resolver-x

v1.1.0

Published

This plugin adds support `jsconfig` or `tsconfig` aliases to `eslint-plugin-import`

Readme

eslint-import-resolver-x

This resolver adds TypeScript or JavaScript import support to eslint-plugin-import with tsconfig.json or jsconfig.json aliases (compilerOptions.paths)

Performance

This is fork of eslint-import-resolver-typescript but much faster and more efficient. You can save time on project linting by (~30-40%).

eslint-import-resolver-x vs eslint-import-resolver-typescript

We use strace package for count of fstat call when linting codebase

For example you codebase has multiple packages with 100 000 LOC ()

The following data depends directly on the number of imports in your case, but the comparison table is filled with data on the same code base

| syscall | eslint-import-resolver-x | eslint-import-resolver-typescript | | ---------- | ------------------------ | --------------------------------- | | access | 52 900 | 50 641 | | chdir | 1 | 1 | | execve | 78 | 78 | | faccessat2 | 1 | 1 | | getcwd | 3 | 3 | | mkdir | 2 | 2 | | newfstatat | 31 761 | 32 137 🔺 | | openat | 74 965 | 81 592 🔺 | | readlink | 1 183 525 | 1 194 240 🔺 | | statfs | 2 | 2 | | statx | 1 058 381 | 11 734 655 🔺 | | unlink | 3 | 2 |

We are interested in how many accesses to the file system occurred during the linting process.

For example we can pay attention to statx syscall.

eslint-import-resolver-x makes 10 MILLION fewer statx calls

If you notice an increase in linting performance in your CI on large code bases, write your feedback here

Description

You can:

  • import/require files with extension any extenstions of js or ts
  • Use paths defined in tsconfig.json or jsconfig.json
  • Multiple tsconfigs or jsconfigs support
  • imports/exports fields support in package.json

Installation

# npm
npm i -D eslint-plugin-import @helljs/eslint-import-resolver-x

# pnpm
pnpm i -D eslint-plugin-import @helljs/eslint-import-resolver-x

# yarn
yarn add -D eslint-plugin-import @helljs/eslint-import-resolver-x

Configuration

If you are using eslint-plugin-import-x@>=4.5.0, you can use import/require to reference eslint-import-resolver-x directly in your ESLint flat config:

// eslint.config.js
const {
  createImportResolver,
} = require('eslint-import-resolver-x')

module.exports = [{
  settings: {
    "import/resolver-x": [
      createImportResolver({
        alwaysTryTypes: true,
        project: "path/to/folder",
        // ...
      }),
    ];
  }
}]

Add the following to your .eslintrc config:

TypeScript

{
  "plugins": ["import"],
  "rules": {
    // turn on errors for missing imports
    "import/no-unresolved": "error",
  },
  "settings": {
    "import/parsers": {
      "@typescript-eslint/parser": [".ts", ".tsx"],
    },
    "import/resolver": {
      "@helljs/eslint-import-resolver-x": {
        "alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`

        // Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default

        // use <root>/path/to/folder/tsconfig.json
        "project": "path/to/folder",

        // Multiple tsconfigs (Useful for monorepos)

        // use a glob pattern
        "project": "packages/*/tsconfig.json",

        // use an array
        "project": ["packages/module-a/tsconfig.json", "packages/module-b/tsconfig.json"],

        // use an array of glob patterns
        "project": ["packages/*/tsconfig.json", "other-packages/*/tsconfig.json"],
      },
    },
  },
}

JavaScript

{
  "plugins": ["import"],
  "rules": {
    // turn on errors for missing imports
    "import/no-unresolved": "error",
  },
  "settings": {
    "import/parsers": {
      "@babel/eslint-parser": [".js", ".mjs"],
    },
    "import/resolver": {
      "@helljs/eslint-import-resolver-x": {
        // use <root>/path/to/folder/jsconfig.json
        "project": "path/to/folder",

        // Multiple jsconfigs (Useful for monorepos)

        // use a glob pattern
        "project": "packages/*/jsconfig.json",

        // use an array
        "project": ["packages/module-a/jsconfig.json", "packages/module-b/jsconfig.json"],

        // use an array of glob patterns
        "project": ["packages/*/jsconfig.json", "other-packages/*/jsconfig.json"],
      },
    },
  },
}

You can use this resolver for mixed codebase with javascript & typescript:

"settings": {
  "import/parsers": {
    "@babel/eslint-parser": [".js", ".mjs"],
    "@typescript-eslint/parser": [".ts", ".tsx"],
  },
  "import/resolver": {
    "@helljs/eslint-import-resolver-x": {
      "project": ["packages/*/tsconfig.json", "packages/*/jsconfig.json"],
    },
  },
}

Options from enhanced-resolve

conditionNames - See default

extensions - See default

extensionAlias - See default

mainFields - See default

Other options

You can pass through other options of enhanced-resolve directly

License

ISC