From d4a45345d70cb1631b443fab32c9d303aee11af8 Mon Sep 17 00:00:00 2001 From: Robert Vitonsky Date: Sat, 13 Apr 2024 15:35:06 +0200 Subject: [PATCH] docs: update readme --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8a72f9e..551e17d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,17 @@ -A plugin for ESLint, to force use paths aliases according to `paths` options in `tsconfig.json` or `jsconfig.json`, instead of relative imports. +A plugin for ESLint, to force use paths aliases according to `paths` option config in `tsconfig.json` or `jsconfig.json`, instead of relative imports. Zero config, plug and play design. +# About + +Current rule supports auto fix with `eslint --fix`, so you may automate paths correction. + +Unlike other plugins like [eslint-plugin-import-alias](https://github.com/dword-design/eslint-plugin-import-alias) and [eslint-plugin-import-alias](https://github.com/steelsojka/eslint-import-alias) whose introduce their own aliases, current plugin is just use aliases config from tsconfig/jsconfig. + +With `eslint-plugin-paths` you have one source of truth - your `tsconfig.json` file (or `jsconfig.json` in case you use vanilla javascript). + +TODO: We have a [ticket](https://github.com/vitonsky/eslint-plugin-paths/issues/28), to implement an option to deprecate specific paths for case you want to convert aliases back to relative paths. So you will just add alias to deprecation list, then run `eslint --fix` and unnecessary aliases will be inverted back to paths. Simple and powerful for aliases management. + # Setup Install package with `npm install -D eslint-plugin-paths`, then update eslint config