Skip to content

Commit 66b419e

Browse files
committed
Add rule for Intl Locale Info API
1 parent f12f504 commit 66b419e

File tree

43 files changed

+2245
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2245
-41
lines changed
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 `es-x/no-intl-locale-prototype-firstdayofweek` rule
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 `es-x/no-intl-locale-prototype-getcalendars` rule
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 `es-x/no-intl-locale-prototype-getcollations` rule
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 `es-x/no-intl-locale-prototype-gethourcycles` rule
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 `es-x/no-intl-locale-prototype-getnumberingsystems` rule
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 `es-x/no-intl-locale-prototype-gettextinfo` rule
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 `es-x/no-intl-locale-prototype-gettimezones` rule
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 `es-x/no-intl-locale-prototype-getweekinfo` rule

docs/configs/index.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ export default [
2626

2727
</details>
2828

29+
## no-new-in-esnext-intl-api
30+
31+
disallow the new stuff to be planned for the next yearly ECMAScript Intl API (ECMA-402) snapshot.\
32+
⚠️ This config will be changed in the minor versions of this plugin.
33+
34+
```js
35+
import pluginESx from "eslint-plugin-es-x"
36+
export default [
37+
pluginESx.configs['flat/no-new-in-esnext-intl-api']
38+
]
39+
```
40+
41+
<details><summary> Legacy Config </summary>
42+
43+
.eslintrc.*:
44+
45+
```json
46+
{
47+
"extends": ["plugin:es-x/no-new-in-esnext-intl-api"],
48+
}
49+
```
50+
51+
</details>
52+
2953
## no-new-in-es2025
3054

3155
disallow new stuff in ES2025.
@@ -1041,6 +1065,32 @@ export default [
10411065

10421066
</details>
10431067

1068+
## no-intl-locale-info
1069+
1070+
disallow proposal ES2026 Intl API [Intl Locale Info API](https://github.com/tc39/proposal-intl-locale-info)\
1071+
⚠️ This config will be changed in the minor versions of this plugin.
1072+
1073+
This configs includes rules for [es-x/no-intl-locale-prototype-firstdayofweek](../rules/no-intl-locale-prototype-firstdayofweek.md), [es-x/no-intl-locale-prototype-getcalendars](../rules/no-intl-locale-prototype-getcalendars.md), [es-x/no-intl-locale-prototype-getcollations](../rules/no-intl-locale-prototype-getcollations.md), [es-x/no-intl-locale-prototype-gethourcycles](../rules/no-intl-locale-prototype-gethourcycles.md), [es-x/no-intl-locale-prototype-getnumberingsystems](../rules/no-intl-locale-prototype-getnumberingsystems.md), [es-x/no-intl-locale-prototype-gettextinfo](../rules/no-intl-locale-prototype-gettextinfo.md), [es-x/no-intl-locale-prototype-gettimezones](../rules/no-intl-locale-prototype-gettimezones.md), and [es-x/no-intl-locale-prototype-getweekinfo](../rules/no-intl-locale-prototype-getweekinfo.md).
1074+
1075+
```js
1076+
import pluginESx from "eslint-plugin-es-x"
1077+
export default [
1078+
pluginESx.configs['flat/no-intl-locale-info']
1079+
]
1080+
```
1081+
1082+
<details><summary> Legacy Config </summary>
1083+
1084+
.eslintrc.*:
1085+
1086+
```json
1087+
{
1088+
"extends": ["plugin:es-x/no-intl-locale-info"],
1089+
}
1090+
```
1091+
1092+
</details>
1093+
10441094
## no-float16array
10451095

10461096
disallow proposal ES2025 [Float16Array](https://github.com/tc39/proposal-float16array)

docs/rules/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ There is a config that enables the rules in this category: [`no-new-in-esnext`]
1919
| [es-x/no-symbol-dispose](./no-symbol-dispose.md) | disallow the `Symbol.dispose` property. | |
2020
| [es-x/no-using-declarations](./no-using-declarations.md) | disallow `using` and `await using` declarations. | |
2121

22+
## ES2026 Intl API
23+
24+
There is a config that enables the rules in this category: [`no-new-in-esnext-intl-api`]
25+
26+
| Rule ID | Description | |
27+
|:--------|:------------|:--:|
28+
| [es-x/no-intl-locale-prototype-firstdayofweek](./no-intl-locale-prototype-firstdayofweek.md) | disallow the `Intl.Locale.prototype.firstDayOfWeek` property. | |
29+
| [es-x/no-intl-locale-prototype-getcalendars](./no-intl-locale-prototype-getcalendars.md) | disallow the `Intl.Locale.prototype.getCalendars` method. | |
30+
| [es-x/no-intl-locale-prototype-getcollations](./no-intl-locale-prototype-getcollations.md) | disallow the `Intl.Locale.prototype.getCollations` method. | |
31+
| [es-x/no-intl-locale-prototype-gethourcycles](./no-intl-locale-prototype-gethourcycles.md) | disallow the `Intl.Locale.prototype.getHourCycles` method. | |
32+
| [es-x/no-intl-locale-prototype-getnumberingsystems](./no-intl-locale-prototype-getnumberingsystems.md) | disallow the `Intl.Locale.prototype.getNumberingSystems` method. | |
33+
| [es-x/no-intl-locale-prototype-gettextinfo](./no-intl-locale-prototype-gettextinfo.md) | disallow the `Intl.Locale.prototype.getTextInfo` method. | |
34+
| [es-x/no-intl-locale-prototype-gettimezones](./no-intl-locale-prototype-gettimezones.md) | disallow the `Intl.Locale.prototype.getTimeZones` method. | |
35+
| [es-x/no-intl-locale-prototype-getweekinfo](./no-intl-locale-prototype-getweekinfo.md) | disallow the `Intl.Locale.prototype.getWeekInfo` method. | |
36+
2237
## ES2025
2338

2439
There are multiple configs that enable all rules in this category: [`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`]
@@ -498,6 +513,7 @@ Rules in this category are not included in any preset.
498513
| [es-x/no-string-prototype-iswellformed-towellformed](./no-string-prototype-iswellformed-towellformed.md) | [es-x/no-string-prototype-iswellformed](./no-string-prototype-iswellformed.md), [es-x/no-string-prototype-towellformed](./no-string-prototype-towellformed.md) |
499514

500515
[`no-new-in-esnext`]: ../configs/index.md#no-new-in-esnext
516+
[`no-new-in-esnext-intl-api`]: ../configs/index.md#no-new-in-esnext-intl-api
501517
[`no-new-in-es2025`]: ../configs/index.md#no-new-in-es2025
502518
[`restrict-to-es2024`]: ../configs/index.md#restrict-to-es2024
503519
[`no-new-in-es2025-intl-api`]: ../configs/index.md#no-new-in-es2025-intl-api

0 commit comments

Comments
 (0)