Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (currentDir === rootDir) {
// Don't go up past the package's root directory
break;
}
var parentDir = path.dirname(currentDir);
if (!parentDir || parentDir === currentDir) {
break;
}
currentDir = parentDir;
}
if (editorConfigs) {
var parsedEditorConfig = editorconfig.parseFromFilesSync(
filename,
editorConfigs
);
var convertedEditorConfig = convertEditorConfig(parsedEditorConfig);
mergeOptions(convertedEditorConfig);
}
if (!config.eol) {
config.eol = os.EOL;
}
return config;
}
function getStyleForFile(filepath) {
const editorconfigFile = findEditorConfig(filepath);
if (editorconfigFile) {
return editorconfig.parseFromFilesSync(filepath, [
{ name: editorconfigFile, contents: readFile(editorconfigFile) },
]);
}
return {};
}