Registry / testing / chromex-locale-lint

chromex-locale-lint

JSON →
library0.1.0jsnpmunverified

CLI tool for validating Chrome extension localization files (`_locales/*/messages.json`). Version 0.1.0 is the latest stable release. It checks for missing keys across locales and validates locale directory names against Google Chrome's supported locales list. Integrates easily with CI/CD pipelines, supporting a `--strict` flag to treat warnings as errors. Lightweight alternative to rolling custom locale validation scripts.

npm install chromex-locale-lint
INSTALL
IMPORT
SIG · CHROMEX-LOCALE-LIN
C
chromex-locale-lint
testingjavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import chromexLocaleLint from 'chromex-locale-lint'
const chromexLocaleLint = require('chromex-locale-lint')
Package provides a CLI tool; the import is for programmatic use, but it's primarily designed to be run via npx or as a bin script.
runLint (hypothetical)
import { runLint } from 'chromex-locale-lint'
No named exports are documented; the package exports a default function for programmatic use in Node.js (ESM-only since v0.1.0? unknown).
bin
npx chromex-locale-lint --localesDir ./_locales --baseLang en
npx chromex-locale-lint --dir ./_locales
The CLI option is --localesDir, not --dir. Use npx or run via package.json scripts.

Runs locale validation on the _locales directory using English as the base language, with strict mode enabled to treat warnings as errors.

npx chromex-locale-lint --localesDir ./_locales --baseLang en --strict
chromex-locale-lint --version
Debug
Known issues
gotchaIf --localesDir is not specified, defaults to '_locales/' relative to current working directory. Ensure correct path.
fix
Use absolute path or relative path from project root: --localesDir ./src/_locales
affects: >=0.0.1
gotcha--baseLang must exactly match a locale directory name (e.g., 'en' not 'en_US'). Chrome uses BCP 47 tags.
fix
Use 'en', 'de', 'ja', etc. See Chrome supported locales.
affects: >=0.0.1
deprecatedVersion 0.0.3 introduced updated supported locales list; older v0.0.2 may report false positives for valid locales.
fix
Upgrade to >=0.0.3 or apply locale list from Chrome manually.
affects: 0.0.2
breakingIn version 0.1.0, the --strict flag was added. Previously, warnings did not cause exit code failure. Enabling --strict will break CI builds that ignore warnings.
fix
Add --strict argument to maintain same behavior, or update CI to handle exit codes.
affects: <0.1.0
Errors
Common errors & fixes
Error: Locale directory 'en_US' is not supported by Google Chrome.
Using region subtag where only language tag is expected (e.g., en_US instead of en).
fix
Rename directory to 'en' or use a valid BCP 47 tag like 'en-US'? Chrome uses 'en', 'en_US' is invalid. Check Chrome documentation.
Error: ENOENT: no such file or directory, scandir '_locales/'
The --localesDir path is incorrect or the directory does not exist.
fix
Specify correct path: npx chromex-locale-lint --localesDir ./src/_locales
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
chromex-locale-lint — npm install chromex-locale-lint · libregistry