Cleaner Way to Structure Asynchronous Code
Tips for JS code optimization:

Variable names

Give your variables meaningful names:


const r1 = await dialog.showOpenDialog(...) can be renamed to dirs or dirList (representing selected directories)
const r2 = await fsp.readFile('./config.json', 'utf8'), config = JSON.parse(r2), where r2 is supposed to be a config file path. Let's rename it to say const config_file = await fsp.readFile('./config.json', 'utf8'), config = JSON.parse(config_file) 


Extract function:

Repeated expression &lt;string&gt;.slice(-1) === '\\' ? &lt;string&gt; : (&lt;string&gt; + '\\') can be extracted into a reusable routine (named or anonymous function):

var asDirPath = function(path) {
    return path.slice(-1) === '\\' ? path : (path + '\\');
};


Substitute algorithm:

The whole condition (combination of array.reduce and array.includes) can be easily substituted with a more efficient Array.some() approach (to check for any match between current directory path dir and config.archives file/dir paths):

for (const dir of dirList.filePaths){
    // Disregard user input if parent path or exact match already exists.
    if (config.archives.some(path =&gt; {
            return dir.indexOf(asDirPath(path)) === 0 || path === dir
    })) continue