Skip to content

Commit 00fadce

Browse files
committed
improve files to fix lint warnings
1 parent 278749e commit 00fadce

7 files changed

+8
-11
lines changed

coffeelint.json

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
"max_line_length": {
33
"level": "ignore"
4-
},
5-
"no_throwing_strings": {
6-
"level": "warn"
74
}
85
}

lib/grammar-utils.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports =
2525

2626
tempFilePath
2727
catch error
28-
throw "Error while creating temporary file (#{error})"
28+
throw ("Error while creating temporary file (#{error})")
2929

3030
# Public: Delete all temporary files and the directory created by {GrammarUtils::createTempFileWithCode}
3131
deleteTempFiles: ->
@@ -36,7 +36,7 @@ module.exports =
3636
files.forEach((file, index) => fs.unlinkSync(@tempFilesDir + path.sep + file))
3737
fs.rmdirSync(@tempFilesDir)
3838
catch error
39-
throw "Error while deleting temporary files (#{error})"
39+
throw ("Error while deleting temporary files (#{error})")
4040

4141
# Public: Get the Lisp helper object
4242
#

lib/grammar-utils/R.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ module.exports =
66
# * `code` A {String} containing some R code
77
#
88
# Returns the {String} filepath of the new file
9-
createTempFileWithCode: (code) =>
9+
createTempFileWithCode: (code) ->
1010
module.parent.exports.createTempFileWithCode(code)

lib/grammar-utils/php.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ module.exports =
66
# * `code` A {String} containing some PHP code without <?php header
77
#
88
# Returns the {String} filepath of the new file
9-
createTempFileWithCode: (code) =>
9+
createTempFileWithCode: (code) ->
1010
code = "<?php #{code}" unless /^[\s]*<\?php/.test(code)
1111
module.parent.exports.createTempFileWithCode(code)

lib/runtime.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Runtime
3131
destroy: ->
3232
@stop()
3333
@runner.destroy()
34-
_.each @observers, (observer) => observer.destroy()
34+
_.each @observers, (observer) -> observer.destroy()
3535
@emitter.dispose()
3636
@codeContextBuilder.destroy()
3737

lib/script-options-view.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ class ScriptOptionsView extends View
9595
(replaces['`#match' + (Object.keys(replaces).length + 1) + '`'] = match) for match in matches
9696

9797
# replace strings
98-
args = args.replace(new RegExp(part, 'g'), match) for match, part of replaces
98+
args = (args.replace(new RegExp(part, 'g'), match) for match, part of replaces)
9999
split = (item for item in args.split ' ' when item isnt '')
100100

101101
replacer = (argument) ->
102-
argument = argument.replace(match, replacement) for match, replacement of replaces
102+
argument = (argument.replace(match, replacement) for match, replacement of replaces)
103103
argument
104104

105105
# restore strings, strip quotes

lib/view-runtime-observer.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ViewRuntimeObserver
2020
@subscriptions.add runtime.onDidNotRun (ev) =>
2121
@view.showUnableToRunError ev.command
2222
@subscriptions.add runtime.onDidContextCreate (ev) =>
23-
title = "#{ev.lang} - #{ev.filename + (":#{ev.lineNumber}" if ev.lineNumber?)}"
23+
title = #{ev.lang} - #{ev.filename + (":#{ev.lineNumber}" if ev.lineNumber?)}
2424
@view.setHeaderTitle title
2525
@subscriptions.add runtime.onDidNotSpecifyLanguage =>
2626
@view.showNoLanguageSpecified()

0 commit comments

Comments
 (0)