Skip to content

Commit

Permalink
Add rules to check for global objects that have no static properties (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi authored Nov 20, 2024
1 parent 9fb19d6 commit 66e8b16
Show file tree
Hide file tree
Showing 23 changed files with 898 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,11 @@ Rules in this category are not included in any preset.
| [es-x/no-nonstandard-bigint-prototype-properties](./no-nonstandard-bigint-prototype-properties.md) | disallow non-standard properties on BigInt instance. | |
| [es-x/no-nonstandard-boolean-properties](./no-nonstandard-boolean-properties.md) | disallow non-standard static properties on `Boolean` class. | |
| [es-x/no-nonstandard-boolean-prototype-properties](./no-nonstandard-boolean-prototype-properties.md) | disallow non-standard properties on Boolean instance. | |
| [es-x/no-nonstandard-dataview-properties](./no-nonstandard-dataview-properties.md) | disallow non-standard static properties on `DataView` class. | |
| [es-x/no-nonstandard-dataview-prototype-properties](./no-nonstandard-dataview-prototype-properties.md) | disallow non-standard properties on DataView instance. | |
| [es-x/no-nonstandard-date-properties](./no-nonstandard-date-properties.md) | disallow non-standard static properties on `Date` class. | |
| [es-x/no-nonstandard-date-prototype-properties](./no-nonstandard-date-prototype-properties.md) | disallow non-standard properties on Date instance. | |
| [es-x/no-nonstandard-finalizationregistry-properties](./no-nonstandard-finalizationregistry-properties.md) | disallow non-standard static properties on `FinalizationRegistry` class. | |
| [es-x/no-nonstandard-finalizationregistry-prototype-properties](./no-nonstandard-finalizationregistry-prototype-properties.md) | disallow non-standard properties on FinalizationRegistry instance. | |
| [es-x/no-nonstandard-function-properties](./no-nonstandard-function-properties.md) | disallow non-standard static properties on `Function` class. | |
| [es-x/no-nonstandard-intl-collator-properties](./no-nonstandard-intl-collator-properties.md) | disallow non-standard static properties on `Intl.Collator` class. | |
Expand Down Expand Up @@ -432,16 +434,21 @@ Rules in this category are not included in any preset.
| [es-x/no-nonstandard-reflect-properties](./no-nonstandard-reflect-properties.md) | disallow non-standard static properties on `Reflect`. | |
| [es-x/no-nonstandard-regexp-properties](./no-nonstandard-regexp-properties.md) | disallow non-standard static properties on `RegExp` class. | |
| [es-x/no-nonstandard-regexp-prototype-properties](./no-nonstandard-regexp-prototype-properties.md) | disallow non-standard properties on RegExp instance. | |
| [es-x/no-nonstandard-set-properties](./no-nonstandard-set-properties.md) | disallow non-standard static properties on `Set` class. | |
| [es-x/no-nonstandard-set-prototype-properties](./no-nonstandard-set-prototype-properties.md) | disallow non-standard properties on Set instance. | |
| [es-x/no-nonstandard-sharedarraybuffer-properties](./no-nonstandard-sharedarraybuffer-properties.md) | disallow non-standard static properties on `SharedArrayBuffer` class. | |
| [es-x/no-nonstandard-sharedarraybuffer-prototype-properties](./no-nonstandard-sharedarraybuffer-prototype-properties.md) | disallow non-standard properties on SharedArrayBuffer instance. | |
| [es-x/no-nonstandard-string-properties](./no-nonstandard-string-properties.md) | disallow non-standard static properties on `String` class. | |
| [es-x/no-nonstandard-string-prototype-properties](./no-nonstandard-string-prototype-properties.md) | disallow non-standard properties on String instance. | |
| [es-x/no-nonstandard-symbol-properties](./no-nonstandard-symbol-properties.md) | disallow non-standard static properties on `Symbol` class. | |
| [es-x/no-nonstandard-symbol-prototype-properties](./no-nonstandard-symbol-prototype-properties.md) | disallow non-standard properties on Symbol instance. | |
| [es-x/no-nonstandard-typed-array-properties](./no-nonstandard-typed-array-properties.md) | disallow non-standard static properties on typed array class. | |
| [es-x/no-nonstandard-typed-array-prototype-properties](./no-nonstandard-typed-array-prototype-properties.md) | disallow non-standard properties on typed array instance. | |
| [es-x/no-nonstandard-weakmap-properties](./no-nonstandard-weakmap-properties.md) | disallow non-standard static properties on `WeakMap` class. | |
| [es-x/no-nonstandard-weakmap-prototype-properties](./no-nonstandard-weakmap-prototype-properties.md) | disallow non-standard properties on WeakMap instance. | |
| [es-x/no-nonstandard-weakref-properties](./no-nonstandard-weakref-properties.md) | disallow non-standard static properties on `WeakRef` class. | |
| [es-x/no-nonstandard-weakref-prototype-properties](./no-nonstandard-weakref-prototype-properties.md) | disallow non-standard properties on WeakRef instance. | |
| [es-x/no-nonstandard-weakset-properties](./no-nonstandard-weakset-properties.md) | disallow non-standard static properties on `WeakSet` class. | |
| [es-x/no-nonstandard-weakset-prototype-properties](./no-nonstandard-weakset-prototype-properties.md) | disallow non-standard properties on WeakSet instance. | |

## Deprecated
Expand Down
50 changes: 50 additions & 0 deletions docs/rules/no-nonstandard-dataview-properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "es-x/no-nonstandard-dataview-properties"
description: "disallow non-standard static properties on `DataView` class"
---

# es-x/no-nonstandard-dataview-properties
> disallow non-standard static properties on `DataView` class
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>

This rule reports non-standard static properties on `DataView` class as errors.

## 💡 Examples

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

<eslint-playground type="bad">

```js
/*eslint es-x/no-nonstandard-dataview-properties: error */
DataView.unknown();
```

</eslint-playground>

## 🔧 Options

This rule has an option.

```jsonc
{
"rules": {
"es-x/no-nonstandard-dataview-properties": [
"error",
{
"allow": []
}
]
}
}
```

### allow: string[]

An array of non-standard property names to allow.

## 📚 References

- [Rule source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/lib/rules/no-nonstandard-dataview-properties.js)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-nonstandard-dataview-properties.js)
50 changes: 50 additions & 0 deletions docs/rules/no-nonstandard-finalizationregistry-properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "es-x/no-nonstandard-finalizationregistry-properties"
description: "disallow non-standard static properties on `FinalizationRegistry` class"
---

