Socket
Socket
Sign inDemoInstall

@ada-support/eslint-plugin-object-newline

Package Overview
Dependencies
4
Maintainers
17
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ada-support/eslint-plugin-object-newline

ESLint plugin to enforce newlines in ES6 object pattern


Version published
Weekly downloads
4
Maintainers
17
Created
Weekly downloads
 

Readme

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-pattern-newline"
    ]
}

Then add the rule in the rules section.

{
    "rules": {
        "object-pattern-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-pattern-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

Last updated on 21 Jun 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc