Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Apr 19, 2024
1 parent 65dff6c commit da64444
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 8 deletions.
25 changes: 25 additions & 0 deletions docs/configs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,31 @@ export default [
}
```

## no-set-methods

disallow proposal [Set Methods for JavaScript](https://github.com/tc39/proposal-set-methods)

### [Config (Flat Config)]

eslint.config.js:

```js
import pluginESx from "eslint-plugin-es-x"
export default [
pluginESx.configs['flat/no-set-methods']
]
```

### [Legacy Config]

.eslintrc.*:

```json
{
"extends": ["plugin:es-x/no-set-methods"],
}
```

## restrict-to-es2022

disallow new stuff that ES2023 doesn't include
Expand Down
3 changes: 2 additions & 1 deletion docs/rules/no-set-prototype-difference.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "disallow the `Set.prototype.difference` method"
> disallow the `Set.prototype.difference` method
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
- ✅ The following configurations enable this rule: [no-new-in-esnext]
- ✅ The following configurations enable this rule: [no-new-in-esnext] and [no-set-methods]

This rule reports ES2025 [`Set.prototype.difference`](https://github.com/tc39/proposal-set-methods) methods as errors.

Expand All @@ -34,3 +34,4 @@ a.difference(b)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-set-prototype-difference.js)

[no-new-in-esnext]: ../configs/index.md#no-new-in-esnext
[no-set-methods]: ../configs/index.md#no-set-methods
3 changes: 2 additions & 1 deletion docs/rules/no-set-prototype-intersection.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "disallow the `Set.prototype.intersection` method"
> disallow the `Set.prototype.intersection` method
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
- ✅ The following configurations enable this rule: [no-new-in-esnext]
- ✅ The following configurations enable this rule: [no-new-in-esnext] and [no-set-methods]

This rule reports ES2025 [`Set.prototype.intersection`](https://github.com/tc39/proposal-set-methods) methods as errors.

Expand All @@ -34,3 +34,4 @@ a.intersection(b)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-set-prototype-intersection.js)

[no-new-in-esnext]: ../configs/index.md#no-new-in-esnext
[no-set-methods]: ../configs/index.md#no-set-methods
3 changes: 2 additions & 1 deletion docs/rules/no-set-prototype-isdisjointfrom.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "disallow the `Set.prototype.isDisjointFrom` method"
> disallow the `Set.prototype.isDisjointFrom` method
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
- ✅ The following configurations enable this rule: [no-new-in-esnext]
- ✅ The following configurations enable this rule: [no-new-in-esnext] and [no-set-methods]

This rule reports ES2025 [`Set.prototype.isDisjointFrom`](https://github.com/tc39/proposal-set-methods) methods as errors.

Expand All @@ -34,3 +34,4 @@ a.isDisjointFrom(b)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-set-prototype-isdisjointfrom.js)

[no-new-in-esnext]: ../configs/index.md#no-new-in-esnext
[no-set-methods]: ../configs/index.md#no-set-methods
3 changes: 2 additions & 1 deletion docs/rules/no-set-prototype-issubsetof.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "disallow the `Set.prototype.isSubsetOf` method"
> disallow the `Set.prototype.isSubsetOf` method
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
- ✅ The following configurations enable this rule: [no-new-in-esnext]
- ✅ The following configurations enable this rule: [no-new-in-esnext] and [no-set-methods]

This rule reports ES2025 [`Set.prototype.isSubsetOf`](https://github.com/tc39/proposal-set-methods) methods as errors.

Expand All @@ -34,3 +34,4 @@ a.isSubsetOf(b)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-set-prototype-issubsetof.js)

[no-new-in-esnext]: ../configs/index.md#no-new-in-esnext
[no-set-methods]: ../configs/index.md#no-set-methods
3 changes: 2 additions & 1 deletion docs/rules/no-set-prototype-issupersetof.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "disallow the `Set.prototype.isSupersetOf` method"
> disallow the `Set.prototype.isSupersetOf` method
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
- ✅ The following configurations enable this rule: [no-new-in-esnext]
- ✅ The following configurations enable this rule: [no-new-in-esnext] and [no-set-methods]

This rule reports ES2025 [`Set.prototype.isSupersetOf`](https://github.com/tc39/proposal-set-methods) methods as errors.

Expand All @@ -34,3 +34,4 @@ a.isSupersetOf(b)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-set-prototype-issupersetof.js)

[no-new-in-esnext]: ../configs/index.md#no-new-in-esnext
[no-set-methods]: ../configs/index.md#no-set-methods
3 changes: 2 additions & 1 deletion docs/rules/no-set-prototype-symmetricdifference.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "disallow the `Set.prototype.symmetricDifference` method"
> disallow the `Set.prototype.symmetricDifference` method
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
- ✅ The following configurations enable this rule: [no-new-in-esnext]
- ✅ The following configurations enable this rule: [no-new-in-esnext] and [no-set-methods]

This rule reports ES2025 [`Set.prototype.symmetricDifference`](https://github.com/tc39/proposal-set-methods) methods as errors.

Expand All @@ -34,3 +34,4 @@ a.symmetricDifference(b)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-set-prototype-symmetricdifference.js)

[no-new-in-esnext]: ../configs/index.md#no-new-in-esnext
[no-set-methods]: ../configs/index.md#no-set-methods
3 changes: 2 additions & 1 deletion docs/rules/no-set-prototype-union.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "disallow the `Set.prototype.union` method"
> disallow the `Set.prototype.union` method
- ❗ <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
- ✅ The following configurations enable this rule: [no-new-in-esnext]
- ✅ The following configurations enable this rule: [no-new-in-esnext] and [no-set-methods]

This rule reports ES2025 [`Set.prototype.union`](https://github.com/tc39/proposal-set-methods) methods as errors.

Expand All @@ -34,3 +34,4 @@ a.union(b)
- [Test source](https://github.com/eslint-community/eslint-plugin-es-x/blob/master/tests/lib/rules/no-set-prototype-union.js)

[no-new-in-esnext]: ../configs/index.md#no-new-in-esnext
[no-set-methods]: ../configs/index.md#no-set-methods
22 changes: 22 additions & 0 deletions lib/configs/flat/no-set-methods.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-flat-configs.js" script.
*/
"use strict"

module.exports = {
plugins: {
get "es-x"() {
return require("../../index.js")
},
},
rules: {
"es-x/no-set-prototype-difference": "error",
"es-x/no-set-prototype-intersection": "error",
"es-x/no-set-prototype-isdisjointfrom": "error",
"es-x/no-set-prototype-issubsetof": "error",
"es-x/no-set-prototype-issupersetof": "error",
"es-x/no-set-prototype-symmetricdifference": "error",
"es-x/no-set-prototype-union": "error",
},
}
18 changes: 18 additions & 0 deletions lib/configs/no-set-methods.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-configs.js" script.
*/
"use strict"

module.exports = {
plugins: ["es-x"],
rules: {
"es-x/no-set-prototype-difference": "error",
"es-x/no-set-prototype-intersection": "error",
"es-x/no-set-prototype-isdisjointfrom": "error",
"es-x/no-set-prototype-issubsetof": "error",
"es-x/no-set-prototype-issupersetof": "error",
"es-x/no-set-prototype-symmetricdifference": "error",
"es-x/no-set-prototype-union": "error",
},
}
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
"flat/no-new-in-es2023-intl-api": require("./configs/flat/no-new-in-es2023-intl-api"),
"flat/no-new-in-esnext": require("./configs/flat/no-new-in-esnext"),
"flat/no-new-in-esnext-intl-api": require("./configs/flat/no-new-in-esnext-intl-api"),
"flat/no-set-methods": require("./configs/flat/no-set-methods"),
"flat/restrict-to-es-intl-api-1st-edition": require("./configs/flat/restrict-to-es-intl-api-1st-edition"),
"flat/restrict-to-es3": require("./configs/flat/restrict-to-es3"),
"flat/restrict-to-es5": require("./configs/flat/restrict-to-es5"),
Expand Down Expand Up @@ -71,6 +72,7 @@ module.exports = {
"no-new-in-es2023-intl-api": require("./configs/no-new-in-es2023-intl-api"),
"no-new-in-esnext": require("./configs/no-new-in-esnext"),
"no-new-in-esnext-intl-api": require("./configs/no-new-in-esnext-intl-api"),
"no-set-methods": require("./configs/no-set-methods"),
"restrict-to-es-intl-api-1st-edition": require("./configs/restrict-to-es-intl-api-1st-edition"),
"restrict-to-es3": require("./configs/restrict-to-es3"),
"restrict-to-es5": require("./configs/restrict-to-es5"),
Expand Down
7 changes: 6 additions & 1 deletion scripts/proposals.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"use strict"

module.exports = {}
module.exports = {
"set-methods": {
title: "Set Methods for JavaScript",
link: "https://github.com/tc39/proposal-set-methods",
},
}

0 comments on commit da64444

Please sign in to comment.