Skip to content

The meaningful-names rule

This document is the reference of the meaningful-names rule: its options, the declarations it judges, and the diagnostics it produces. The rule is written against the vibator.recommended namespace.

Reference


Configuration

The rule id is meaningful-names. Configure it in .vibator.json:

json
{
  "plugins": [
    "@vibator/recommended"
  ],
  "rules": {
    "meaningful-names": {
      "options": {
        "include": ["src/**/*.{ts,tsx}"]
      }
    }
  }
}
OptionDescription
include / excludeThe shared vibator scope globs. exclude adds **/*.d.ts: declaration files mirror APIs.
minLengthIdentifiers shorter than this must be allowlisted. Defaults to 3.
allowShort names that carry meaning, or that a library imposes. Defaults include id, x, y.
denyNames long enough to pass the bar but still meaningless. Defaults include data, tmp.

Detection

The rule judges the declarations whose names the project chooses itself: parameters, variables, binding elements, functions, methods, classes, interfaces, type aliases, and enums, through vibator.recommended.declaredNames. Properties are excluded because they may mirror wire shapes, and names starting with _ are conventionally unused. A denied name is reported at any length; a name shorter than minLength is reported unless allowlisted. vibator-ignore meaningful-names markers are honored at file level and on the declaration or any enclosing scope.

Diagnostics

One diagnostic per bad name, on the line of the identifier, stating whether the name is a filler or too short.

Fix

The right name needs to say what the value is, which no tool can know. The rule implements no fix hook.

Released under the MIT License.