--- ruleName: trailing-comma description: 'Requires or disallows trailing commas in array and object literals, destructuring assignments and named imports.' optionsDescription: |- One argument which is an object with the keys `multiline` and `singleline`. Both should be set to either `"always"` or `"never"`. * `"multiline"` checks multi-line object literals. * `"singleline"` checks single-line object literals. A array is considered "multiline" if its closing bracket is on a line after the last array element. The same general logic is followed for object literals and named import statements. options: type: object properties: multiline: type: string enum: - always - never singleline: type: string enum: - always - never additionalProperties: false optionExamples: - '[true, {"multiline": "always", "singleline": "never"}]' type: maintainability optionsJSON: |- { "type": "object", "properties": { "multiline": { "type": "string", "enum": [ "always", "never" ] }, "singleline": { "type": "string", "enum": [ "always", "never" ] } }, "additionalProperties": false } layout: rule title: 'Rule: trailing-comma' ---