Inspectopedia
 
2024.3

Exported element should have its own declaration

Info
Code Style
New
Last modified: 03 December 2024

Reports exported variables or constants in comma-separated lists of declarations.

Example:

const C1, C3, C2, C44, C9, C11, C6 = 1, 2, 3, 1, 3, 2, 1

This declaration makes it hard to understand what value each constant has. You can apply the Extract to own declaration quick-fix to make this declaration more readable. After the quick-fix is applied to each constant, the declaration looks as follows: