Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hd-deman committed Aug 8, 2014
2 parents f48b53e + 679b80a commit d506bbb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/init.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ path = require 'path'
module.exports =
configDefaults:
coffeelintExecutablePath: path.join __dirname, '..', 'node_modules', 'coffeelint', 'bin'
coffeelintConfigPath: null

activate: ->
console.log 'activate linter-coffeelint'
13 changes: 10 additions & 3 deletions lib/linter-coffeelint.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@ class LinterCoffeelint extends Linter

isNodeExecutable: yes

configPath: null

constructor: (editor) ->
super(editor)

config = findFile(@cwd, ['coffeelint.json'])
if config
@cmd += " -f #{config}"
atom.config.observe 'linter-coffeelint.coffeelintConfigPath', =>
@configPath = atom.config.get 'linter-coffeelint.coffeelintConfigPath'

if configPathLocal = findFile(@cwd, ['coffeelint.json'])
@cmd += " -f #{configPathLocal}"
else if @configPath
@cmd += " -f #{@configPath}"

atom.config.observe 'linter-coffeelint.coffeelintExecutablePath', =>
@executablePath = atom.config.get 'linter-coffeelint.coffeelintExecutablePath'
Expand All @@ -38,5 +44,6 @@ class LinterCoffeelint extends Linter

destroy: ->
atom.config.unobserve 'linter-coffeelint.coffeelintExecutablePath'
atom.config.unobserve 'linter-coffeelint.coffeelintConfigPath'

module.exports = LinterCoffeelint

0 comments on commit d506bbb

Please sign in to comment.