# no-async-constructor

Rule `sonarjs/no-async-constructor`. Constructors should not contain asynchronous operations

- Source: sonarjs
- Technologies: JavaScript
- Kind: style
- Needs type information: yes
- Autofix: no
- Reach: 6.2M weekly downloads of presets that enable it
- Trend: +62.1% last quarter
- Rank: #1243 by reach, #544 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/no-async-constructor` | yes | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-7059/) |

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "sonarjs/no-async-constructor": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [SonarJS recommended](https://lintradar.dev/presets/sonarjs-recommended.md) | ESLint | `eslint-plugin-sonarjs` | 230 | 6.2M | +62.1% |

## Related rules

- [sonarjs/no-associative-arrays](https://lintradar.dev/rules/sonarjs/no-associative-arrays.md): Array indexes should be numeric
- [sonarjs/no-case-label-in-switch](https://lintradar.dev/rules/sonarjs/no-case-label-in-switch.md): "switch" statements should not contain non-case labels
- [sonarjs/no-array-delete](https://lintradar.dev/rules/sonarjs/no-array-delete.md): "delete" should not be used on arrays
- [sonarjs/no-clear-text-protocols](https://lintradar.dev/rules/sonarjs/no-clear-text-protocols.md): Clear-text protocols should not be used
- [sonarjs/no-angular-bypass-sanitization](https://lintradar.dev/rules/sonarjs/no-angular-bypass-sanitization.md): Angular built-in sanitization should not be disabled
- [sonarjs/no-code-after-done](https://lintradar.dev/rules/sonarjs/no-code-after-done.md): Tests should not execute any code after "done()" is called

---

Web page: https://lintradar.dev/rules/sonarjs/no-async-constructor. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
