# no-selector-parameter

Rule `sonarjs/no-selector-parameter`. Methods should not contain selector parameters

- 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: #1314 by reach, #615 by growth

## Linters

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

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/no-selector-parameter": "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-same-line-conditional](https://lintradar.dev/rules/sonarjs/no-same-line-conditional.md): Conditionals should start on new lines
- [sonarjs/no-session-cookies-on-static-assets](https://lintradar.dev/rules/sonarjs/no-session-cookies-on-static-assets.md): Static Assets should not serve session cookies
- [sonarjs/no-same-argument-assert](https://lintradar.dev/rules/sonarjs/no-same-argument-assert.md): Assertions should not be given twice the same argument
- [sonarjs/no-skipped-tests](https://lintradar.dev/rules/sonarjs/no-skipped-tests.md): Tests should not be skipped without providing a reason
- [sonarjs/no-regex-spaces](https://lintradar.dev/rules/sonarjs/no-regex-spaces.md): Regular expressions should not contain multiple spaces
- [sonarjs/no-small-switch](https://lintradar.dev/rules/sonarjs/no-small-switch.md): "if" statements should be preferred over "switch" when simpler

---

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