ESLint plugin that enforces the use of path aliases defined in tsconfig.json or jsconfig.json instead of relative imports. Version 1.1.0 is the latest stable release, with active development. Unlike alternatives that introduce their own alias configuration, this plugin reads directly from TypeScript/JavaScript config files, providing a single source of truth. Supports auto-fix via eslint --fix. Designed for zero-config, plug-and-play usage. Requires ESLint and Node.js.
npm install eslint-plugin-pathsVerified import paths — ran on the pinned version, not inferred.
Install plugin, configure ESLint, set up tsconfig paths, and run ESLint to enforce alias usage.
Ensure your aliases are defined in a compatible config file or use configFilePath option.
Manually review tsconfig paths to avoid unused aliases.
Disable auto-fix for specific files or paths with ESLint comment or ignore patterns.
If multiple configs needed, consider extending the plugin or using a preprocessor.
Use: "paths/alias": "error" or "paths/alias": ["error", options] in ESLint config.
Add "eslint-plugin-paths" to the plugins section in ESLint config.
Run: npm install -D eslint-plugin-paths
Create tsconfig.json or set configFilePath option with absolute/relative path.