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

eslint-plugin-no-async

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-async

disallows code that will transpile into use of regenerator

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
103
increased by1044.44%
Maintainers
0
Weekly downloads
 
Created
Source

MIT License npm version

eslint-plugin-no-async

Disallows code that will transpile into use of regenerator.

If you don't want async/await and generators to be transpiled into use of regenerator-runtime then use this rule.

Installation

#PNPM: 
  $ pnpm add -D eslint-plugin-no-async

#Yarn:
  $ yarn add --dev eslint-plugin-no-async

#NPM:
  $ npm i --save-dev eslint-plugin-no-async

In Flat Configuration (9+):

    import noAsync from "eslint-plugin-no-async";
   
    export default [{
        "plugins": {
            "no-async": noAsync,
        },
        "rules": {
            ...js.configs.recommended.rules,
            "no-async/no-async": [2],

            //with allowGenerators:
            // {
            //     "no-async/no-async": [2, true]
            // }
        }
    }];

In .eslintrc(.js) (Before 9):

{
    "no-async/no-async": [2]    
}

# with allowGenerators:

{
    "no-async/no-async": [2, true]    
}

Details


async function myFunction() {}

const myArrowFunction = async () => {}

function * myGeneratorFunction() { }

class MyClass {
    async myFunction() { }
}

All of the examples in the code above will result in the use of regenerator after babel transpiled it.

Options

{
    "no-async/no-async": [<level>, <allowGenerators>]    
}

allowGenerators In case you wish to allow generator functions, set this to true. (default: false)

Keywords

FAQs

Package last updated on 28 Feb 2025

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