stylelint-csstree-validator

Stylelint plugin to validate CSS syntax

stylelint-csstree-validator

CSS syntax validator based on csstreeas plugin for stylelint. Currently it's only checking declaration values to match W3C specs and browsers extensions. It would be extended in future to validate other parts of CSS.

Validator is designed to check CSS syntax only. However PostCSS (that used by stylelint as backend) may parse other syntaxes like Less or Sass and can be used for these syntaxes too. In this case validator is limited to check declaration that doesn't contain any CSS extension (e.g. variables).

Install

$ npm install --save-dev stylelint-csstree-validator

Usage

Setup plugin in your stylelint config:

{
  "plugins": [
    "stylelint-csstree-validator"
  ],
  "rules": {
    "csstree/validator": true
  }
}

Options

ignore

Type: Arrayor falseDefault: false

Defines a list of property names that should be ignored by the validator.

{
  "plugins": [
    "stylelint-csstree-validator"
  ],
  "rules": {
    "csstree/validator": {
      "ignore": ["composes", "foo", "bar"]
    }
  }
}

In this example, plugin would not test declaration with property name composes, fooor bar. As a result, no warnings for these declarations.

License

MIT

Repository

csstree/stylelint-validator


上一篇:stylelint-rule-tester
下一篇:ignite

相关推荐

  • 详解vue-validator(vue验证器)

    官方文档:http://vuejs.github.io/vuevalidator/zhcn/index.html(http://vuejs.github.io/vuevalidator/zhcn/in...

    3 年前
  • 设计一个好用的Validator

    其实很少在周末写文章的,更别谈玩前端了。既然给自己下了个目标,每个星期产出两篇文章,就要尽量做到呗。这次我讲一个验证器的设计思路,也是一年前就造出来的小轮子(ManitoYu/ycvalidator(...

    2 年前
  • 有意思的异步校验async-validator

    asyncvalidator 是个纯 js 库,可以对数据进行异步校验。asyncvalidator 是基于早期的 asyncvalidate 进行修改的,但是早期出现的 asyncvalidate ...

    3 个月前
  • yairEO-validator

    yairEOvalidator是什么 什么是yairEOvalidator,The Validator is crossbrowser and will give you the power to...

    2 年前
  • xsd-schema-validator

    A (XSD) schema validator for nodejs xsdschemavalidator Build Status(https://travisci.org/nikku/no...

    1 年前
  • xml-name-validator

    Validates whether a string matches the production for an XML name or qualified name Validate XML N...

    1 年前
  • webux-validator

    Validate the content from the request Webux Validator This module is a wrapper around the Joi mod...

    6 个月前
  • webpack-validator

    Validate your webpack config with joi webpackvalidator Validate your webpack configs with joi ...

    6 个月前
  • vue中使用vee-validator表单校验

    前言 由于大部分移动端的组件库都不提供表单校验,因此需要自己封装。目前,使用较多的是asyncvalidator和veevalidator。其中,elementUI组件库提供的表单验证也是基于as...

    7 个月前
  • vue-validator验证器初体验

    使用方法 如果是npm安装完之后在入口文件main.js中引入 文中使用的表单控件基于elementUI 在中,ref是被引用时的标识,在验证表单的时候传入此表示,rules是验证规...

    1 年前

官方社区

扫码加入 JavaScript 社区