Skip to content

Enhancement: use Intl.Segmenter instead of graphemer #11803

@JstnMcBrd

Description

@JstnMcBrd

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

eslint-plugin

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

In #7068, it was proposed that we switch from grapheme-splitter to graphemer because eslint did (eslint/eslint#17160).

Well, since then, eslint has switched from graphemer to Intl.Segmenter (eslint/eslint#18110).

It would be great for @typescript-eslint/eslint-plugin to also switch to Intl.Segmenter for consistency and dependency deduplication.

(It's also a recommended module replacement - see https://github.com/es-tooling/module-replacements/blob/main/docs/modules/graphemer.md)

Additional Info

See also: this comment from Sep 2022:

... after Node.js v14 hits EoL and typescript-eslint only supports Node.js 16 or later, we can use Intl.Segmenter.

Node v14 has hit EoL, and typescript-eslint only supports v18.18.0 or later, so it sounds like we're ready.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions