npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

eslint-plugin-sbnc-rules

v0.2.1

Published

An ESLint plugin for customised linting rules

Downloads

4

Readme

ESLint Plugin: SBNC Rules

This plugin includes some specialised ESLint rules.

The current version of the rules are based on the v8.13.0 version of ESLint and are tested to be compatible with ESLint v7 and v8.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-sbnc-rules:

npm install eslint-plugin-sbnc-rules --save-dev

Usage

Add sbnc-rules to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "sbnc-rules"
    ]
}

Then configure the rules you want to use under the rules section. Since these rules are a superset of the built in rules with the same names those need to be disabled for the replacements to work as intended.

{
    "rules": {
      
      "space-in-parens"           : "off",
      "sbnc-rules/space-in-parens": [ "error", "loose", { "exceptions": ["bracket unclosed"] } ],
      
      "padded-blocks"             : "off",
      "object-curly-newline"      : "off",
      "sbnc-rules/padded-blocks"  : [ "error", "loose", { "allowSingleLineBlocks": true, "noBottomPadding": true, "includeObjects": true } ]
      
    }
}

Supported Rules

This Plugin contains two rules. Each of these are an extended versions of the rules under the same name provided with ESLint. These rules should behave exactly the same as their original counterparts if the rule configuration is the same. However, they allow some additional configuration options to further fine-tune their behaviour.

For detailed information and examples about the rules refer to their respective documentation under the docs/rules folder:

space-in-parens

This rule provides extra options to control when spaces in parens should be used.

The first option has a new value loose. This means to only apply spaces around the brackets if there is more than one item in the bracket separated by space(s).

The second option allows new exceptions:

  • bracket lines defines an exception for parenthesis in lines that only contain brackets and whitespaces (on either side of the subject parenthesis)
  • bracket sides (deprecated) defines an exception for parenthesis when the inner side of the bracket only contain other brackets and whitespaces within the same line - note that the inner side continues after the closing pair of the parenthesis until the end of the line
  • bracket unclosed defines an exception for parenthesis when the inner side of the bracket only contain other brackets and whitespaces and the closing pair of the parenthesis is on another line
  • bracket within defines an exception for parenthesis when inside the bracket only contain other brackets and whitespaces within the same line - note that the inside ends where the closing parenthesis is found or where the line ends

padded-blocks

This rule provides extra options to control when padding lines in curly brace contained blocks should be used.

The first option has a new value loose. This means to only apply padding around the brackets if there is at least one empty (padding) line inside the block's body.

The second option allows a new setting:

  • noBottomPadding which can be used to avoid padding the bottom of blocks regardless of the first option's value
  • includeObjects which can be used to extend the padding behaviour to Objects

Additional info

The plugin scaffolding has been generated using yo and generator-eslint.


Bence Szalai - https://sbnc.eu/

For similar extended rules of the typescript-eslint rules check out my other plugin: eslint-plugin-sbnc-typescript-rules.