Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for (const filePath of filePaths) {
const tsConfigFilePath = tsconfig.findSync(path.dirname(filePath));
const projectEntry = tsConfigFilePath && projects[tsConfigFilePath];
if (projectEntry) {
const sourceFile = projectEntry.project.getSourceFile(filePath);
if (sourceFile) {
if (projectEntry.files !== "all") {
projectEntry.files.push(sourceFile);
}
continue;
}
}
const ec = editorconfig.parseSync(filePath);
const manipulationSettings = getManipulationSettings(ec);
const detectNewLineKind = !!ec.end_of_line;
if (tsConfigFilePath && !projectEntry) {
const project = new Project({ tsConfigFilePath, manipulationSettings });
if (path.basename(filePath).toLowerCase() === "tsconfig.json") {
projects[tsConfigFilePath] = {
files: "all",
project,
detectNewLineKind
};
continue;
}
const sourceFile = project.getSourceFile(filePath);
function set_file_editorconfig_opts(file, config) {
try {
var eConfigs = editorconfig.parseSync(file);
if (eConfigs.indent_style === "tab") {
config.indent_with_tabs = true;
} else if (eConfigs.indent_style === "space") {
config.indent_with_tabs = false;
}
if (eConfigs.indent_size) {
config.indent_size = eConfigs.indent_size;
}
if (eConfigs.max_line_length) {
if (eConfigs.max_line_length === "off") {
config.wrap_line_length = 0;
} else {
config.wrap_line_length = parseInt(eConfigs.max_line_length);
function set_file_editorconfig_opts(file, config) {
try {
var eConfigs = editorconfig.parseSync(file);
if (eConfigs.indent_style === "tab") {
config.indent_with_tabs = true;
} else if (eConfigs.indent_style === "space") {
config.indent_with_tabs = false;
}
if (eConfigs.indent_size) {
config.indent_size = eConfigs.indent_size;
}
if (eConfigs.max_line_length) {
if (eConfigs.max_line_length === "off") {
config.wrap_line_length = 0;
} else {
config.wrap_line_length = parseInt(eConfigs.max_line_length);
function set_file_editorconfig_opts(file, config) {
try {
var eConfigs = editorconfig.parseSync(file);
if (eConfigs.indent_style === "tab") {
config.indent_with_tabs = true;
} else if (eConfigs.indent_style === "space") {
config.indent_with_tabs = false;
}
if (eConfigs.indent_size) {
config.indent_size = eConfigs.indent_size;
}
if (eConfigs.max_line_length) {
if (eConfigs.max_line_length === "off") {
config.wrap_line_length = 0;
} else {
config.wrap_line_length = parseInt(eConfigs.max_line_length, 10);
var getEditorConfigOptions = function getEditorConfigOptions(file) {
var options = editorconfig.parseSync(file);
return options ? mapEditorConfigOptions(options) : null;
};
function set_file_editorconfig_opts(file, config) {
try {
var eConfigs = editorconfig.parseSync(file);
if (eConfigs.indent_style === "tab") {
config.indent_with_tabs = true;
} else if (eConfigs.indent_style === "space") {
config.indent_with_tabs = false;
}
if (eConfigs.indent_size) {
config.indent_size = eConfigs.indent_size;
}
if (eConfigs.max_line_length) {
if (eConfigs.max_line_length === "off") {
config.wrap_line_length = 0;
} else {
config.wrap_line_length = parseInt(eConfigs.max_line_length);
const getEditorConfigOptions = (file: FilePath) => {
const options = editorconfig.parseSync(file);
return options ? mapEditorConfigOptions(options) : null;
};
function set_file_editorconfig_opts(file, config) {
try {
var eConfigs = editorconfig.parseSync(file);
if (eConfigs.indent_style === "tab") {
config.indent_with_tabs = true;
} else if (eConfigs.indent_style === "space") {
config.indent_with_tabs = false;
}
if (eConfigs.indent_size) {
config.indent_size = eConfigs.indent_size;
}
if (eConfigs.max_line_length) {
if (eConfigs.max_line_length === "off") {
config.wrap_line_length = 0;
} else {
config.wrap_line_length = parseInt(eConfigs.max_line_length);