How to use the editorconfig.parseFromFiles function in editorconfig

To help you get started, we’ve selected a few editorconfig 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 RReverser / github-editorconfig / src / common / background.js View on Github external
global.getEditorConfig = function (path, callback) {
    var defaultConfig = ec.parseFromFiles(path.relative, [{
        name: pathUtils.resolve('.editorconfig'),
        contents: kango.storage.getItem('editorconfig') || ''
    }]);

    var repoConfig = ec.parse(pathUtils.join(path.root, path.relative), {
        root: path.root
    });

    Promise.settle([defaultConfig, repoConfig])
    .reduce(function (merged, current) {
        if (current.isFulfilled()) {
            current = current.value();
            for (var name in current) {
                merged[name] = current[name];
            }
        }

editorconfig

EditorConfig File Locator and Interpreter for Node.js

MIT
Latest version published 10 months ago

Package Health Score

77 / 100
Full package analysis