eslint-plugin-path weekly downloads statistics
By qDanik · npm · ESLint plugins
[](https://biomejs.dev) [](https://biomejs.dev)
eslint-plugin-path has 44,566 recorded weekly downloads on npm, an increase of 27.6% over the past 30 days, ranking #815 of 3,247 tracked listings.
About eslint-plugin-path
eslint-plugin-path
An ESLint plugin for enforcing consistent import paths across a project. It rewrites relative imports to absolute ones (or the reverse), based on the paths and baseUrl in your tsconfig.json / jsconfig.json.
Installation
# npm
npm install eslint-plugin-path --save-dev
# yarn
yarn add eslint-plugin-path --dev
ESLint 10+
This plugin requires ESLint 10 or later and Node.js ^20.19.0 || ^22.13.0 || >=24 — the same range ESLint 10 supports.
It uses the flat config format (eslint.config.js). The legacy .eslintrc format was removed in ESLint 10 and is not supported.
Basic usage
import eslintPluginPath from 'eslint-plugin-path';
export default [
{
files: ['**/*.{js,ts,jsx,tsx}'],
plugins: {
path: eslintPluginPath,
},
rules: {
'path/no-relative-imports': [
'error',
{
maxDepth: 2,
suggested: false,
},
],
},
},
];
Using defineConfig()
import { defineConfig } from 'eslint/config';
import eslintPluginPath from 'eslint-plugin-path';
export default defineConfig([
{
files: ['**/*.{js,ts,jsx,tsx}'],
plugins: {
path: eslintPluginPath,
},
rules: {
'path/no-relative-imports': [
'error',
{
maxDepth: 2,
suggested: false,
},
],
},
},
]);
Using presets
import eslintPluginPath from 'eslint-plugin-path';
export default [
...eslintPluginPath.configs.recommended,
];
Custom tsconfig/jsconfig paths
If you are using custom paths in your tsconfig.json or jsconfig.json file, you can specify the path to the configuration file in your ESLint settings:
import eslintPluginPath from 'eslint-plugin-path';
export default [
{
plugins: { path: eslintPluginPath },
settings: {
path: {
config: 'tsconfig.json', // or 'jsconfig.json'
},
},
rules: {
'path/no-relative-imports': 'error',
},
},
];
Configuration
Enable the rules in your ESLint flat configuration:
import eslintPluginPath from 'eslint-plugin-path';
export default [
{
plugins: { path: eslintPluginPath },
rules: {
'path/no-relative-imports': 'error',
},
},
];
Or use the recommended preset:
import eslintPluginPath from 'eslint-plugin-path';
export default [
...eslintPluginPath.configs.recommended,
];
What is checked
All three rules inspect the specifier of these forms:
import x from '../../components/button'; // static import
import('../../components/button'); // dynamic import
require('../../components/button'); // CommonJS require
Re-export declarations are not checked:
export * from '../../components/button'; // not reported
export { Button } from '../../components/button'; // not reported
Bare specifiers that resolve inside node_modules (e.g. react) are always skipped.
Rules
✔ included in the "recommended" preset
🔧 fixable using the --fix command line option
💡 provides editor suggestions
| Name | Description | |||
|---|---|---|---|---|
| ✔ | 🔧 | 💡 | no-relative-imports | disallow relative imports of files where absolute is preferred |
| 🔧 | 💡 | no-absolute-imports | disallow absolute imports of files where relative is preferred | |
| 🔧 | 💡 | only-absolute-imports | disallow relative imports of files through the whole project |
Presets
recommended— enablesno-relative-importswith{ maxDepth: 1, suggested: true }. Note this is stricter than the rule's own defaults ({ maxDepth: 2, suggested: false }).
recommended is the only preset. The three rules express mutually exclusive policies, so no single config can enable them together — pick the one rule that matches your project and configure it explicitly.
Removed in 3.0.0: the
allpreset. It never enabled all rules — it enabled onlyno-relative-imports, with weaker settings thanrecommended. See the CHANGELOG.
License
Description from the npm listing.
- eslint
- eslintplugin
- eslint-plugin
- absolute-path
- path
- relative-import
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm ESLint plugins plugins
All 20 eslint-plugin-path alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/eslint-plugin-path. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.