Skip to content

Commit 31bc678

Browse files
committed
update
1 parent 0f7e430 commit 31bc678

17 files changed

+88
-11
lines changed

.changeset/no-string-matchall.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": minor
3+
---
4+
5+
Add `no-string-matchall` config.

.changeset/real-kiwis-love.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"eslint-plugin-es-x": major
33
---
44

5-
Update configs: `no-new-in-es2015`, `restrict-to-es3`, and `restrict-to-es5`.
5+
Update configs: `no-new-in-es2020`, and `restrict-to-es3` - `restrict-to-es2019`.

docs/configs/index.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,5 +1401,32 @@ export default [
14011401
}
14021402
```
14031403

1404+
## no-string-matchall
1405+
1406+
disallow proposal ES2020 [String.prototype.matchAll](https://github.com/tc39/proposal-string-matchall)
1407+
1408+
This configs includes rules for [es-x/no-string-prototype-matchall](../rules/no-string-prototype-matchall.md) and [es-x/no-symbol-matchall](../rules/no-symbol-matchall.md).
1409+
1410+
### [Config (Flat Config)]
1411+
1412+
eslint.config.js:
1413+
1414+
```js
1415+
import pluginESx from "eslint-plugin-es-x"
1416+
export default [
1417+
pluginESx.configs['flat/no-string-matchall']
1418+
]
1419+
```
1420+
1421+
### [Legacy Config]
1422+
1423+
.eslintrc.*:
1424+
1425+
```json
1426+
{
1427+
"extends": ["plugin:es-x/no-string-matchall"],
1428+
}
1429+
```
1430+
14041431
[Config (Flat Config)]: https://eslint.org/docs/latest/use/configure/configuration-files
14051432
[Legacy Config]: https://eslint.org/docs/latest/use/configure/configuration-files-deprecated

docs/rules/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ There are multiple configs that enable all rules in this category: [`no-new-in-e
173173
| [es-x/no-promise-all-settled](./no-promise-all-settled.md) | disallow `Promise.allSettled` function. | |
174174
| [es-x/no-regexp-unicode-property-escapes-2020](./no-regexp-unicode-property-escapes-2020.md) | disallow the new values of RegExp Unicode property escape sequences in ES2020. | |
175175
| [es-x/no-string-prototype-matchall](./no-string-prototype-matchall.md) | disallow the `String.prototype.matchAll` method. | |
176+
| [es-x/no-symbol-matchall](./no-symbol-matchall.md) | disallow the `Symbol.matchAll` property. | |
176177

177178
## ES2020 Intl API
178179

