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.
Common errors
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": ... }'.
Warnings
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.
Install
npm install eslint-plugin-objects yarn add eslint-plugin-objects pnpm add eslint-plugin-objects Imports
- default (plugin) wrong
plugins: ['eslint-plugin-objects']correctplugins: ['objects'] - Rule: no-object-property-split wrong
'no-object-property-split': 'error'correct'objects/no-object-property-split': 'error' - Rule: no-object-properties-first-line wrong
'objects/no-object-properties-first-line': 1correct'objects/no-object-properties-first-line': 'warn'
Quickstart
// 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
};