Skip to content

Commit

Permalink
Lint all files
Browse files Browse the repository at this point in the history
  • Loading branch information
baku89 committed Jul 21, 2020
1 parent 8bde638 commit 480f190
Show file tree
Hide file tree
Showing 31 changed files with 1,164 additions and 1,229 deletions.
2 changes: 1 addition & 1 deletion ftp.info.sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ module.exports = {
password: 'password',
host: 'host.com',
port: 21,
remoteRoot: '/public_html'
remoteRoot: '/public_html',
}
2 changes: 1 addition & 1 deletion src/background.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {app, protocol, BrowserWindow, ipcMain} from 'electron'
import {app, protocol, BrowserWindow} from 'electron'
import {platform} from 'os'
import {
createProtocol,
Expand Down
14 changes: 7 additions & 7 deletions src/components/Editor/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
onBeforeUnmount,
watch,
SetupContext,
PropType
PropType,
} from '@vue/composition-api'
import ace from 'brace'
Expand Down Expand Up @@ -132,25 +132,25 @@ export default defineComponent({
props: {
value: {
type: String,
required: true
required: true,
},
selection: {
type: Array as PropType<number[]>,
required: false
required: false,
},
activeRange: {
type: Array as PropType<number[]>,
required: false
required: false,
},
cssStyle: {
type: String,
default: ''
}
default: '',
},
},
setup(props, context) {
const {editorEl} = useBraceEditor(props, context)
return {editorEl}
}
},
})
</script>

Expand Down
66 changes: 33 additions & 33 deletions src/components/Editor/define-glisp-mode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ace from 'brace'

