# prefer-native-lodash-alternative

Rule `sonarjs/prefer-native-lodash-alternative`. Native APIs should be preferred over Lodash and Underscore.js methods

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

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/prefer-native-lodash-alternative` | yes | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-8907/) |

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/prefer-native-lodash-alternative": "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/prefer-native-jquery-alternative](https://lintradar.dev/rules/sonarjs/prefer-native-jquery-alternative.md): Native APIs should be preferred over jQuery utility methods
- [sonarjs/prefer-promise-shorthand](https://lintradar.dev/rules/sonarjs/prefer-promise-shorthand.md): Shorthand promises should be used
- [sonarjs/prefer-native-axios-alternative](https://lintradar.dev/rules/sonarjs/prefer-native-axios-alternative.md): Native APIs should be preferred over Axios utility methods
- [sonarjs/prefer-read-only-props](https://lintradar.dev/rules/sonarjs/prefer-read-only-props.md): React props should be read-only
- [sonarjs/prefer-default-last](https://lintradar.dev/rules/sonarjs/prefer-default-last.md): "default" clauses should be last
- [sonarjs/prefer-regexp-exec](https://lintradar.dev/rules/sonarjs/prefer-regexp-exec.md): "RegExp.exec()" should be preferred over "String.match()"

---

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