Skip to content

Files

Latest commit

 

History

History
73 lines (46 loc) · 680 Bytes

literal_expression_end_indentation.md

File metadata and controls

73 lines (46 loc) · 680 Bytes

Pattern: Malformed literal expression end indentation

Issue: -

Description

Array and dictionary literal end should have the same indentation as the line that started it.

Examples of correct code:

[1, 2, 3]


[1,
 2
]


[
   1,
   2
]


[
   1,
   2]


   let x = [
       1,
       2
   ]


[key: 2, key2: 3]


[key: 1,
 key2: 2
]


[
   key: 0,
   key2: 20
]

Examples of incorrect code:

let x = [
   1,
   2
   ]


   let x = [
       1,
       2
]


let x = [
   key: value
   ]

Further Reading