Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

eslint-plugin 2.1.3

Install from the command line:
Learn more about npm packages
$ npm install @incutonez/eslint-plugin@2.1.3
Install via package.json:
"@incutonez/eslint-plugin": "2.1.3"

About this version

Purpose

I wanted my braces in objects (and arrays) to be on the same line as each other, and the brackets of an array, so I had to alter 2 ESLint properties array-bracket-newline and array-element-newline. This repo contains those overrides. See also this SO Question.

I basically ported the ESLint code from here and here to TypeScript, added a new property bracesSameLine (which is a boolean), and modified the check functions to use this property and determine how to format properly.

It will correct braces that are on a different line as the open/close brace/bracket, like this:

const invalid = {
    someFunction: function() {

    },

    arr: [
        {
            thing: 1
        },
        {
            one: 2
        }
    ]
};

const valid = {
    someFunction: function() {

    },

    arr: [{
        thing: 1,
    }, {
        one: 2,
    }],
};

Installation and Usage

npm i -D @incutonez/eslint-plugin

Then in your ESLint config file, add the following:

  • In plugins, add @incutonez
  • In rules, add:
"@incutonez/array-element-newline": [
  "error",
  {
    "multiline": true,
    "minItems": 5,
    "bracesSameLine": true
  }
],
"@incutonez/array-bracket-newline": [
  "error",
  {
    "multiline": true,
    "minItems": 5,
    "bracesSameLine": true
  }
],

Details


Assets

  • eslint-plugin-2.1.3.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0