2

Today we use style validation with the sass-lint module, but we're migrating to stylelint.

One of the validations that sass-lint does in our projects is not allowing multi-line comments but allow one-line comments.

I need to know if there is any way to apply rule similar to stylelint.

Example:

<style lang="scss" scoped>
/* several lines comments should not be allowed */
$cor: #fff;

.test {
  color: $cor;
  font-size: 10px;
  z-index: 99;
}
</style>

The comment in the above block should be consisted of stylelint, just as it is in sass-lint.

code gif illustration

1 Answers1

0

I need to know if there is any way to apply rule similar to stylelint.

There is no equivalent rule in stylelint.

However, stylelint is extensible via its plugin system. You can create a plugin for your specific use case. You'll find examples of working with non-standard comments within the double-slash rules in the stylelint-scss plugin pack.

jeddy3
  • 3,451
  • 1
  • 12
  • 21