Skip to content

absqueued/eslint-newline-imports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-newline-imports

This ESLint rule ensures that each property in an import statement is placed on a new line.

Features

  • Forces a consistent style for multiline imports
  • Enhances readability of codebase
  • Ideal for large projects where maintaining a consistent coding style is critical

Installation

First, you'll need to install ESLint:

$ npm i eslint --save-dev

Next, install @absqueued/eslint-newline-imports:

$ npm install @absqueued/eslint-newline-imports --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install @absqueued/eslint-newline-imports globally.

Usage

Add @absqueued/eslint-newline-imports to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "@absqueued/eslint-newline-imports"
    ]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "@absqueued/eslint-newline-imports": ["error", {"maxPropertiesOnSingleLine": 2}]
  }
}

Supported Rules

newline-import: Enforces a new line for each property in an import statement.

Contributing

Contributions, issues and feature requests are welcome. Feel free to check issues page if you want to contribute.

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

License

MIT © Shekhar K. Sharma

Give me a ⭐️ if this project helped you!

Follow me on Twitter.

About

ESLint rule to enforce a newline after every line block

Resources

License

Stars

Watchers

Forks

Packages

No packages published