# no-script-url

Rule `eslint/no-script-url`. Disallow `javascript:` URLs

- Source: eslint
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 46.4M weekly downloads of presets that enable it
- Trend: +54.9% last quarter
- Rank: #290 by reach, #742 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-script-url` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-script-url) |
| Oxlint | `no-script-url` | no | no | plugin `eslint`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-script-url.html) |
| Biome | `security/noScriptUrl` | yes | no | group security, since 2.3.9 | [docs](https://biomejs.dev/linter/rules/no-script-url/) |

## Code examples

### Incorrect: the rule reports this

```js
location.href = "javascript:void(0)";

location.href = `javascript:void(0)`;
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "no-script-url": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-script-url": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "security": {
        "noScriptUrl": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Airbnb base](https://lintradar.dev/presets/airbnb-base.md) | ESLint | `eslint-config-airbnb-base` | 241 | 6.5M | +2.1% |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [Airbnb](https://lintradar.dev/presets/airbnb.md) | ESLint | `eslint-config-airbnb` | 346 | 3.4M | +2.3% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [React Native](https://lintradar.dev/presets/react-native.md) | ESLint | `@react-native/eslint-config` | 79 | 1.2M | +5.8% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [eslint/no-undef-init](https://lintradar.dev/rules/eslint/no-undef-init.md): Disallow initializing variables to `undefined`
- [eslint/no-proto](https://lintradar.dev/rules/eslint/no-proto.md): Disallow the use of the `__proto__` property
- [eslint/no-label-var](https://lintradar.dev/rules/eslint/no-label-var.md): Disallow labels that share a name with a variable
- [eslint/new-cap](https://lintradar.dev/rules/eslint/new-cap.md): Require constructor names to begin with a capital letter
- [eslint/dot-notation](https://lintradar.dev/rules/eslint/dot-notation.md): Enforce dot notation whenever possible
- [eslint/no-array-constructor](https://lintradar.dev/rules/eslint/no-array-constructor.md): Disallow `Array` constructors

---

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