Skip to content

Conversation

@ota-meshi
Copy link
Member

@ota-meshi ota-meshi commented Aug 1, 2025

This PR adds rules to disallow methods from the ES2026 Intl Locale Info API proposal.

https://github.com/tc39/proposal-intl-locale-info

@changeset-bot
Copy link

changeset-bot bot commented Aug 1, 2025

🦋 Changeset detected

Latest commit: 1ee603e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-es-x Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ota-meshi ota-meshi force-pushed the proposal-intl-locale-info branch from 66b419e to 1ee603e Compare November 18, 2025 05:08
@ota-meshi ota-meshi marked this pull request as ready for review November 18, 2025 05:13
@ota-meshi ota-meshi requested a review from Copilot November 22, 2025 02:19
Copilot finished reviewing on behalf of ota-meshi November 22, 2025 02:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds rules to disallow methods and properties from the ES2026 Intl Locale Info API proposal, which introduces new ways to query locale information. The proposal recently changed from using getter properties to using methods (per tc39/proposal-intl-locale-info#67), except for firstDayOfWeek which remains a getter property.

Key changes:

  • Added 8 new ESLint rules: 7 for methods (getCalendars, getCollations, getHourCycles, getNumberingSystems, getTextInfo, getTimeZones, getWeekInfo) and 1 for a property (firstDayOfWeek)
  • Updated well-known-properties to distinguish between the old getter-based API (now considered non-standard) and the new method-based API
  • Created new configuration presets no-intl-locale-info and updated no-new-in-esnext-intl-api
  • Enhanced the scripts/new-rule.js generator to support prototype property rules with Intl API detection

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/rules/no-intl-locale-prototype-*.js (8 files) New rule implementations for disallowing Intl Locale Info API methods and properties
tests/lib/rules/no-intl-locale-prototype-*.js (8 files) Comprehensive test suites including TypeScript type checking tests
lib/util/well-known-properties.js Added 8 new Intl.Locale prototype properties to the well-known properties list
tests/lib/util/well-known-properties.js Updated to filter out deprecated getter properties and keep only the new method-based API as standard
lib/configs/*.js (4 files) Added new config presets for no-intl-locale-info and updated no-new-in-esnext-intl-api
lib/index.js Registered all 8 new rules and exported the new configs
docs/rules/*.md (8 files) Complete documentation for each new rule
docs/rules/index.md Added ES2026 Intl API section listing all 8 rules
docs/configs/index.md Documented the new no-intl-locale-info config
scripts/proposals.js Added intl-locale-info proposal entry
scripts/new-rule.js Enhanced to support prototype properties, link prompts, and Intl API categorization
.changeset/*.md (8 files) Changesets for each new rule

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ota-meshi ota-meshi merged commit b13e399 into master Nov 22, 2025
16 checks passed
@ota-meshi ota-meshi deleted the proposal-intl-locale-info branch November 22, 2025 02:40
@github-actions github-actions bot mentioned this pull request Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants