package
Enforce placing import or export variables on a newline
npm install eslint-plugin-modules-newlineGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Eslint plugin to enforce placing import and export variables on separate lines
You'll first need to install ESLint:
$ npm i eslint --save-devor
$ yarn add eslint --devNext, install eslint-plugin-modules-newline:
$ npm install eslint-plugin-modules-newline --save-devor
$ yarn add eslint-plugin-modules-newline --devNote: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-modules-newline globally.
Add eslint-plugin-modules-newline to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"modules-newline"
]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"modules-newline/import-declaration-newline": "warn",
"modules-newline/export-declaration-newline": "warn"
}
}AST explorer - https://astexplorer.net/#/gist/b6093767261d6a5bce76043dcea24bec/5fe761308f41936beaa30cbe7aef3a6f0283e11d
Estimated unpacked size across 2 packages.
26.0 kB
Includes dependencies.