// Mode
;(ace as any).define('ace/mode/glisp', function(
;(ace as any).define('ace/mode/glisp', function (
this: any,
acequire: any,
exports: any
Expand All @@ -13,13 +13,13 @@ import ace from 'brace'
const MatchingParensOutdent = acequire('./matching_parens_outdent')
.MatchingParensOutdent

const Mode = function(this: any) {
const Mode = function (this: any) {
this.HighlightRules = GlispHighlightRules
this.$outdent = new MatchingParensOutdent()
this.$behaviour = this.$defaultBehaviour
}
oop.inherits(Mode, TextMode)
;(function(this: any) {
;(function (this: any) {
this.lineCommentStart = ';'
this.minorIndentFunctions = [
'if',
Expand All @@ -33,13 +33,13 @@ import ace from 'brace'
'style',
'path/transform',
'artboard',
'clip'
'clip',
]

this.$toIndent = function(str: string) {
this.$toIndent = function (str: string) {
return str
.split('')
.map(function(ch) {
.map(function (ch) {
if (/\s/.exec(ch)) {
return ch
} else {
Expand All @@ -49,7 +49,7 @@ import ace from 'brace'
.join('')
}

this.$calculateIndent = function(line: string, tab: any) {
this.$calculateIndent = function (line: string, tab: any) {
let baseIndent = this.$getIndent(line) as string
let delta = 0
let isParen, ch, i
Expand Down Expand Up @@ -102,15 +102,15 @@ import ace from 'brace'
}
}

this.getNextLineIndent = function(state: any, line: any, tab: any) {
this.getNextLineIndent = function (state: any, line: any, tab: any) {
return this.$calculateIndent(line, tab)
}

this.checkOutdent = function(state: any, line: any, input: any) {
this.checkOutdent = function (state: any, line: any, input: any) {
return this.$outdent.checkOutdent(line, input)
}

this.autoOutdent = function(state: any, doc: any, row: any) {
this.autoOutdent = function (state: any, doc: any, row: any) {
this.$outdent.autoOutdent(doc, row)
}

Expand All @@ -122,7 +122,7 @@ import ace from 'brace'
})

// Highlight Rule
;(ace as any).define('ace/mode/glisp_highlight_rules', function(
;(ace as any).define('ace/mode/glisp_highlight_rules', function (
this: any,
acequire: any,
exports: any
Expand All @@ -131,7 +131,7 @@ import ace from 'brace'
const TextHighlightRules = acequire('ace/mode/text_highlight_rules')
.TextHighlightRules

const GlispHighlightRules = function(this: any) {
const GlispHighlightRules = function (this: any) {
const clojureBuiltinFunctions = ''

const builtinFunctions = clojureBuiltinFunctions
Expand All @@ -142,7 +142,7 @@ import ace from 'brace'
const keywordMapper = this.createKeywordMapper(
{
function: specialForms,
'support.function': builtinFunctions
'support.function': builtinFunctions,
},
'identifier',
false,
Expand All @@ -156,7 +156,7 @@ import ace from 'brace'
start: [
{
token: 'comment',
regex: ';.*$'
regex: ';.*$',
},
// {
// token: 'keyword', //lists
Expand All @@ -172,54 +172,54 @@ import ace from 'brace'
// },
{
token: 'keyword', // ampersands, metadata
regex: '[\\#\\^\\&]'
regex: '[\\#\\^\\&]',
},
{
token: 'keyword', // anonymous fn syntactic sugar
regex: '[%][0-9]*'
regex: '[%][0-9]*',
},
{
token: 'keyword', // deref reader macro
regex: '[@]'
regex: '[@]',
},
// {
// token: 'constant.numeric', // hex
// regex: '0[xX][0-9a-fA-F]+\\b'
// },
{
token: 'constant.numeric', // float
regex: '[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b'
regex: '[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b',
},
{
token: 'constant.language',
regex: 'true|false|nil'
regex: 'true|false|nil',
},
{
token: 'function',
regex: '[\\+|\\-|\\*|\\/||=|!=|<=|>=|<|>]' // functions begin with symbols
regex: '[\\+|\\-|\\*|\\/||=|!=|<=|>=|<|>]', // functions begin with symbols
},
{
token: keywordMapper,
regex: '[a-zA-Z_$\\/][a-zA-Z0-9_$\\-]*\\b'
regex: '[a-zA-Z_$\\/][a-zA-Z0-9_$\\-]*\\b',
},
{
token: 'identifier', //parens
regex: '[\\(]',
next: 'fncall'
next: 'fncall',
},
{
token: 'identifier', //parens end
regex: '[\\)]'
regex: '[\\)]',
},
{
token: 'keyword.operator',
regex: '\\:[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b' // keyword
regex: '\\:[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b', // keyword
},
{
token: 'string', // single line
regex: '"',
next: 'string'
}
next: 'string',
},
// {
// token: 'constant', // symbol
// regex: /:[^()\[\]{}'"\^%`,;\s]+/ // eslint-disable-line no-useless-escape
Expand All @@ -233,24 +233,24 @@ import ace from 'brace'
{
token: 'function',
regex: '[\\s]*[^\\s\\(\\[\\{]+',
next: 'start'
}
next: 'start',
},
],
string: [
{
token: 'constant.language.escape',
regex: '\\\\.|\\\\$'
regex: '\\\\.|\\\\$',
},
{
token: 'string',
regex: '[^"\\\\]+'
regex: '[^"\\\\]+',
},
{
token: 'string',
regex: '"',
next: 'start'
}
]
next: 'start',
},
],
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/Editor/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ function setupSettings(editor: ace.Editor) {
showGutter: false,
tabSize: 2,
useSoftTabs: false,
maxLines: Infinity
maxLines: Infinity,
})
}

function setupResizeHandler(editor: ace.Editor) {
useResizeSensor(editor.container, el => {
useResizeSensor(editor.container, () => {
editor.resize(true)
})
}
Expand All @@ -40,15 +40,15 @@ function setupKeybinds(editor: ace.Editor) {
bindKey: {win: 'Ctrl-p', mac: 'Command-p'},
exec: () => {
ConsoleScope.readEval('(select-outer)')
}
},
})

editor.commands.addCommand({
name: 'expand-selected',
bindKey: {win: 'Ctrl-e', mac: 'Command-e'},
exec: () => {
ConsoleScope.readEval('(expand-selected)')
}
},
})
}

Expand Down
Loading

0 comments on commit 480f190

Please sign in to comment.