Skip to content

Incorrect constant export example #3032

@takrishna

Description

@takrishna

What about all const variables? - This is unnecessary, so uppercasing should not be used for constants within a file. It should be used for exported constants however.

There are two points:

  1. Based on the above description the provided example appears incorrect
  2. Also, Since const variables can't be changed through reassignment, this example (i.e., variable name) feels odd.

Current example:

// bad
export const THING_TO_BE_CHANGED = 'should obviously not be uppercased';

Perhaps it could be:

// bad
export const some_exported_constant = 'should obviously be uppercased';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions