Skip to content

Commit

Permalink
Merge pull request #47 from vitonsky/36-add-section-why-not-x-to-readme
Browse files Browse the repository at this point in the history
docs: Add section "why not X" to readme
  • Loading branch information
vitonsky authored Apr 13, 2024
2 parents be66a6d + d4a4534 commit 2b77376
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 2b77376

Please sign in to comment.