# future-reserved-words

Rule `sonarjs/future-reserved-words`. Future reserved words should not be used as identifiers

- 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: #1219 by reach, #520 by growth

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
var package = document.getElementsByName("foo"); // Noncompliant
var someData = { package: true };                 // Compliant, as it is not used as an identifier here
```

### Correct: the rule accepts this

```js
var elements = document.getElementsByName("foo"); // Compliant
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/future-reserved-words": "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/function-return-type](https://lintradar.dev/rules/sonarjs/function-return-type.md): Functions should always return the same type
- [sonarjs/generator-without-yield](https://lintradar.dev/rules/sonarjs/generator-without-yield.md): Generators should explicitly "yield" a value
- [sonarjs/function-inside-loop](https://lintradar.dev/rules/sonarjs/function-inside-loop.md): Functions should not be defined inside loops
- [sonarjs/hardcoded-secret-signatures](https://lintradar.dev/rules/sonarjs/hardcoded-secret-signatures.md): Credentials should not be hard-coded
- [sonarjs/for-loop-increment-sign](https://lintradar.dev/rules/sonarjs/for-loop-increment-sign.md): A "for" loop update clause should move the counter in the right direction
- [sonarjs/hashing](https://lintradar.dev/rules/sonarjs/hashing.md): Weak hashing algorithms should not be used

---

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