Skip to content

stylus/single-line-comment

enforces comment style where single-line comments are allowed.

  • ⚙️ This rule is included in "stylelint-stylus/standard". (options: "always")
  • 🔧 The fix option can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule enforces comment style where single-line comments are allowed.

🔧 Options

json
{
  "stylus/single-line-comment": ["always" | "never"]
}
  • "always" ... Requires single-line comments.
  • "never" ... Disallows single-line comments.

"always"

styl
/* stylelint rules config: {"stylus/single-line-comment": "always"} */
// ✓ GOOD // single line comment .foo { // single line comment } .bar { /* not eol comment */ } /* * multi * line * comment */ /*! buffered */
/* ✗ BAD */
/* multi line comment, but a single line. */
/*
multi-line comment, but the content is a single line. */ .foo {
/* multi line comment, but a single line. */
}

"never"

styl
/* stylelint rules config: {"stylus/single-line-comment": "never"} */
/* ✓ GOOD */
/* multi line comment */
.foo { /* multi line comment */
}

// ✗ BAD
// single line comment
.foo {
// single line comment
}

📚 Further reading

🔍 Implementation