Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Add a lint for named colors as map keys #17

@nex3

Description

@nex3

A mistake we see occasionally is users using unquoted strings as map keys, having one of those keys be named something like blue, and getting confused later on when that key compiles to #00f instead. We should add a lint rule to help out with this.

The most conservative way to do this is probably to warn the user when a map:

  • contains an unquoted string key,
  • contains a color name key, and
  • contains only unquoted string or color name keys.

Less conservatively, we could also warn about maps that have keys of mixed type in general or maps with any unquoted string keys, although this risks having more false positives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions