eslint-plugin-restrict-imports weekly downloads statistics
By billlynch · npm · ESLint plugins
Eslint plugin to ban specified imports in specified directories
eslint-plugin-restrict-imports has 31,261 recorded weekly downloads on npm, an increase of 1.6% over the past 30 days, ranking #681 of 2,322 tracked listings.
About eslint-plugin-restrict-imports
eslint-plugin-restrict-imports
Eslint plugin to ban specified imports in specified directories
This is useful to ban not using a barrelled import in multi-package repositories.
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-restrict-imports:
$ npm install eslint-plugin-restrict-imports --save-dev
Usage
Add restrict-imports to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": ["restrict-imports"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"restrict-imports/restrict-imports": [
"error",
{
"../../clientA(.*)": {
"locations": ["(.*)/clientB(.*)"],
"message": "Do not import client A in client B"
},
"(.*)/common/(.*)": {
"locations": ["(.*)/client(.*)"],
"message": "Use barrelled import '@common'"
}
}
]
}
}
Rule configuration:
[
"error",
{
"../../clientA(.*)": { // regex for the import path to ban
"locations": ["(.*)/clientB(.*)"], // regex for the absoulte file names to enforce in
"message": "Do not import client A in client B" // optional - customised error message
}
}
]
Default Rule configuration:
[
"error",
{
"/(.*)": { // Ban absoulte imports
"locations": ["(.*)"] // in all files
}
}
]
Supported Rules
- restrict-imports - Ban imports from a location in any directory.
Description from the npm listing.
- eslint
- eslintplugin
- eslint-plugin
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 (122)Similar npm ESLint plugins plugins
All 20 eslint-plugin-restrict-imports 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-restrict-imports. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.