https://github.com/yoavniran/eslint-plugin-no-async
disallows code that will transpile into use of regenerator
https://github.com/yoavniran/eslint-plugin-no-async
eslint eslint-plugin eslint-rules
Last synced: 4 months ago
JSON representation
disallows code that will transpile into use of regenerator
- Host: GitHub
- URL: https://github.com/yoavniran/eslint-plugin-no-async
- Owner: yoavniran
- License: mit
- Created: 2020-10-01T20:49:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-12-03T07:22:27.000Z (7 months ago)
- Last Synced: 2025-12-06T08:55:04.615Z (7 months ago)
- Topics: eslint, eslint-plugin, eslint-rules
- Language: JavaScript
- Homepage:
- Size: 104 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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](https://www.npmjs.com/package/regenerator-runtime) then use this rule.
## Installation
```shell
#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+):
```javascript
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):
```eslint
{
"no-async/no-async": [2]
}
# with allowGenerators:
{
"no-async/no-async": [2, true]
}
```
## Details
```javascript
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
```eslint
{
"no-async/no-async": [, ]
}
```
**allowGenerators** In case you wish to allow generator functions, set this to true. (default: false)