|
| 1 | +--- |
| 2 | +title: "es-x/no-symbol-asyncdispose" |
| 3 | +description: "disallow the `Symbol.asyncDispose` property" |
| 4 | +--- |
| 5 | + |
| 6 | +# es-x/no-symbol-asyncdispose |
| 7 | +> disallow the `Symbol.asyncDispose` property |
| 8 | +
|
| 9 | +- ❗ <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] |
| 11 | + |
| 12 | +This rule reports ES2025 [`Symbol.asyncDispose` property]($$LINK$$) as errors. |
| 13 | + |
| 14 | +## 💡 Examples |
| 15 | + |
| 16 | +⛔ Examples of **incorrect** code for this rule: |
| 17 | + |
| 18 | +<eslint-playground type="bad"> |
| 19 | + |
| 20 | +```js |
| 21 | +/*eslint es-x/no-symbol-asyncdispose: error */ |
| 22 | +x[Symbol.asyncDispose]; |
| 23 | +``` |
| 24 | + |
| 25 | +</eslint-playground> |
| 26 | + |
| 27 | +## 🔧 Options |
| 28 | + |
| 29 | +This rule has an option. |
| 30 | + |
| 31 | +```jsonc |
| 32 | +{ |
| 33 | + "rules": { |
| 34 | + "es-x/no-symbol-asyncdispose": [ |
| 35 | + "error", |
| 36 | + { |
| 37 | + "allowTestedProperty": false |
| 38 | + } |
| 39 | + ] |
| 40 | + } |
| 41 | +} |
| 42 | +``` |
| 43 | + |
| 44 | +### allowTestedProperty: boolean |
| 45 | + |
| 46 | +Configure the allowTestedProperty mode for only this rule. |
| 47 | +This is prior to the `settings['es-x'].allowTestedProperty` setting. |
| 48 | + |
| 49 | +## 📚 References |
| 50 | + |
| 51 | +- [Rule source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/lib/rules/no-symbol-asyncdispose.js) |
| 52 | +- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-symbol-asyncdispose.js) |
| 53 | + |
| 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 |
0 commit comments