gajus / eslint-config-canonical

The most comprehensive ES code style guide.
Other
590 stars 30 forks source link

Add `paths/alias` rule, to fix path aliases automatically #82

Open vitonsky opened 4 months ago

vitonsky commented 4 months ago

Hi, what about add a rule paths/alias in eslint-plugin-paths plugin?

It analyzes tsconfig.json and reports a relative paths in imports that must be replaced to a path aliases like @foo/x/y.

This rule supports an auto fix, and option for excluded paths in development, so in next versions user may just add deprecated paths or alias names in rule options and aliases will be reverted to relative paths back. This plugin automate control over aliases management

gajus commented 1 month ago

We already use https://github.com/gajus/eslint-plugin-canonical?tab=readme-ov-file#prefer-import-alias for this.

I don't know about including either into the default config.