# no-wildcard-import

Rule `sonarjs/no-wildcard-import`. Wildcard imports should not be used

- Source: sonarjs
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #2169 by reach

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
import * as Imported from "aModule";  // Noncompliant
```

Examples from the ESLint documentation.

## Enable it

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

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

## Related rules

- [sonarjs/no-variable-usage-before-declaration](https://lintradar.dev/rules/sonarjs/no-variable-usage-before-declaration.md): Variables declared with "var" should be declared before they are used
- [sonarjs/non-number-in-arithmetic-expression](https://lintradar.dev/rules/sonarjs/non-number-in-arithmetic-expression.md): Arithmetic operators should only have numbers as operands
- [sonarjs/no-unused-function-argument](https://lintradar.dev/rules/sonarjs/no-unused-function-argument.md): Unused function parameters should be removed
- [sonarjs/operation-returning-nan](https://lintradar.dev/rules/sonarjs/operation-returning-nan.md): Arithmetic operations should not result in "NaN"
- [sonarjs/no-undefined-assignment](https://lintradar.dev/rules/sonarjs/no-undefined-assignment.md): "undefined" should not be assigned
- [sonarjs/prefer-immediate-return](https://lintradar.dev/rules/sonarjs/prefer-immediate-return.md): Local variables should not be declared and then immediately returned or thrown

---

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