Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Sep 30, 2016
1 parent 7ab96d7 commit f4a4887
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -8,7 +8,7 @@
"url": "git://github.com/AdFabConnect/abejs.git"
},
"scripts": {
"lint": "eslint src",
"lint": "eslint src --fix",
"test": "mocha --compilers js:babel-register --require babel-polyfill",
"test-cov": "istanbul cover _mocha -- --compilers js:babel-register --require babel-polyfill",
"test-coveralls": "istanbul cover _mocha --report lcovonly -- --compilers js:babel-register --require babel-polyfill -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
Expand Down
2 changes: 1 addition & 1 deletion src/cli/controllers/Save.js
Expand Up @@ -206,7 +206,7 @@ export function saveJson(url, json) {
if (typeof obj[k] === 'object' && obj[k] !== null){
eachRecursive(obj[k])
} else if (typeof obj[k] !== 'undefined' && obj[k] !== null){
obj[k] = xss(obj[k].toString().replace(/"/g, '"'), { 'whiteList': config.htmlWhiteList })
obj[k] = xss(obj[k].toString().replace(/"/g, '"'), { 'whiteList': config.htmlWhiteList })
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/cli/helpers/abe-sql.js
Expand Up @@ -393,7 +393,7 @@ export default class Sql {
jsonValues[column] = json[column]
}
})
jsonValues["abe_meta"] = json["abe_meta"]
jsonValues['abe_meta'] = json['abe_meta']
}else {
jsonValues = json
}
Expand Down Expand Up @@ -553,8 +553,8 @@ export default class Sql {
var compare

if((where.left === 'template' || where.left === 'abe_meta.template')
&& typeof jsonDoc["abe_meta"] !== 'undefined' && jsonDoc["abe_meta"] !== null) {
value = FileParser.getTemplate(jsonDoc["abe_meta"].template)
&& typeof jsonDoc['abe_meta'] !== 'undefined' && jsonDoc['abe_meta'] !== null) {
value = FileParser.getTemplate(jsonDoc['abe_meta'].template)
}else {
try {
value = eval('jsonDoc.' + where.left)
Expand Down
10 changes: 5 additions & 5 deletions src/server/public/scripts/modules/EditorAutocomplete.js
Expand Up @@ -124,7 +124,7 @@ export default class EditorAutocomplete {
}

_select(target) {
var val = JSON.parse(target.getAttribute('data-value').replace(/&quote;/g, "'"))
var val = JSON.parse(target.getAttribute('data-value').replace(/&quote;/g, '\''))
var maxLength = this._currentInput.getAttribute('data-maxlength')
if(typeof maxLength !== 'undefined' && maxLength !== null && maxLength !== '') {
maxLength = parseInt(maxLength)
Expand All @@ -137,7 +137,7 @@ export default class EditorAutocomplete {
var div = document.createElement('div')
div.classList.add('autocomplete-result')
div.setAttribute('data-parent-id', this._currentInput.getAttribute('data-id'))
div.setAttribute('value', target.getAttribute('data-value').replace(/&quote;/g, "'"))
div.setAttribute('value', target.getAttribute('data-value').replace(/&quote;/g, '\''))
div.innerHTML = `${this._deep_value_array(val, display)}`

var resWrapper = this._divWrapper.parentNode.querySelector('.autocomplete-result-wrapper')
Expand Down Expand Up @@ -217,7 +217,7 @@ export default class EditorAutocomplete {
}else {
this._previousValue = val
}
var dataVal = target.getAttribute('data-value').replace(/&quote;/g, "'")
var dataVal = target.getAttribute('data-value').replace(/&quote;/g, '\'')

if (dataVal.indexOf('http') === 0) {
this._ajax(
Expand All @@ -231,7 +231,7 @@ export default class EditorAutocomplete {
this._showAutocomplete(JSON.parse(responseText), target, val)
})
}else {
var sources = JSON.parse(target.getAttribute('data-value').replace(/&quote;/g, "'"))
var sources = JSON.parse(target.getAttribute('data-value').replace(/&quote;/g, '\''))
this._showAutocomplete(sources, target, val)
}
}else {
Expand Down Expand Up @@ -329,7 +329,7 @@ export default class EditorAutocomplete {
_deep_value_array(obj, path) {

if(path.indexOf('.') === -1) {
return (typeof obj[path] !== 'undefined' && obj[path] !== null) ? obj[path].replace(/&quote;/g, "'") : null
return (typeof obj[path] !== 'undefined' && obj[path] !== null) ? obj[path].replace(/&quote;/g, '\'') : null
}

var pathSplit = path.split('.')
Expand Down

0 comments on commit f4a4887

Please sign in to comment.