@@ -340,7 +341,6 @@ There are multiple configs that enable all rules in this category: [`no-new-in-e
340341
| [es-x/no-string-prototype-startswith](./no-string-prototype-startswith.md) | disallow the `String.prototype.startsWith` method. | |
341342
| [es-x/no-string-raw](./no-string-raw.md) | disallow the `String.raw` method. | |
342343
| [es-x/no-subclassing-builtins](./no-subclassing-builtins.md) | disallow the subclassing of the built-in classes. | |
343-
| [es-x/no-symbol-matchall](./no-symbol-matchall.md) | disallow the `Symbol.matchAll` property. | |
344344
| [es-x/no-symbol](./no-symbol.md) | disallow the `Symbol` class. | |
345345
| [es-x/no-template-literals](./no-template-literals.md) | disallow template literals. | 🔧 |
346346
| [es-x/no-typed-arrays](./no-typed-arrays.md) | disallow ES2015 typed arrays. | |

docs/rules/no-string-prototype-matchall.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ since: "[eslint-plugin-es] v5.0.0"
77
# es-x/no-string-prototype-matchall
88
> disallow the `String.prototype.matchAll` method
99
10-
- ✅ The following configurations enable this rule: [no-new-in-es2020], [restrict-to-es3], [restrict-to-es5], [restrict-to-es2015], [restrict-to-es2016], [restrict-to-es2017], [restrict-to-es2018], and [restrict-to-es2019]
10+
- ✅ The following configurations enable this rule: [no-new-in-es2020], [no-string-matchall], [restrict-to-es3], [restrict-to-es5], [restrict-to-es2015], [restrict-to-es2016], [restrict-to-es2017], [restrict-to-es2018], and [restrict-to-es2019]
1111

1212
This rule reports ES2020 [`String.prototype.matchAll` method](https://github.com/tc39/proposal-string-matchall) as errors.
1313

@@ -66,6 +66,7 @@ This rule was introduced in [eslint-plugin-es] v5.0.0.
6666
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-string-prototype-matchall.js)
6767

6868
[no-new-in-es2020]: ../configs/index.md#no-new-in-es2020
69+
[no-string-matchall]: ../configs/index.md#no-string-matchall
6970
[restrict-to-es3]: ../configs/index.md#restrict-to-es3
7071
[restrict-to-es5]: ../configs/index.md#restrict-to-es5
7172
[restrict-to-es2015]: ../configs/index.md#restrict-to-es2015

docs/rules/no-symbol-matchall.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ description: "disallow the `Symbol.matchAll` property"
77
> disallow the `Symbol.matchAll` 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-es2015], [restrict-to-es3], and [restrict-to-es5]
10+
- ✅ The following configurations enable this rule: [no-new-in-es2020], [no-string-matchall], [restrict-to-es3], [restrict-to-es5], [restrict-to-es2015], [restrict-to-es2016], [restrict-to-es2017], [restrict-to-es2018], and [restrict-to-es2019]
1111

12-
This rule reports ES2015 [`Symbol.matchAll` property](https://github.com/tc39/proposal-string-matchall) as errors.
12+
This rule reports ES2020 [`Symbol.matchAll` property](https://github.com/tc39/proposal-string-matchall) as errors.
1313

1414
## 💡 Examples
1515

@@ -51,6 +51,12 @@ 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-matchall.js)
5252
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-symbol-matchall.js)
5353

54-
[no-new-in-es2015]: ../configs/index.md#no-new-in-es2015
54+
[no-new-in-es2020]: ../configs/index.md#no-new-in-es2020
55+
[no-string-matchall]: ../configs/index.md#no-string-matchall
5556
[restrict-to-es3]: ../configs/index.md#restrict-to-es3
5657
[restrict-to-es5]: ../configs/index.md#restrict-to-es5
58+
[restrict-to-es2015]: ../configs/index.md#restrict-to-es2015
59+
[restrict-to-es2016]: ../configs/index.md#restrict-to-es2016
60+
[restrict-to-es2017]: ../configs/index.md#restrict-to-es2017
61+
[restrict-to-es2018]: ../configs/index.md#restrict-to-es2018
62+
[restrict-to-es2019]: ../configs/index.md#restrict-to-es2019

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ module.exports = {
8484
"es-x/no-string-prototype-startswith": "error",
8585
"es-x/no-string-raw": "error",
8686
"es-x/no-subclassing-builtins": "error",
87-
"es-x/no-symbol-matchall": "error",
8887
"es-x/no-symbol": "error",
8988
"es-x/no-template-literals": "error",
9089
"es-x/no-typed-arrays": "error",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ module.exports = {
2121
"es-x/no-promise-all-settled": "error",
2222
"es-x/no-regexp-unicode-property-escapes-2020": "error",
2323
"es-x/no-string-prototype-matchall": "error",
24+
"es-x/no-symbol-matchall": "error",
2425
},
2526
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* DON'T EDIT THIS FILE.
3+
* This file was generated by "scripts/update-lib-flat-configs.js" script.
4+
*/
5+
"use strict"
6+
7+
module.exports = {
8+
plugins: {
9+
get "es-x"() {
10+
return require("../../index.js")
11+
},
12+
},
13+
rules: {
14+
"es-x/no-string-prototype-matchall": "error",
15+
"es-x/no-symbol-matchall": "error",
16+
},
17+
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ module.exports = {
8080
"es-x/no-string-prototype-startswith": "error",
8181
"es-x/no-string-raw": "error",
8282
"es-x/no-subclassing-builtins": "error",
83-
"es-x/no-symbol-matchall": "error",
8483
"es-x/no-symbol": "error",
8584
"es-x/no-template-literals": "error",
8685
"es-x/no-typed-arrays": "error",

0 commit comments

Comments
 (0)