1.4.1 • Published 1 month ago

@limegrass/eslint-plugin-import-alias v1.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@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"
    ]
}
1.4.1

1 month ago

1.4.0

1 month ago

1.3.2

2 months ago

1.3.1

2 months ago

1.3.0

2 months ago

1.2.0

3 months ago

1.1.0

8 months ago

1.0.7

8 months ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago