lint: fix errors and ignore indentation in template string vars

This commit is contained in:
jean-emmanuel 2019-04-02 10:07:16 +02:00
parent c08469d795
commit 2dab26326d
6 changed files with 14 additions and 16 deletions

View file

@ -125,7 +125,7 @@ module.exports = {
// store session & state backup
ipc.send('storeBackup', {
backupId: id,
session: session.session || {},
session: session.session || {},
sessionPath: session.sessionPath,
state: state.get(),
history: editor.history,

View file

@ -241,7 +241,7 @@ var SessionManager = class SessionManager {
})
}
setSessionPath(path) {
setSessionPath(path) {
this.sessionPath = path
if (path) {

View file

@ -1,6 +1,5 @@
var html = require('nanohtml'),
raw = require('nanohtml/raw'),
locales = require('../locales')
raw = require('nanohtml/raw')
class ContextMenu {

View file

@ -161,13 +161,12 @@ module.exports = {
saveInput = html`<input type="text" class="save-as"/>`,
actions = html`
<div class="file-actions">
${
save ? saveInput : ''
}
${ save ? saveInput : '' }
<div class="btn cancel">${raw(module.exports.icon('times'))} Cancel</div>
${
save ? html`<div class="btn submit save">${raw(module.exports.icon('save'))} Save</div>` :
html`<div class="btn submit open">${raw(module.exports.icon('folder-open'))} Open</div>`
save ?
html`<div class="btn submit save">${raw(module.exports.icon('save'))} Save</div>` :
html`<div class="btn submit open">${raw(module.exports.icon('folder-open'))} Open</div>`
}
</div>
`
@ -232,7 +231,7 @@ module.exports = {
setTimeout(submit, 100)
} else if (e.target === saveInput) {
return
} else if (e.keyCode === 8) {
} else if (e.keyCode === 8) {
list.childNodes[0].firstElementChild.checked = true
submit()
} else if (e.key.length === 1) {
@ -254,14 +253,14 @@ module.exports = {
ariane.innerHTML = path = data.path
files = data.files.filter(x=>x.folder || x.name.match(extRe))
files = data.files.filter(x=>x.folder || x.name.match(extRe))
function alphaSort(a, b){
// convert to strings and force lowercase
a = typeof a.name === 'string' ? a.name.toLowerCase() : a.name.toString();
b = typeof b.name === 'string' ? b.name.toLowerCase() : b.name.toString();
return a.localeCompare(b);
a = typeof a.name === 'string' ? a.name.toLowerCase() : a.name.toString()
b = typeof b.name === 'string' ? b.name.toLowerCase() : b.name.toString()
return a.localeCompare(b)
}
var fo = files.filter(x=>x.folder),

View file

@ -374,7 +374,7 @@ module.exports = {
listDir: function(data, clientId) {
var p = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];
var p = process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME']
if (data.path) p = path.resolve(...data.path)