Skip to content

Getting Started

Yuki edited this page Jul 9, 2026 · 1 revision

Getting Started

Install

npm install -D i18n-smell-detector

Installing the package only adds the CLI. It does not create project files automatically.

Generate Config

Create a starter config:

npx i18n-smell-detector init

This writes i18n-smell.config.mjs in the current working directory.

To write the config somewhere else:

npx i18n-smell-detector init --config ./config/i18n-smell.config.mjs

If the config already exists, init refuses to overwrite it. Use --force only when replacing it intentionally:

npx i18n-smell-detector init --force

Edit Config

Update locales and source to match your project:

export default {
  baseLocale: 'en',
  locales: {
    en: './src/locales/en.json',
    zh: './src/locales/zh.json'
  },
  source: [
    'src/**/*.{vue,js,jsx,ts,tsx}'
  ],
  failOn: 'none'
};

Paths inside the config are resolved relative to the config file.

First Run

Start in reporting mode:

npx i18n-smell-detector check --config i18n-smell.config.mjs --fail-on none

After tuning allowlists and baselines, enforce CI:

npx i18n-smell-detector check --config i18n-smell.config.mjs --fail-on high

Common First Error

If you see:

i18n-smell-detector: Config file not found: /path/to/i18n-smell.config.mjs

Create the config first with init, or pass the correct --config path.

Clone this wiki locally