Socket
Book a DemoInstallSign in
Socket

eslint-plugin-ajel-go

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-ajel-go

Eslint rules for ajel-go, the library which encourages handling errors similarly to Golang

0.0.4
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

DEPRECATED

Personally - I recommend using ajel instead. Follow this link to see the new api.

ajel-go is a 312 byte set of functions that encourage you to handle errors in a way that is similar to Golang.

NPM Version Package License NPM Downloads

ajel-go

Installation

yarn add ajel-go eslint-plugin-ajel-go

pnpm add ajel-go eslint-plugin-ajel-go

Basic eslintrc

{
  plugins: ['ajel-go'],
  extends: [
    'plugin:ajel/recommended',
  ],
}

Advanced eslintrc

{
  plugins: ['ajel-go'],
  extends: [
    'plugin:ajel/recommended',
  ],
  rules: {
    'ajel-go/ajel-const-tuples': [
      'error',
      {
        ajelAlias: "blimpy",
        sjelAlias: "limpyb",
      },
    ],
    'ajel-go/ajel-require-tuple-declaration': [
      'error',
      {
        ajelAlias: 'blimpy',
        sjelAlias: "limpyb",
      },
    ],
    'ajel-go/ajel-disable-try-catch': [
      'error',
      {
        ajelAlias: 'blimpy',
        sjelAlias: "limpyb",
      },
    'ajel/sjel-require-currying': [
      'error',
      {
        sjelAlias: "limpyb",
      },
    //Use one of the two following rules
    'ajel-go/ajel-require-error-handling': [
      'error',
      {
        ajelAlias: 'blimpy',
        sjelAlias: "limpyb",
      },
    ],
    //'ajel-go/ajel-strict-error-instanceof': [
    //  'off',
    //  {
    //    ajelAlias: 'blimpy',
    //    sjelAlias: "limpyb",
    //  },
    //],
  },
}

ajel and sjel are a set of functions that return a tuple representing a potential result and a potential error. On success, the result item has value. On error, the error item has value. It's that simple.

More interestingly, it comes with a series of linting tools to help enforce the paradigm available in the package eslint-plugin-ajel

Keywords

typescript

FAQs

Package last updated on 04 Feb 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.