Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

fix env error while invoked by Sublime Text 3's plugin "Better Coffeescript" #247

Closed
wants to merge 1 commit into from

Conversation

trevorwang
Copy link

Invoked by Sublime Text 3, the following code will return as value of undefined

envs = process.env.HOME or process.env.HOMEPATH or process.env.USERPROFILE

It will cause path's error as following:

TypeError: Arguments to path.join must be strings
  at path.js:360:15
  at Array.filter (native)
  at Object.exports.join (path.js:358:36)
  at Object.exports.getConfig (/usr/local/lib/node_modules/coffeelint/lib/configfinder.js:69:32)
  at getFallbackConfig (/usr/local/lib/node_modules/coffeelint/lib/commandline.js:384:27)
  at lintFiles (/usr/local/lib/node_modules/coffeelint/lib/commandline.js:350:38)
  at Object.<anonymous> (/usr/local/lib/node_modules/coffeelint/lib/commandline.js:471:21)
  at Object.<anonymous> (/usr/local/lib/node_modules/coffeelint/lib/commandline.js:476:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/usr/local/lib/node_modules/coffeelint/bin/coffeelint:17:5)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:902:3

…script"

TypeError: Arguments to path.join must be strings
  at path.js:360:15
  at Array.filter (native)
  at Object.exports.join (path.js:358:36)
  at Object.exports.getConfig (/usr/local/lib/node_modules/coffeelint/lib/configfinder.js:69:32)
  at getFallbackConfig (/usr/local/lib/node_modules/coffeelint/lib/commandline.js:384:27)
  at lintFiles (/usr/local/lib/node_modules/coffeelint/lib/commandline.js:350:38)
  at Object.<anonymous> (/usr/local/lib/node_modules/coffeelint/lib/commandline.js:471:21)
  at Object.<anonymous> (/usr/local/lib/node_modules/coffeelint/lib/commandline.js:476:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/usr/local/lib/node_modules/coffeelint/bin/coffeelint:17:5)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:902:3
@AsaAyers
Copy link
Collaborator

While I see where this does fix the error, I don't think it's the right solution. I recommend opening an issue in Better CoffeeScript instead to let them know that the environment needs to be passed.

I think it would be extremely frustrating to create a coffeelint.json in my home and then have it silently ignored.

I'm interested in following that issue, so please mention me and link back to here. coffeelint.org doesn't link to any sublime plugins because I haven't been able to find any that I've been able to make work. I normally use vim but tried sublime to just to try to find CoffeeLint plugins.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants