Skip to content

Commit

Permalink
refactoring: some linting
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaslabbe committed Oct 5, 2016
1 parent 83288c4 commit 434e734
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 23 deletions.
2 changes: 0 additions & 2 deletions src/cli/cms/data/meta.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import extend from 'extend'
import {
cmsData
,config
Expand All @@ -8,7 +7,6 @@ import {
export function add(tpl, json, type, obj = {}, date = null, realType = 'draft') {
let meta = config.meta.name

// json[meta] = extend({}, json[meta])
var currentDate = (typeof date !== 'undefined' && date !== null && date !== '') ? date : new Date()
var abeUrl = (type === 'publish') ? json[meta].link : cmsData.fileAttr.add(json[meta].link, 'd' + dateSlug(currentDate.toISOString())) + ''

Expand Down
18 changes: 3 additions & 15 deletions src/cli/cms/data/source.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
import extend from 'extend'
import clc from 'cli-color'
import fse from 'fs-extra'
import ajaxRequest from 'ajax-request'
import {Promise} from 'es6-promise'
import http from 'http'
import https from 'https'
import path from 'path'

import {
config
,cmsData
cmsData
,Util
,folderUtils
,fileUtils
,FileParser
,dateSlug
,dateUnslug
,Hooks
,Plugins
} from '../../'

export function requestList(obj, tplPath, match, jsonPage) {
Expand Down Expand Up @@ -64,7 +52,7 @@ export function valueList(obj, match, jsonPage) {
jsonPage['abe_source'][obj.key] = value
}catch(e){
jsonPage['abe_source'][obj.key] = null
console.log(clc.red(`Error ${value}/is not a valid JSON`), `\n${e}`)
console.log(`Error ${value}/is not a valid JSON`, `\n${e}`)
}
}
resolve()
Expand Down Expand Up @@ -127,7 +115,7 @@ export function urlList(obj, tplPath, match, jsonPage) {
jsonPage['abe_source'][obj.key] = body
}
} catch(e) {
console.log(clc.red(`Error ${obj.sourceString} is not a valid JSON`), `\n${e}`)
console.log(`Error ${obj.sourceString} is not a valid JSON`, `\n${e}`)
}
resolve()
})
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cms/templates/encodeAbeTagAsComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export default function encodeAbeTagAsComment(block){
}
matchAbe = block.match(/( [A-Za-z0-9\-\_]+="*{{.*?}})/g)
if(matchAbe){
for (var i = 0; i < matchAbe.length; i++) {
for (i = 0; i < matchAbe.length; i++) {
if(typeof matchAbe !== 'undefined' && matchAbe !== null){
var getattr = cmsData.regex.getAttr(matchAbe[i], 'key').replace('.', '[0]-')
getattr = cmsData.regex.getAttr(matchAbe[i], 'key').replace('.', '[0]-')
var matchattr = (matchAbe[i].split('=')[0]).trim()
block = block.replace(
matchAbe[i],
Expand Down
4 changes: 0 additions & 4 deletions src/cli/cms/templates/insertDebugtoolUtilities.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import {
cmsData
} from '../../'

export default function insertDebugtoolUtilities(text){
return text.replace(
/<\/body>/,
Expand Down

0 comments on commit 434e734

Please sign in to comment.