🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@ueno/eslint-plugin-internal

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ueno/eslint-plugin-internal

Ueno's custom eslint rules

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
34
17.24%
Maintainers
1
Weekly downloads
 
Created
Source

@ueno/eslint-plugin-internal

Ueno's custom eslint rules

npm

Why?

We needed some customs rules to add to our lint config, to align with our code style. This package is used in the @ueno/eslint-config to add two custom rules to our config.

Rules

  • @ueno/internal/decorator-line-break: Force a line break after the decorator statement
  • @ueno/internal/padded-blocks: Force a blank line after the class declaration

@ueno/internal/decorator-line-break

This rule has one option, which can be a string option.

String option:

  • "always" (default) requires a line break after a decorator statement
  • "never" disallows line break after a decorator statement

Example:

'@ueno/internal/decorator-line-break': 2 Will requires to add a line break after a decorator declaration

Wrong 👎

@observable myValue = true;

Good 👍

@observable
myValue = true;

@ueno/internal/padded-blocks

This rule has two options, which can be a string option or an object option.

String option:

  • "always" (default) requires empty lines at the beginning and ending of blocks, classes and switches statements
  • "never" disallows empty lines at the beginning and ending of blocks, classes and switches statements
  • "top" requires empty lines only at the beginning of blocks, classes and switches statements
  • "bottom" disallows empty lines only at the ending of blocks, classes and switches statements

Object option:

  • "blocks" require or disallow padding within blocks statements
  • "classes" require or disallow padding within classes statements
  • "switches" require or disallow padding within switch statements

Examples:

'@ueno/internal/padded-blocks': 2 Will requires empty lines only at the beginning and ending of blocks, classes and switches statements

Wrong 👎

class A {
  constructor() {
  }
}

Good 👍

class A {

  constructor() {
  }

}

'@ueno/internal/padded-blocks': ['error', { classes: 'top' }] Will requires empty lines only at the beginning of classes statements

Wrong 👎

class A {
  constructor() {
  }
}

Good 👍

class A {

  constructor() {
  }
}

License

MIT © ueno.

Keywords

@ueno/eslint-plugin-internal

FAQs

Package last updated on 09 Jan 2018

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