1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Chore: Apply eslint rules

This commit is contained in:
Laurent Cozic
2019-09-19 22:51:18 +01:00
parent ab29d7e872
commit e648392330
185 changed files with 1196 additions and 1196 deletions

View File

@ -48,7 +48,7 @@ function shimInit() {
// and throw a catchable error.
// Bug: https://github.com/facebook/react-native/issues/7436
const validatedUrl = urlValidator.isUri(url);
if (!validatedUrl) throw new Error('Not a valid URL: ' + url);
if (!validatedUrl) throw new Error(`Not a valid URL: ${url}`);
return shim.fetchWithRetry(() => {
return fetch(validatedUrl, options);
@ -64,7 +64,7 @@ function shimInit() {
let dirs = RNFetchBlob.fs.dirs;
let localFilePath = options.path;
if (localFilePath.indexOf('/') !== 0) localFilePath = dirs.DocumentDir + '/' + localFilePath;
if (localFilePath.indexOf('/') !== 0) localFilePath = `${dirs.DocumentDir}/${localFilePath}`;
if (!overwrite) {
if (await shim.fsDriver().exists(localFilePath)) {
@ -96,7 +96,7 @@ function shimInit() {
return output;
} catch (error) {
throw new Error('fetchBlob: ' + method + ' ' + url + ': ' + error.toString());
throw new Error(`fetchBlob: ${method} ${url}: ${error.toString()}`);
}
};
@ -119,7 +119,7 @@ function shimInit() {
headers: response.respInfo.headers,
};
} catch (error) {
throw new Error('uploadBlob: ' + method + ' ' + url + ': ' + error.toString());
throw new Error(`uploadBlob: ${method} ${url}: ${error.toString()}`);
}
};
@ -173,7 +173,7 @@ function shimInit() {
}
const itDoes = await shim.fsDriver().waitTillExists(targetPath);
if (!itDoes) throw new Error('Resource file was not created: ' + targetPath);
if (!itDoes) throw new Error(`Resource file was not created: ${targetPath}`);
const fileStat = await shim.fsDriver().stat(targetPath);
resource.size = fileStat.size;
@ -184,12 +184,12 @@ function shimInit() {
};
shim.injectedJs = function(name) {
if (!(name in injectedJs)) throw new Error('Cannot find injectedJs file (add it to "injectedJs" object): ' + name);
if (!(name in injectedJs)) throw new Error(`Cannot find injectedJs file (add it to "injectedJs" object): ${name}`);
return injectedJs[name];
};
shim.loadCssFromJs = function(name) {
if (!(name in cssToJs)) throw new Error('Cannot find csstojs file (add it to "cssToJs" object): ' + name);
if (!(name in cssToJs)) throw new Error(`Cannot find csstojs file (add it to "cssToJs" object): ${name}`);
return cssToJs[name];
};
}