1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 18:26:26 +00:00

fixed eslint error & integrated with prettier as well as formatted the whole codebase (#3450)

This commit is contained in:
Nguyen Viet Hung
2020-02-05 13:28:27 +13:00
committed by GitHub
parent 051ce9e208
commit 592aca1539
186 changed files with 9233 additions and 5565 deletions

View File

@@ -2,14 +2,14 @@ const sander = require('sander')
const path = require('path')
const CSON = require('@rokt33r/season')
function resolveStorageNotes (storage) {
function resolveStorageNotes(storage) {
const notesDirPath = path.join(storage.path, 'notes')
let notePathList
try {
notePathList = sander.readdirSync(notesDirPath)
} catch (err) {
if (err.code === 'ENOENT') {
console.error(notesDirPath, ' doesn\'t exist.')
console.error(notesDirPath, " doesn't exist.")
sander.mkdirSync(notesDirPath)
} else {
console.warn('Failed to find note dir', notesDirPath, err)
@@ -17,10 +17,10 @@ function resolveStorageNotes (storage) {
notePathList = []
}
const notes = notePathList
.filter(function filterOnlyCSONFile (notePath) {
.filter(function filterOnlyCSONFile(notePath) {
return /\.cson$/.test(notePath)
})
.map(function parseCSONFile (notePath) {
.map(function parseCSONFile(notePath) {
try {
const data = CSON.readFileSync(path.join(notesDirPath, notePath))
data.key = path.basename(notePath, '.cson')
@@ -30,7 +30,7 @@ function resolveStorageNotes (storage) {
console.error(`error on note path: ${notePath}, error: ${err}`)
}
})
.filter(function filterOnlyNoteObject (noteObj) {
.filter(function filterOnlyNoteObject(noteObj) {
return typeof noteObj === 'object'
})