Skip to content

Editorial: Follow editorial conventions#3274

Merged
ptomato merged 9 commits intomainfrom
editorial-conventions
Feb 10, 2026
Merged

Editorial: Follow editorial conventions#3274
ptomato merged 9 commits intomainfrom
editorial-conventions

Conversation

@ptomato
Copy link
Collaborator

@ptomato ptomato commented Feb 10, 2026

I went through https://github.com/tc39/ecma262/wiki/Editorial-Conventions and attempted to make sure we conform to every one of them that was easily searchable or that I knew we had been doing differently in the past. This is in preparation for submitting a stage 4 PR.

e.g. a String value, a Number value, a BigInt value. As per editorial
conventions
https://github.com/tc39/ecma262/wiki/Editorial-Conventions#phrasing-conventions

(Existing language in operations copied from ECMA-262 or ECMA-402 is
left as is.)
https://github.com/tc39/ecma262/wiki/Editorial-Conventions#phrasing-conventions

"to create an untagged union of types,
- If all types are singletons, use A (for 1 type), either A or B (for
  2), or one of A, B, or C (for 3+)
- Else, use an A (for 1 type), either an A or a B (for 2), or either an
  A, a B, or a C (for 3+) where all types with >1 inhabitant are listed
  before all singletons"
As per editorial conventions, 'prefer "if a is either b or c" over "if a
is b or a is c"; use "one of" in place of "either" when more than 2
options'
https://github.com/tc39/ecma262/wiki/Editorial-Conventions#comparisons
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.09%. Comparing base (a3cb4bb) to head (a969773).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3274   +/-   ##
=======================================
  Coverage   98.09%   98.09%           
=======================================
  Files          22       22           
  Lines       10457    10457           
  Branches     1808     1808           
=======================================
  Hits        10258    10258           
  Misses        182      182           
  Partials       17       17           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@linusg linusg left a comment

Choose a reason for hiding this comment

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

Nice work 🎉

As per editorial conventions,
- in a single-line if/else, all branches should "do the same thing",
  e.g. set the same alias, return, perform, etc.
- if an early-exiting if/else has just two branches (i.e. not an if-else
  cascade like in some Math functions), and the two branches are
  substantially similar and short, prefer a single step
- if an early-exiting if/else has more than two branches (i.e. is an
  if-else cascade), prefer multi-step, without a leading Else, on
  successive branches
https://github.com/tc39/ecma262/wiki/Editorial-Conventions#algorithm-conventions

This is necessarily a bit fuzzy and based on best judgement.
@ptomato ptomato force-pushed the editorial-conventions branch from 9578e31 to a969773 Compare February 10, 2026 17:42
@ptomato ptomato merged commit 978311d into main Feb 10, 2026
10 checks passed
@ptomato ptomato deleted the editorial-conventions branch February 10, 2026 17:56
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.

3 participants