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.

custom-property-no-missing-var-function false positives?

See original GitHub issue

What steps are needed to reproduce the bug?

We use Less, and our comment headers in each file are tripping up on custom-property-no-missing-var-function.

//
//  STACK OVERFLOW
//  THE COMPLETE STANDALONE STACKS
//
//  This CSS comes from Stacks, our CSS & Pattern library for rapidly building
//  Stack Overflow. For documentation of all these classes and how to contribute,
//  visit https://stackoverflow.design/
//
//  This is where all the magic happens.
//
//  ============================================================================
@import "stacks-static.less";
@import "stacks-dynamic.less";

What Stylelint configuration is needed to reproduce the bug?

{
  "extends": "stylelint-config-standard",
  "rules": {
    "indentation": 4,
    "max-empty-lines": 2,
    "no-invalid-double-slash-comments": null,
    "rule-empty-line-before": null,
    "at-rule-empty-line-before": null,
    "declaration-empty-line-before": null,
    "selector-pseudo-element-colon-notation": "single",
    "no-descending-specificity": null,
    "function-whitespace-after": null,
    "no-invalid-position-at-import-rule": null,
    "string-quotes": null,
    "custom-property-no-missing-var-function": null,
    "alpha-value-notation": null,
    "max-line-length": null,
    "hue-degree-notation": null,
    "color-function-notation": null,
    "selector-class-pattern": null,
    "custom-property-pattern": null,
    "value-no-vendor-prefix": null,
    "property-no-vendor-prefix": null,
    "selector-no-vendor-prefix": null,
    "declaration-block-trailing-semicolon": null,
    "block-closing-brace-newline-before": null,
    "block-closing-brace-empty-line-before": null,
    "declaration-block-no-redundant-longhand-properties": null,
    "selector-disallowed-list": [
      "/[.#]js-/",
      {
        "message": "js-* selectors can’t have visual styling. https://stackoverflow.design/product/guidelines/javascript/#javascript-classnames"
      }
    ]
  }
}

How did you run Stylelint?

Visual Studio plugin

Which version of Stylelint are you using?

14.0.1

What did you expect to happen?

By setting custom-property-no-missing-var-function to null, I expect this failure to be ignored as it was prior to 14.0.0

What actually happened?

Unknown rule custom-property-no-missing-var-function. [1,1]

Does the bug relate to non-standard syntax?

No response

Proposal to fix the bug

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aaronshekeycommented, Nov 8, 2021

Ah, yep. A hard restart of Visual Studio Code cleared up this issue. Closing!

0reactions
jeddy3commented, Nov 8, 2021

@aaronshekey Thanks for the report. As @alexander-akait said, this usually happens because an older version of Stylelint is being used somewhere.

Do you get the error when using Stylelint via the CLI?

If not, then VS Code is using an older version and you should:

  1. use the official extension (there’s quite a few unofficial ones in the marketplace): https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
  2. ensure the extension is up to date
  3. restart VS Code
  4. uninstall any globally installed version of Stylelint

Let us know if that works for you or not, and we’ll go from there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix custom-property-no-missing-var-function false positives for ...
Fix custom-property-no-missing-var-function false positives for properties that can contain author-defined identifiers #5742.
Read more >
custom-property-no-missing-var-function - Stylelint
Disallow missing var function for custom properties. This rule only reports custom properties that are defined within the same source.
Read more >
custom-property-no-missing-var-function - Fossies
Disallow missing var function for custom properties. This rule only reports custom properties that are defined within the same source.
Read more >
stylelint/stylelint 14.0.0 on GitHub - NewReleases.io
Added: custom-property-no-missing-var-function rule (#5317). ... Fixed: length-zero-no-unit false positives for flex property (#5315).
Read more >
Supercharging Your CSS Custom Properties - OutSystems
The var() function, which allows an author to use these values in other properties. Note: variables names are case sensitive — --my-color will ......
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