# es-x/no-nonstandard-finalizationregistry-properties
> disallow non-standard static properties on `FinalizationRegistry` class
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>

This rule reports non-standard static properties on `FinalizationRegistry` class as errors.

## 💡 Examples

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

<eslint-playground type="bad">

```js
/*eslint es-x/no-nonstandard-finalizationregistry-properties: error */
FinalizationRegistry.unknown();
```

</eslint-playground>

## 🔧 Options

This rule has an option.

```jsonc
{
"rules": {
"es-x/no-nonstandard-finalizationregistry-properties": [
"error",
{
"allow": []
}
]
}
}
```

### allow: string[]

An array of non-standard property names to allow.

## 📚 References

- [Rule source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/lib/rules/no-nonstandard-finalizationregistry-properties.js)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-nonstandard-finalizationregistry-properties.js)
50 changes: 50 additions & 0 deletions docs/rules/no-nonstandard-set-properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "es-x/no-nonstandard-set-properties"
description: "disallow non-standard static properties on `Set` class"
---

# es-x/no-nonstandard-set-properties
> disallow non-standard static properties on `Set` class
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>

This rule reports non-standard static properties on `Set` class as errors.

## 💡 Examples

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

<eslint-playground type="bad">

```js
/*eslint es-x/no-nonstandard-set-properties: error */
Set.unknown();
```

</eslint-playground>

## 🔧 Options

This rule has an option.

```jsonc
{
"rules": {
"es-x/no-nonstandard-set-properties": [
"error",
{
"allow": []
}
]
}
}
```

### allow: string[]

An array of non-standard property names to allow.

## 📚 References

