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

@limegrass/eslint-plugin-import-alias

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@limegrass/eslint-plugin-import-alias

Rewrite imports to TSConfig aliases

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10K
increased by13.95%
Maintainers
0
Weekly downloads
 
Created
Source

@limegrass/eslint-plugin-import-alias

Encourage use of defined aliases in TSConfig/JSConfig through ESLint.

Why

  • Automatic imports by tsserver resolve to relative paths that can be normalized.
  • It's easier to refactor by finding and replacing an absolute module path without worrying about crafting the regex for ../ and ./

Requirements

  • Node 14+

Install

npm install --save-dev @limegrass/eslint-plugin-import-alias eslint

This plugin relies on an alias configuration in tsconfig.json, jsconfig.json, or a config with the same schema and a path given as aliasConfigPath in its rules settings. See the rules documentation for more detail.

Configuration

The following is the most basic configuration. Check the rules documentation for further configuration.

// .eslintrc
{
    "plugins": ["@limegrass/import-alias"],
    "rules": {
        "@limegrass/import-alias/import-alias": "error"
    }
}

The configuration above is also equivalent to

// .eslintrc
{
    "extends": [
        // ... - your other extends, such as `"eslint:recommended"`
        "plugin:@limegrass/import-alias/recommended"
    ]
}

FAQs

Package last updated on 01 Dec 2024

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