Skip to content

Configuration

Indentier is cosmiconfig-powered. It auto-discovers config from:

  • package.json"indentier" field
  • .indentierrc.json / .indentierrc.yaml / .indentierrc.yml
  • .indentierrc.js / .indentierrc.cjs / .indentierrc.mjs
  • .indentierrc.ts / .indentierrc.cts / .indentierrc.mts
  • indentier.config.{js,cjs,mjs,ts,cts,mts}
.indentierrc.json
{
"mode": "default",
"tabWidth": 2,
"useTabs": false,
"offset": 20,
"minColumn": 80,
"brackets": true,
"semicolon": true,
"comma": true,
"ruby": {
"variableName": "end",
"injectDeclaration": true,
"smartEnd": true
},
"overrides": [
{
"files": ["**/*.ts"],
"options": { "offset": 30 }
}
],
"plugins": ["@indentier/plugin-rust"]
}
KeyTypeDefaultDescription
mode"default" | "ruby""default"Formatting mode
tabWidthnumber2Indent width for normalization
useTabsbooleanfalseUse tabs for body indent (padding stays spaces)
offsetnumber20Extra columns added after the longest body
minColumnnumber80Minimum column for floated symbols
bracketsbooleantrueMove { and } to the right margin
semicolonbooleantrueMove ; to the right margin
commabooleantrueMove trailing , on multi-line expressions
ruby.variableNamestring"end"Identifier used as synthetic terminator
ruby.injectDeclarationbooleantrueInject a variable declaration right after the first {
ruby.smartEndbooleantrueSkip end before else / catch / finally / while
overridesOverride[][]Per-glob option overrides
pluginsstring[][]Plugin package names to load

.gitignore-compatible globs. No paths are ignored implicitly — create the file yourself or run indentier --init.

node_modules/
dist/
coverage/

.indentierrc.ts works out of the box:

import type { IndentierOptions } from 'indentier'
export default {
mode: 'ruby',
offset: 30,
} satisfies IndentierOptions