- [Rule source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/lib/rules/no-nonstandard-set-properties.js)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-nonstandard-set-properties.js)
50 changes: 50 additions & 0 deletions docs/rules/no-nonstandard-sharedarraybuffer-properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "es-x/no-nonstandard-sharedarraybuffer-properties"
description: "disallow non-standard static properties on `SharedArrayBuffer` class"
---

# es-x/no-nonstandard-sharedarraybuffer-properties
> disallow non-standard static properties on `SharedArrayBuffer` class
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>

This rule reports non-standard static properties on `SharedArrayBuffer` class as errors.

## 💡 Examples

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

<eslint-playground type="bad">

```js
/*eslint es-x/no-nonstandard-sharedarraybuffer-properties: error */
SharedArrayBuffer.unknown();
```

</eslint-playground>

## 🔧 Options

This rule has an option.

```jsonc
{
"rules": {
"es-x/no-nonstandard-sharedarraybuffer-properties": [
"error",
{
"allow": []
}
]
}
}
```

### allow: string[]

An array of non-standard property names to allow.

## 📚 References

- [Rule source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/lib/rules/no-nonstandard-sharedarraybuffer-properties.js)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-nonstandard-sharedarraybuffer-properties.js)
50 changes: 50 additions & 0 deletions docs/rules/no-nonstandard-weakmap-properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "es-x/no-nonstandard-weakmap-properties"
description: "disallow non-standard static properties on `WeakMap` class"
---

# es-x/no-nonstandard-weakmap-properties
> disallow non-standard static properties on `WeakMap` class
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>

This rule reports non-standard static properties on `WeakMap` class as errors.

## 💡 Examples

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

<eslint-playground type="bad">

```js
/*eslint es-x/no-nonstandard-weakmap-properties: error */
WeakMap.unknown();
```

</eslint-playground>

## 🔧 Options

This rule has an option.

```jsonc
{
"rules": {
"es-x/no-nonstandard-weakmap-properties": [
"error",
{
"allow": []
}
]
}
}
```

### allow: string[]

An array of non-standard property names to allow.

## 📚 References

- [Rule source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/lib/rules/no-nonstandard-weakmap-properties.js)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-nonstandard-weakmap-properties.js)
50 changes: 50 additions & 0 deletions docs/rules/no-nonstandard-weakref-properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "es-x/no-nonstandard-weakref-properties"
description: "disallow non-standard static properties on `WeakRef` class"
---

# es-x/no-nonstandard-weakref-properties
> disallow non-standard static properties on `WeakRef` class
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>

This rule reports non-standard static properties on `WeakRef` class as errors.

## 💡 Examples

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

<eslint-playground type="bad">

```js
/*eslint es-x/no-nonstandard-weakref-properties: error */
WeakRef.unknown();
```

</eslint-playground>

## 🔧 Options

This rule has an option.

```jsonc
{
"rules": {
"es-x/no-nonstandard-weakref-properties": [
"error",
{
"allow": []
}
]
}
}
```

### allow: string[]

An array of non-standard property names to allow.

## 📚 References

- [Rule source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/lib/rules/no-nonstandard-weakref-properties.js)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-nonstandard-weakref-properties.js)
50 changes: 50 additions & 0 deletions docs/rules/no-nonstandard-weakset-properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "es-x/no-nonstandard-weakset-properties"
description: "disallow non-standard static properties on `WeakSet` class"
---

# es-x/no-nonstandard-weakset-properties
> disallow non-standard static properties on `WeakSet` class
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>

This rule reports non-standard static properties on `WeakSet` class as errors.

## 💡 Examples

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

<eslint-playground type="bad">

```js
/*eslint es-x/no-nonstandard-weakset-properties: error */
WeakSet.unknown();
```

</eslint-playground>

## 🔧 Options

This rule has an option.

```jsonc
{
"rules": {
"es-x/no-nonstandard-weakset-properties": [
"error",
{
"allow": []
}
]
}
}
```

### allow: string[]

An array of non-standard property names to allow.

## 📚 References

- [Rule source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/lib/rules/no-nonstandard-weakset-properties.js)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-nonstandard-weakset-properties.js)
Loading

0 comments on commit 66e8b16

Please sign in to comment.