# prefer-single-object-destructuring πŸ“ Prefer a single object destructuring declaration per local const source. πŸ’ΌπŸš« This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config). This rule is _disabled_ in the β˜‘οΈ `unopinionated` [config](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config). πŸ”§ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). Prefer one object destructuring declaration when consecutive declarations read from the same local `const` source. This rule only reports adjacent declarations with the same declaration kind and the same identifier source. The source identifier must resolve to a local `const` binding, so mutable or unresolved sources are ignored. More complex patterns are ignored by design. ## Examples ```js // ❌ const foo = {}; const {bar} = foo; const {baz} = foo; // βœ… const foo = {}; const {bar, baz} = foo; ``` ```js // βœ… let foo = {}; const {bar} = foo; const {baz} = foo; ``` ```js // βœ… import foo from 'foo'; const {bar} = foo; const {baz} = foo; ``` ```js // βœ… const {bar} = foo; console.log(bar); const {baz} = foo; ```