{"id":13801863,"url":"https://github.com/vitonsky/eslint-plugin-paths","last_synced_at":"2025-04-04T13:09:52.536Z","repository":{"id":230628593,"uuid":"778995808","full_name":"vitonsky/eslint-plugin-paths","owner":"vitonsky","description":"A plugin for ESLint, to force use paths aliases from tsconfig","archived":false,"fork":false,"pushed_at":"2024-12-17T13:54:33.000Z","size":390,"stargazers_count":76,"open_issues_count":16,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T12:05:39.731Z","etag":null,"topics":["build-tools","code-quality","codeanalysis","codequality","eslint","eslint-plugin","tsconfig","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/eslint-plugin-paths","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitonsky.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-28T20:34:17.000Z","updated_at":"2025-03-24T15:34:03.000Z","dependencies_parsed_at":"2024-09-18T23:07:45.652Z","dependency_job_id":"76cdc0e7-6620-45e7-8c07-6f29ea53f72a","html_url":"https://github.com/vitonsky/eslint-plugin-paths","commit_stats":{"total_commits":55,"total_committers":2,"mean_commits":27.5,"dds":"0.19999999999999996","last_synced_commit":"99031c0ff2f2e75a03760b27735c8db7ac74152f"},"previous_names":["vitonsky/eslint-import-paths","vitonsky/eslint-plugin-paths"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitonsky%2Feslint-plugin-paths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitonsky%2Feslint-plugin-paths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitonsky%2Feslint-plugin-paths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitonsky%2Feslint-plugin-paths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitonsky","download_url":"https://codeload.github.com/vitonsky/eslint-plugin-paths/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182334,"owners_count":20897379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-tools","code-quality","codeanalysis","codequality","eslint","eslint-plugin","tsconfig","typescript"],"created_at":"2024-08-04T00:01:28.871Z","updated_at":"2025-04-04T13:09:52.511Z","avatar_url":"https://github.com/vitonsky.png","language":"TypeScript","readme":"A plugin for ESLint, to force use paths aliases according to `paths` option config in `tsconfig.json` or `jsconfig.json`, instead of relative imports.\n\nZero config, plug and play design.\n\n# About\n\nCurrent rule supports auto fix with `eslint --fix`, so you may automate paths correction.\n\nUnlike 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.\n\nWith `eslint-plugin-paths` you have one source of truth - your `tsconfig.json` file (or `jsconfig.json` in case you use vanilla javascript).\n\nTODO: 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.\n\n# Setup\n\nInstall package with `npm install -D eslint-plugin-paths`, then update eslint config\n\n```json\n{\n\t\"plugins\": [\n\t\t\"eslint-plugin-paths\",\n\t],\n\t\"rules\": {\n\t\t\"paths/alias\": \"error\"\n\t}\n}\n```\n\n# Examples\n\nIf you have `tsconfig.json` with config below\n\n```json\n{\n\t\"compilerOptions\": {\n\t\t\"baseUrl\": \".\",\n\t\t\"paths\": {\n\t\t\t\"@foo/*\": [\"src/foo/*\"],\n\t\t\t\"@bar/*\": [\"src/bar/*\"]\n\t\t}\n\t}\n}\n```\n\nthen code below will be valid\n\n```ts\n// src/index.ts\n\nimport foo from '@foo';\nimport barZ from '@bar/x/y/z';\nimport bazZ from './baz/x/y/z';\n```\n\nand this code will be invalid\n\n```ts\n// src/index.ts\n\nimport foo from './foo';\nimport barZ from './bar/x/y/z';\n```\n\n# Options\n\n## configFilePath\n\nProvide path to json file with a compiler config.\n\nWhen not set, used `tsconfig.json` from root directory if exists or `jsconfig.json` if not.\n\n# Donations\n\nYou can support the project to help it maintain independence and high quality:\n\n- tell others about this package\n- [suggest](https://github.com/vitonsky/eslint-plugin-paths/issues/new) new ideas, features and elegant ways to make package better\n- help us by trying to reproduce [unconfirmed bug reports](https://github.com/vitonsky/eslint-plugin-paths/labels/unconfirmed)\n- help us address bugs. Just ping us in issues and start work on PRs\n\nAlso, you can donate to us to vote with money for goal prioritization, to add some feature or fix some bug as soon as possible. Just donate with any method below, then leave transaction details in issue comments, or send email to [contact@vitonsky.net](mailto:contact@vitonsky.net) with issue number or feature request description. For significant donations, we will start work on your request as soon as possible.\n\n- Monero (XMR): 861w7WuFGecR7SMpuf7GX9BBUgGJb1Xdx8z5pCpMrKY2ZeZAzS3mwZeQeJGV5RPpu35fr5dURSm587ewpHYGzNuGKGroQnD\n- Bitcoin (BTC): bc1q2krassq0sa2aphkx37zn374lfjnthr5frm6s7y\n- Ethereum (ETH), Tether USDT (ERC-20): 0x2463d84F46c131886CaE457412e8B6eaBc0b91a7\n- Tron (TRC), Tether USDT (TRC-20): TQezzyzkfMCPJRdnYxNXrUfPj3s7kDeMBL\n","funding_links":[],"categories":["Plugins"],"sub_categories":["Style"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitonsky%2Feslint-plugin-paths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitonsky%2Feslint-plugin-paths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitonsky%2Feslint-plugin-paths/lists"}