Skip to content

Commit 092d93b

Browse files
authored
fix: no-symbol-dispose and no-symbol-asyncdispose category (#270)
1 parent ac1db47 commit 092d93b

15 files changed

+32
-43
lines changed

.changeset/update-config.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-es-x": major
3+
---
4+
5+
Update `no-explicit-resource-management` config.

docs/configs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ export default [
11081108
disallow proposal ES2026 [Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management)\
11091109
⚠️ This config will be changed in the minor versions of this plugin.
11101110

1111-
This configs includes rules for [es-x/no-asyncdisposablestack](../rules/no-asyncdisposablestack.md), [es-x/no-disposablestack](../rules/no-disposablestack.md), [es-x/no-suppressederror](../rules/no-suppressederror.md), and [es-x/no-using-declarations](../rules/no-using-declarations.md).
1111+
This configs includes rules for [es-x/no-asyncdisposablestack](../rules/no-asyncdisposablestack.md), [es-x/no-disposablestack](../rules/no-disposablestack.md), [es-x/no-suppressederror](../rules/no-suppressederror.md), [es-x/no-symbol-asyncdispose](../rules/no-symbol-asyncdispose.md), [es-x/no-symbol-dispose](../rules/no-symbol-dispose.md), and [es-x/no-using-declarations](../rules/no-using-declarations.md).
11121112

11131113
### [Config (Flat Config)]
11141114

docs/rules/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ There is a config that enables the rules in this category: [`no-new-in-esnext`]
1515
| [es-x/no-disposablestack](./no-disposablestack.md) | disallow the `DisposableStack` class. | |
1616
| [es-x/no-error-iserror](./no-error-iserror.md) | disallow the `Error.isError` method. | |
1717
| [es-x/no-suppressederror](./no-suppressederror.md) | disallow the `SuppressedError` class. | |
18+
| [es-x/no-symbol-asyncdispose](./no-symbol-asyncdispose.md) | disallow the `Symbol.asyncDispose` property. | |
19+
| [es-x/no-symbol-dispose](./no-symbol-dispose.md) | disallow the `Symbol.dispose` property. | |
1820
| [es-x/no-using-declarations](./no-using-declarations.md) | disallow `using` and `await using` declarations. | |
1921

2022
## ES2025
@@ -52,8 +54,6 @@ There are multiple configs that enable all rules in this category: [`no-new-in-e
5254
| [es-x/no-set-prototype-issupersetof](./no-set-prototype-issupersetof.md) | disallow the `Set.prototype.isSupersetOf` method. | |
5355
| [es-x/no-set-prototype-symmetricdifference](./no-set-prototype-symmetricdifference.md) | disallow the `Set.prototype.symmetricDifference` method. | |
5456
| [es-x/no-set-prototype-union](./no-set-prototype-union.md) | disallow the `Set.prototype.union` method. | |
55-
| [es-x/no-symbol-asyncdispose](./no-symbol-asyncdispose.md) | disallow the `Symbol.asyncDispose` property. | |
56-
| [es-x/no-symbol-dispose](./no-symbol-dispose.md) | disallow the `Symbol.dispose` property. | |
5757
| [es-x/no-trailing-dynamic-import-commas](./no-trailing-dynamic-import-commas.md) | disallow trailing commas in `import()`. | 🔧 |
5858

5959
## ES2025 Intl API

docs/rules/no-symbol-asyncdispose.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ description: "disallow the `Symbol.asyncDispose` property"
77
> disallow the `Symbol.asyncDispose` property
88
99
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
10-
- ✅ The following configurations enable this rule: [no-new-in-es2025], [restrict-to-es3], [restrict-to-es5], [restrict-to-es2015], [restrict-to-es2016], [restrict-to-es2017], [restrict-to-es2018], [restrict-to-es2019], [restrict-to-es2020], [restrict-to-es2021], [restrict-to-es2022], [restrict-to-es2023], and [restrict-to-es2024]
10+
- ✅ The following configurations enable this rule: [no-explicit-resource-management] and [no-new-in-esnext]
1111

12-
This rule reports ES2025 [`Symbol.asyncDispose` property](https://github.com/tc39/proposal-explicit-resource-management) as errors.
12+
This rule reports ES2026 [`Symbol.asyncDispose` property](https://github.com/tc39/proposal-explicit-resource-management) as errors.
1313

1414
## 💡 Examples
1515

@@ -51,16 +51,5 @@ This is prior to the `settings['es-x'].allowTestedProperty` setting.
5151
- [Rule source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/lib/rules/no-symbol-asyncdispose.js)
5252
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-symbol-asyncdispose.js)
5353

54-
[no-new-in-es2025]: ../configs/index.md#no-new-in-es2025
55-
[restrict-to-es3]: ../configs/index.md#restrict-to-es3
56-
[restrict-to-es5]: ../configs/index.md#restrict-to-es5
57-
[restrict-to-es2015]: ../configs/index.md#restrict-to-es2015
58-
[restrict-to-es2016]: ../configs/index.md#restrict-to-es2016
59-
[restrict-to-es2017]: ../configs/index.md#restrict-to-es2017
60-
[restrict-to-es2018]: ../configs/index.md#restrict-to-es2018
61-
[restrict-to-es2019]: ../configs/index.md#restrict-to-es2019
62-
[restrict-to-es2020]: ../configs/index.md#restrict-to-es2020
63-
[restrict-to-es2021]: ../configs/index.md#restrict-to-es2021
64-
[restrict-to-es2022]: ../configs/index.md#restrict-to-es2022
65-
[restrict-to-es2023]: ../configs/index.md#restrict-to-es2023
66-
[restrict-to-es2024]: ../configs/index.md#restrict-to-es2024
54+
[no-explicit-resource-management]: ../configs/index.md#no-explicit-resource-management
55+
[no-new-in-esnext]: ../configs/index.md#no-new-in-esnext

docs/rules/no-symbol-dispose.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ description: "disallow the `Symbol.dispose` property"
77
> disallow the `Symbol.dispose` property
88
99
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
10-
- ✅ The following configurations enable this rule: [no-new-in-es2025], [restrict-to-es3], [restrict-to-es5], [restrict-to-es2015], [restrict-to-es2016], [restrict-to-es2017], [restrict-to-es2018], [restrict-to-es2019], [restrict-to-es2020], [restrict-to-es2021], [restrict-to-es2022], [restrict-to-es2023], and [restrict-to-es2024]
10+
- ✅ The following configurations enable this rule: [no-explicit-resource-management] and [no-new-in-esnext]
1111

12-
This rule reports ES2025 [`Symbol.dispose` property](https://github.com/tc39/proposal-explicit-resource-management) as errors.
12+
This rule reports ES2026 [`Symbol.dispose` property](https://github.com/tc39/proposal-explicit-resource-management) as errors.
1313

1414
## 💡 Examples
1515

@@ -51,16 +51,5 @@ This is prior to the `settings['es-x'].allowTestedProperty` setting.
5151
- [Rule source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/lib/rules/no-symbol-dispose.js)
5252
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-symbol-dispose.js)
5353

54-
[no-new-in-es2025]: ../configs/index.md#no-new-in-es2025
55-
[restrict-to-es3]: ../configs/index.md#restrict-to-es3
56-
[restrict-to-es5]: ../configs/index.md#restrict-to-es5
57-
[restrict-to-es2015]: ../configs/index.md#restrict-to-es2015
58-
[restrict-to-es2016]: ../configs/index.md#restrict-to-es2016
59-
[restrict-to-es2017]: ../configs/index.md#restrict-to-es2017
60-
[restrict-to-es2018]: ../configs/index.md#restrict-to-es2018
61-
[restrict-to-es2019]: ../configs/index.md#restrict-to-es2019
62-
[restrict-to-es2020]: ../configs/index.md#restrict-to-es2020
63-
[restrict-to-es2021]: ../configs/index.md#restrict-to-es2021
64-
[restrict-to-es2022]: ../configs/index.md#restrict-to-es2022
65-
[restrict-to-es2023]: ../configs/index.md#restrict-to-es2023
66-
[restrict-to-es2024]: ../configs/index.md#restrict-to-es2024
54+
[no-explicit-resource-management]: ../configs/index.md#no-explicit-resource-management
55+
[no-new-in-esnext]: ../configs/index.md#no-new-in-esnext

lib/configs/flat/no-explicit-resource-management.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ module.exports = {
1414
"es-x/no-asyncdisposablestack": "error",
1515
"es-x/no-disposablestack": "error",
1616
"es-x/no-suppressederror": "error",
17+
"es-x/no-symbol-asyncdispose": "error",
18+
"es-x/no-symbol-dispose": "error",
1719
"es-x/no-using-declarations": "error",
1820
},
1921
}

lib/configs/flat/no-new-in-es2025.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ module.exports = {
4040
"es-x/no-set-prototype-issupersetof": "error",
4141
"es-x/no-set-prototype-symmetricdifference": "error",
4242
"es-x/no-set-prototype-union": "error",
43-
"es-x/no-symbol-asyncdispose": "error",
44-
"es-x/no-symbol-dispose": "error",
4543
"es-x/no-trailing-dynamic-import-commas": "error",
4644
},
4745
}

lib/configs/flat/no-new-in-esnext.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ module.exports = {
1616
"es-x/no-disposablestack": "error",
1717
"es-x/no-error-iserror": "error",
1818
"es-x/no-suppressederror": "error",
19+
"es-x/no-symbol-asyncdispose": "error",
20+
"es-x/no-symbol-dispose": "error",
1921
"es-x/no-using-declarations": "error",
2022
},
2123
}

lib/configs/no-explicit-resource-management.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module.exports = {
1010
"es-x/no-asyncdisposablestack": "error",
1111
"es-x/no-disposablestack": "error",
1212
"es-x/no-suppressederror": "error",
13+
"es-x/no-symbol-asyncdispose": "error",
14+
"es-x/no-symbol-dispose": "error",
1315
"es-x/no-using-declarations": "error",
1416
},
1517
}

lib/configs/no-new-in-es2025.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ module.exports = {
3636
"es-x/no-set-prototype-issupersetof": "error",
3737
"es-x/no-set-prototype-symmetricdifference": "error",
3838
"es-x/no-set-prototype-union": "error",
39-
"es-x/no-symbol-asyncdispose": "error",
40-
"es-x/no-symbol-dispose": "error",
4139
"es-x/no-trailing-dynamic-import-commas": "error",
4240
},
4341
}

0 commit comments

Comments
 (0)