Skip to content

Silent failure on missing key in list #10

Open
@dominicwhittle

Description

@dominicwhittle

Loving this plugin ❤️
My only gripe so far is that if I look up a value by key and that key doesn't exist we get a silent failure, as follows:

@palette:
  primary #0000E0,
  info #02d7e1,
  success #02e10c;

h1 {
  color: at(@palette, primary);
  background-color: at(@palette, infos); // <-- typo (should be 'info' not 'infos')
  border-color: at(@palette, success);
}

Results in:

h1 {
  color: #0000E0;
  background-color: at(primary #0000E0, info #02d7e1, success #02e10c, infos); // 😱
  border-color: #02e10c;
}

I've forked and "fixed" here by throwing an error — https://github.com/dominicwhittle/less-plugin-lists/pull/1/files

Please take this as a suggestion, I'm not well versed in the code base nor the community around this plugin for this to be anything more than my personal suggestion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions