eslint-plugin-objects

raw JSON →
1.1.1 verified Sat Apr 25 auth: no javascript maintenance

ESLint plugin enforcing stylistic conventions for multi-property objects. Version 1.1.1 (last release 2015), stable but unmaintained since 2015. Provides 4 rules: no-object-properties-first-line, no-object-properties-last-line, no-object-properties-one-line, no-object-property-split. Requires ESLint >=0.8.1. Unlike other object formatting plugins, focuses solely on property placement across lines, not sorting or grouping. No TypeScript support.

error Error: Failed to load plugin 'objects': Cannot find module 'eslint-plugin-objects'
cause Plugin not installed locally or globally.
fix
Run 'npm install --save-dev eslint-plugin-objects' in your project.
error Definition for rule 'objects/no-object-property-split' was not found.
cause Rule name misspelled or plugin not properly loaded.
fix
Ensure plugin is listed in 'plugins' array and rule name matches exactly (includes 'objects/' prefix).
error Error: ESLint configuration is invalid: - Unexpected top-level property "objects".
cause Misplaced configuration: placed rules under 'objects' instead of 'plugins'.
fix
Use 'plugins: ["objects"]' and 'rules: { "objects/rule-name": ... }'.
gotcha Plugin unmaintained since 2015; may not work with modern ESLint versions.
fix Use an alternative plugin like eslint-plugin-object-properties or disable rules.
breaking Rules renamed in v1.1.0; configs using old rule names will break.
fix Update rule names to the new format, e.g., 'no-object-properties-first-line' instead of 'no-properties-first-line'.
deprecated ESLint 0.x compatibility; not tested with ESLint 1.x+.
fix Check compatibility; consider migrating to a maintained plugin.
npm install eslint-plugin-objects
yarn add eslint-plugin-objects
pnpm add eslint-plugin-objects

Configures ESLint with all 4 rules enabled and shows common violation patterns.

// Install locally:
// npm install --save-dev eslint eslint-plugin-objects

// In .eslintrc.json:
{
  "plugins": ["objects"],
  "rules": {
    "objects/no-object-property-split": 2,
    "objects/no-object-properties-first-line": 1,
    "objects/no-object-properties-last-line": 1,
    "objects/no-object-properties-one-line": 1
  }
}

// Example file that will trigger errors:
const obj = { a: 1, b: 2 }; // Error: no-object-properties-one-line
const obj2 = {
  a: 1, // Error: no-object-properties-first-line
  b: 2
};