How to use the css-tree.fork function in css-tree

To help you get started, we’ve selected a few css-tree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github csstree / stylelint-validator / index.js View on Github external
var stylelint = require('stylelint');
var csstree = require('css-tree').fork(require('./syntax-extension'));
var syntax = csstree.lexer;

var ruleName = 'csstree/validator'
var messages = stylelint.utils.ruleMessages(ruleName, {
    parseError: function(value) {
        return 'Can\'t parse value "' + value + '"';
    },
    invalid: function(property) {
        return 'Invalid value for `' + property + '`';
    }
});

module.exports = stylelint.createPlugin(ruleName, function(options) {
    var ignore = false;
    options = options || {};