npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-dot-notation-unicode

v0.2.0

Published

ESLint dot-notation rule with full Unicode identifier support

Readme

eslint-plugin-dot-notation-unicode

npm version License: MIT

English | 日本語

An ESLint plugin that extends the dot-notation rule with full Unicode identifier support. Fixes the issue where ESLint's built-in rule doesn't recognize Japanese, Chinese, Korean, and other Unicode characters as valid identifiers.

The Problem

ESLint's built-in dot-notation rule uses this regex for identifier validation:

const validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/u;

This only matches ASCII characters, so valid JavaScript like obj.日本語 is not recognized, and obj["日本語"] won't be flagged for conversion.

The Solution

This plugin uses Unicode property escapes to correctly identify valid ECMAScript identifiers:

const validIdentifier = /^[\p{ID_Start}_$][\p{ID_Continue}$\u200C\u200D]*$/u;

Installation

npm install --save-dev eslint-plugin-dot-notation-unicode
# or
yarn add -D eslint-plugin-dot-notation-unicode

Usage

Flat Config (ESLint 9+)

// eslint.config.js
import dotNotationUnicode from "eslint-plugin-dot-notation-unicode";

export default [
  {
    plugins: {
      "dot-notation-unicode": dotNotationUnicode,
    },
    rules: {
      "dot-notation": "off",
      "dot-notation-unicode/dot-notation": "error",
    },
  },
];

Legacy Config

{
  "plugins": ["dot-notation-unicode"],
  "rules": {
    "dot-notation": "off",
    "dot-notation-unicode/dot-notation": "error"
  }
}

Examples

Invalid (will be auto-fixed)

obj["日本語"]    // → obj.日本語
obj["한국어"]    // → obj.한국어
obj["中文"]      // → obj.中文
obj["français"]  // → obj.français
obj["العربية"]   // → obj.العربية
obj["english"]   // → obj.english

Valid (no error)

obj.日本語
obj.한국어
obj.中文
obj.français
obj.العربية
obj.english
obj["content-type"]  // hyphen is not valid in identifiers
obj["123start"]      // cannot start with a number
obj[variable]        // dynamic access

Options

This plugin supports the same options as ESLint's built-in dot-notation rule, plus an additional option for legacy parser compatibility.

allowKeywords (default: true)

Set to false to follow ECMAScript version 3 compatible style, requiring bracket notation for reserved word properties.

// With { "allowKeywords": false }
obj["class"]  // OK
obj.class     // Error

allowPattern (default: "")

Allows bracket notation for property names that match the specified regular expression pattern. This is useful when working with external APIs that use snake_case while maintaining camelCase in your own code.

// With { "allowPattern": "^[a-z]+_[a-z]+$" }
obj["snake_case"]  // OK (matches pattern)
obj["camelCase"]   // Error (doesn't match pattern)

legacyParserSupport (default: false)

Set to true for compatibility with older parsers (TypeScript < 5.5, Node.js < 18.20 / 19.x / < 20.12). When enabled, certain Unicode characters that are valid in the latest Unicode specification but not recognized by older parsers will not be converted to dot notation.

Affected characters:

  • (U+30FB) KATAKANA MIDDLE DOT
  • (U+FF65) HALFWIDTH KATAKANA MIDDLE DOT
  • Zero Width Non-Joiner (U+200C)
  • Zero Width Joiner (U+200D)
// With { "legacyParserSupport": true }
obj["send・receive"]  // OK (not converted, "・" may cause issues in older parsers)

Note: This option is only needed if you're using TypeScript < 5.5 or Node.js < 18.20 / 19.x / < 20.12. These characters were fixed in Unicode 15.1.

Why a Separate Plugin?

  • ESLint's dot-notation rule is frozen and not accepting new features
  • @typescript-eslint/dot-notation inherits the same limitation and requires type information (slower)
  • No existing npm package solves this issue

References

License

MIT License - see LICENSE for details.