question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule idea: value-no-non-variable

See original GitHub issue

Inspired by #4

SCSS-lint (sorry to bring it up again; can’t help it, since it’s a functioning tool and the one seems the most popuar) has VariableForProperty rule. It does almost the same, except it forces the policy not on value types (like @davidtheclark proposed), but for property names and is more general.

I just thought that in the future users would want something similar to color-no-non-variable, but for fonts and other types of values. Wouldn’t it be less redundant to make a general thing like value-no-non-variable and make it accept an array of value types/property names?

As for checking those variables values, I think that is more of a Sass compiler’s job.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
zyxneocommented, Aug 18, 2022

@jeddy3, @dryoma This worked for me with regular SCSS:

    "declaration-property-value-whitelist": {
      "font": [
        "/^\\$/"
      ],
      "/^\\$.+/": [
        "/.+/"
      ],
      "/color/": [
        "/^\\$|initial|inherit|transparent/"
      ]
    },

It also ignores variable declarations.

Update 2022: https://github.com/stylelint-scss/stylelint-scss/issues/13#issuecomment-1218272125

1reaction
dryomacommented, May 24, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Rule Machine How To: Set a variable in one rule and use in ...
Here are the general steps to set a variable in Rule 1 and check its value in Rule 2. Go to Settings |...
Read more >
Rules for assigning values to control variables (key-words)
1. Values are assigned to control variables by typing the name of the control variable (or enough of it to disambiguate it), an...
Read more >
how to assign value to variable in business rules using a ...
how to assign value to variable in business rules using a function? ⏩ Post By ✓ Bukhtiar Ahmad ✓ Intersystems Developer Community ...
Read more >
Rule variables - IBM
A rule variable is a name to which you assign a value. You define the variable in the definitions part of an action...
Read more >
Need to set reference field value in variable set - ServiceNow
Hi, I need to set the value of a reference field that is part of a variable set using a business rule. I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found