Fix 'reject' is not defined. [Error/no-undef] ESLint error
Fix Unnecessary semicolon. [Error/no-extra-semi] ESLint error
This commit is contained in:
parent
63c239f36f
commit
8e7c6b45b8
|
@ -103,7 +103,7 @@ class FileUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
static async directoryExists(path) {
|
static async directoryExists(path) {
|
||||||
return new Promise(resolve => {
|
return new Promise((resolve, reject) => {
|
||||||
fs.stat(path, (err, stats) => {
|
fs.stat(path, (err, stats) => {
|
||||||
if (err) return reject({
|
if (err) return reject({
|
||||||
'message': `Directory does not exist: ${path}`,
|
'message': `Directory does not exist: ${path}`,
|
||||||
|
@ -127,7 +127,7 @@ class FileUtils {
|
||||||
throw (err);
|
throw (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise(resolve => {
|
return new Promise((resolve, reject) => {
|
||||||
fs.readFile(path, 'utf-8', (err, data) => {
|
fs.readFile(path, 'utf-8', (err, data) => {
|
||||||
if (err) reject({
|
if (err) reject({
|
||||||
'message': `Could not read file: ${path}`,
|
'message': `Could not read file: ${path}`,
|
||||||
|
@ -220,6 +220,6 @@ class Filters {
|
||||||
return filters.every(filter => filter(module));
|
return filters.every(filter => filter(module));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
module.exports = { Logger, Utils, FileUtils, Filters }
|
module.exports = { Logger, Utils, FileUtils, Filters }
|
|
@ -5,10 +5,10 @@
|
||||||
* https://github.com/JsSucks - https://betterdiscord.net
|
* https://github.com/JsSucks - https://betterdiscord.net
|
||||||
*
|
*
|
||||||
* This source code is licensed under the MIT license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const
|
const
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
fs = require('fs');
|
fs = require('fs');
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ class FileUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
static async directoryExists(path) {
|
static async directoryExists(path) {
|
||||||
return new Promise(resolve => {
|
return new Promise((resolve, reject) => {
|
||||||
fs.stat(path, (err, stats) => {
|
fs.stat(path, (err, stats) => {
|
||||||
if(err) return reject({
|
if(err) return reject({
|
||||||
'message': `Directory does not exist: ${path}`,
|
'message': `Directory does not exist: ${path}`,
|
||||||
|
@ -78,7 +78,7 @@ class FileUtils {
|
||||||
throw(err);
|
throw(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise(resolve => {
|
return new Promise((resolve, reject) => {
|
||||||
fs.readFile(path, 'utf-8', (err, data) => {
|
fs.readFile(path, 'utf-8', (err, data) => {
|
||||||
if(err) reject({
|
if(err) reject({
|
||||||
'message': `Could not read file: ${path}`,
|
'message': `Could not read file: ${path}`,
|
||||||
|
@ -145,7 +145,7 @@ class WindowUtils extends Module {
|
||||||
channel = channel.startsWith('bd-') ? channel : `bd-${channel}`;
|
channel = channel.startsWith('bd-') ? channel : `bd-${channel}`;
|
||||||
this.webContents.send(channel, message);
|
this.webContents.send(channel, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Loading…
Reference in New Issue