# no-intrusive-permissions

Rule `sonarjs/no-intrusive-permissions`. Sensitive permissions should not be requested unnecessarily

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

## Linters

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

## Code examples

### Correct: the rule accepts this

```js
<html>
<head>
    <title>
        Retailer website example
    </title>
</head>
<body>
    Type a city, street or zip code where you want to retrieve the closest retail locations of our products:
    <form method=post>
        <input type=text value="New York"> <!-- Compliant -->
    </form>
</body>
</html>
```

Examples from the ESLint documentation.

## Enable it

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

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

## Related rules

- [sonarjs/no-incorrect-string-concat](https://lintradar.dev/rules/sonarjs/no-incorrect-string-concat.md): Strings and non-strings should not be added
- [sonarjs/no-inconsistent-returns](https://lintradar.dev/rules/sonarjs/no-inconsistent-returns.md): Functions should use "return" consistently
- [sonarjs/no-mixed-completion-style](https://lintradar.dev/rules/sonarjs/no-mixed-completion-style.md): Test and hook callbacks should use a single completion style
- [sonarjs/no-implicit-dependencies](https://lintradar.dev/rules/sonarjs/no-implicit-dependencies.md): Dependencies should be explicit
- [sonarjs/no-function-declaration-in-block](https://lintradar.dev/rules/sonarjs/no-function-declaration-in-block.md): Function declarations should not be made within blocks
- [sonarjs/no-nested-incdec](https://lintradar.dev/rules/sonarjs/no-nested-incdec.md): Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression

---

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