Socket
Socket
Sign inDemoInstall

eslint-plugin-object-pattern-newline

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-object-pattern-newline

ESLint plugin to enforce newlines in ES6 object pattern


Version published
Maintainers
1
Created
Source

eslint-plugin-object-pattern-newline

ESLint plugin to enforce newlines in ES6 object pattern.

There is only one rule in this plugin which will report when there are more than 4 values in a line by default.

Installation

$ npm install eslint-plugin-object-pattern-newline --save-dev

Or

$ yarn add eslint-plugin-object-pattern-newline -D

Usage

Add object-newline to the plugins section of your .eslintrc configuration file.

{
    "plugins": [
        "object-newline"
    ]
}

Then add the rule in the rules section.

{
    "rules": {
        "object-newline/enforce": "error"
    }
}

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],
        "object-newline/enforce": [
            "error",
            {
                "items": 2,
                "max-len": 100
            }
        ]
    }
}
items [number] (default: 4)

Specifies the maximum number of items before the plugin requires breaking items to multiple lines.

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 lines for you should they exceed the limit.

Testing

Tests can be run via npm run test, make sure these pass after every change. Be sure to add tests for new features.

Keywords

FAQs

Package last updated on 19 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc