Skip to content

complete/sort-destructured-properties

💼 This rule is enabled in the ✅ recommended config.

📝 Requires destructured object properties to match the declared type order.

🔧 This rule is automatically fixable by the --fix CLI option.

💭 This rule requires type information.

Requires destructured object properties to match the declared type order.

Note that this rule was proposed to TSESLint, but was rejected.

interface Foo {
name: string;
description: string;
}
// Bad
declare const foo: Foo;
const { description, name } = foo;
// Good
declare const foo: Foo;
const { name, description } = foo;

This rule is not configurable.