<commit_before>var postcss = require('postcss');
var config = {
    suit: {
        separators: {
            namespace: '-',
            descendent: '-',
            modifier: '--',
            state: '.is-'
        }
    },
    bem: {
        separators: {
            namespace: '--',
            descendent: '__',
            modifier: '_'
        }
    }
};

module.exports = postcss.plugin('postcss-bem', function (opts) {
    opts = opts || {};

    if (!opts.style) {
        opts.style = 'suit';
    }

    if (opts.style !== 'suit' && opts.style !== 'bem') {
        throw new Error('postcss-bem: opts.style may only be "suit" or "bem"');
    }

    var currentConfig = config[opts.style];

    if (opts.separators) {
        for (var separator in opts.separators) {
            if (!opts.separators.hasOwnProperty(separator)) continue;

            var separatorValue = opts.separators[separator];
            if (typeof separatorValue === 'string') {
                currentConfig.separators[separator] = separatorValue;
            } else {
                throw new Error('postcss-bem: opts.separators.' + separator + ' must be a string');
            }
        }
    }

    function processComponent (component, namespace) {
        var name = component.params;

        if (namespace) {
            name = namespace + currentConfig.separators.namespace + name;
        }

        var last = component;
        var newComponent = postcss.rule({
            selector: '.' + name,
            source: component.source
        });
        component.each(function (rule) {<commit_msg>fix lint error<commit_after>var postcss = require('postcss');
var config = {
    suit: {
        separators: {
            namespace: '-',
            descendent: '-',
            modifier: '--',
            state: '.is-'
        }
    },
    bem: {
        separators: {
            namespace: '--',
            descendent: '__',
            modifier: '_'
        }
    }
};

module.exports = postcss.plugin('postcss-bem', function (opts) {
    opts = opts || {};

    if (!opts.style) {
        opts.style = 'suit';
    }

    if (opts.style !== 'suit' && opts.style !== 'bem') {
        throw new Error('postcss-bem: opts.style may only be "suit" or "bem"');
    }

    var currentConfig = config[opts.style];

    if (opts.separators) {
        for (var customSeparator in opts.separators) {
            if (!opts.separators.hasOwnProperty(customSeparator)) continue;

            var separatorValue = opts.separators[customSeparator];
            if (typeof separatorValue === 'string') {
                currentConfig.separators[customSeparator] = separatorValue;
            } else {
                throw new Error('postcss-bem: opts.separators.' + customSeparator + ' must be a string');
            }
        }
    }

    function processComponent (component, namespace) {
        var name = component.params;

        if (namespace) {
            name = namespace + currentConfig.separators.namespace + name;
        }

        var last = component;
        var newComponent = postcss.rule({
            selector: '.' + name,
            source: component.source
        });
        component.each(function (rule) {
{'fraction_non_alphanumeric': 0.1328779882024216, 'fraction_numerical': 0.0, 'mean_word_length': 1.7514944491887277, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '578473', 'n_tokens_mistral': 908, 'n_tokens_neox': 883, 'n_words': 200}