简体   繁体   中英

Stylelint multiline comments rule

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

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM