New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-config-rickschubert

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-rickschubert

ESLint Configuration "Rick Schubert" ===================================

  • 1.0.12
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
85
decreased by-32%
Maintainers
1
Weekly downloads
 
Created
Source

ESLint Configuration "Rick Schubert"

Preferring ES6, readability and low ambiguities. Extends the recommended ruleset with some useful additions.

How to use

  • Install: npm install eslint-config-rickschubert --save-dev
  • Add it to your ESLint configuration:
{
    "extends": ["rickschubert"]
}

Typescript

  • Install the Typescript ESLint parser and plugin: npm i @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev
  • Add parser and plugin to your ESLint configuration:
{
    "extends": ["rickschubert"],
    "plugins": ["@typescript-eslint"],
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module",
        "ecmaFeatures": {
            "modules": true
        }
    }
}
  • Currently, the TSLint parser has a few minor issues. For example, importing types triggers the rule no-unused-vars despite them being actually used as type annotations.

Rules in detail

Environments: node, es6, browser

Unless noted, all rules are errors.

RuleDescription
arrow-parensAlways wrap function arguments in brackets.
brace-styleCurly brackets start after the keyword, not underneath.
comma-dangleDangling commas in multiline objects, functions, arrays.
complexityMaximum cyclomatic complexity of 3 to enforce highly maintaineable code (warning).
curlyCurly brackets after if statements to avoid ambiguity when line breaks occur.
eol-lastEmpty line at the end of the file.
func-call-spacingBrackets () to invoke a function have to stand right next to the function name.
global-requirerequire() statements should be at the top of the file (warning).
linebreak-styleUNIX linebreaks.
no-await-in-loopDisallow await in loops (should use Promise.all() instead).
no-default-exportOnly allow named exports for increased consistency and clarity when importing modules.
no-floating-decimalNumbers have to be clear, i.e. 0.4 instead of .4.
no-implicit-coercionConverting types from one to another have to be explicit.
no-lone-blocksNo curly brackets unless necessary.
no-lonely-ifUse else if instead of a lonely if wrapped inside an else.
no-loop-funcFunctions cannot be declared inside loops, they should be declared outside.
no-template-curly-in-stringAvoid confusion whether a string is templated or not.
no-throw-literalThrow errors explicitly, not just strings or values.
no-varUse ES6 block-scopedconst and let, never var.
one-varDon't declare multiple variables in one line.
prefer-constlet should only be used where reassignment is necessary.
prefer-promise-reject-errorsPromises should be rejected with a clear error, not a simple value.
prefer-spreadUse ES6 spread operator instead of difficult to understand ES5 .apply().
prefer-templateUse template strings instead of string concatenation (warning).
quotesUse unescaped double quotes.
require-awaitasync functions should perform an await, otherwise async keyword is unnecessary.
semiDon't use semicolons.
yodaDon't use unintuitive conditions.

FAQs

Package last updated on 26 Apr 2022

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