> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# no-script-url

[Added in v0.4.2](https://github.com/web-infra-dev/rslint/releases/tag/v0.4.2)
## Configuration


```ts title=rslint.config.ts
import { defineConfig, js } from '@rslint/core';

export default defineConfig([
  js.configs.recommended,
  {
    rules: {
      'no-script-url': 'error',
    },
  },
]);
```

## Rule Details

Disallow `javascript:` URLs.

Using `javascript:` URLs is considered by some as a form of `eval`. Code passed in `javascript:` URLs has to be parsed and evaluated by the browser in the same way that `eval` is processed.

Examples of **incorrect** code for this rule:

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

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

Examples of **correct** code for this rule:

```javascript
location.href = 'https://example.com';
```

## Original Documentation

- [ESLint: no-script-url](https://eslint.org/docs/latest/rules/no-script-url)
- [Source code](https://github.com/eslint/eslint/blob/v10.8.1/lib/rules/no-script-url.js)
