eslint-plugin-import-newlines weekly downloads statistics
By SeinopSys · npm · ESLint plugins
ESLint plugin for enforcing newlines in ES6 import statements past a certain number of items
eslint-plugin-import-newlines has 207,720 recorded weekly downloads on npm, an increase of 18.2% over the past 30 days, ranking #517 of 3,247 tracked listings.
About eslint-plugin-import-newlines
eslint-plugin-import-newlines

ESLint plugin for enforcing newlines in ES6 import statements past a certain number of items.
There is only one rule in this plugin which will report when there are more than 4 values in a line by default, and if there are less it will report when the import is not on a single line.
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-import-newlines:
$ npm install eslint-plugin-import-newlines --save-dev
Note: If you installed ESLint globally (using the -g flag) then you must also
install eslint-plugin-import-newlines globally.
ESLint is an optional peer dependency, so if you only use Oxlint you can skip installing it.
Usage
Flat config (ESLint 9+)
Use the bundled recommended preset, which registers the plugin and enables the rule:
// eslint.config.mjs
import importNewlines from 'eslint-plugin-import-newlines';
export default [
importNewlines.configs.recommended,
];
Or register the plugin yourself to configure the rule:
// eslint.config.mjs
import importNewlines from 'eslint-plugin-import-newlines';
export default [
{
plugins: {
'import-newlines': importNewlines,
},
rules: {
'import-newlines/enforce': ['error', { items: 2, 'max-len': 100 }],
},
},
];
Legacy .eslintrc
Add import-newlines to the plugins section of your .eslintrc configuration file.
{
"plugins": [
"import-newlines"
]
}
Then add the rule in the rules section.
{
"rules": {
"import-newlines/enforce": "error"
}
}
Using with Oxlint
The rule does not depend on ESLint at runtime, so the plugin also works with Oxlint's JS plugins (currently in alpha). Install the plugin (ESLint is not required):
$ npm install eslint-plugin-import-newlines --save-dev
Then add it under jsPlugins in your .oxlintrc.json and enable the rule. The rule options are
the same as with ESLint.
{
"jsPlugins": [
"eslint-plugin-import-newlines"
],
"rules": {
"import-newlines/enforce": [
"error",
{
"items": 2,
"max-len": 100,
"semi": false
}
]
}
}
If you use oxlint.config.ts instead, put the same jsPlugins and rules values in
defineConfig({ ... }).
Options
The first and most readable way is to use an object which allows you to specify any of the available options, leaving everything that's not specified as the default.
{
"rules": {
"max-len": [
"error",
100
],
"semi": [
"error",
"never"
],
"import-newlines/enforce": [
"error",
{
"items": 2,
"max-len": 100,
"semi": false
}
]
}
}
Because of its easy expandability this is the only format that will allow you to configure any new options – should they be added – but there is also a shorter syntax that will let you configure just the first two and keep everything else default.
To specify items as 6:
{
"rules": {
"import-newlines/enforce": [
"error",
6
]
}
}
To specify items as 4 and max-len as 120:
{
"rules": {
"max-len": [
"error",
120
],
"import-newlines/enforce": [
"error",
4,
120
]
}
}
items [number] (default: 4)
Specifies the maximum number of items before the plugin requires breaking up the import to
multiple lines. If there are exactly this many or fewer items, then the plugin will make sure the
import stays on one line unless it would violate the max-len option. More items than this number
will always be split onto multiple lines.
Note that the plugin simply inserts newline characters after each token in the import when
splitting, and the fix output never includes leading tabs or spaces. To have consistent indentation,
be sure to use the built-in indent rule.
max-len [number] (default: Infinity)
Specifies the maximum length for source code lines in your project. This allows the plugin to
prevent quick fixes that would cause your code to violate this limit from being applied. The rule
will also automatically split import lines for you should they exceed the limit, which works great
as an automatic fix for the ESLint built-in max-len rule (which doesn't have any quick fixes out
of the box at the time of writing) for your imports. It's highly recommended you keep this option's
value in sync with what you use for the aforementioned rule for best results.
semi [boolean] (default: true)
Indicates whether you want to have semicolons at the end of your imports. This is used in the maximum length calculation for the previous rule, so be sure to set this to false if your code style does not use semicolons at the end of imports otherwise it can lead to some unexpected automatic fixes.
Note that this does not enforce the use of semicolons, use the built-in ESLint semi rule to
control that. Setting this to the right value merely aims to ensure that the plugin will not produce
conflicting quick fixes.
Also, to preserve backwards compatibility with the existing array-based configuration, this is
always set to false when not using the new object syntax to configure the rule.…
Description from the npm listing.
- eslint
- eslint-plugin
- eslintplugin
- lint
- 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-import-newlines 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-import-newlines. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.