max-mapper / standard-format

converts your code into Standard JavaScript Format
264 stars 59 forks source link

switch to less dynamic way of including rc for better browserify support #107

Closed Flet closed 9 years ago

Flet commented 9 years ago

I'm currently building a neat little tool to lint using standard via the web, and I wanted to also include support to format.

Switching this line to include the esformatter config file in a more static way enables this package to go through browserify more easily.

feross commented 9 years ago

I think this would break Windows support.

feross commented 9 years ago

Actually, maybe since this is being passed to require, the conversion from / to \ is handled automatically?

Flet commented 9 years ago

Verified via node REPL on Windows that this is working:

C:\dev\code\standard-format>node
> var config = require('./rc/esformatter.json')
undefined
> config.lineBreak.value
'\n'
> Object.keys(config).length
6
>
(^C again to quit)
>

C:\dev\code\standard-format>ver

Microsoft Windows [Version 6.1.7601]

Side note: There are some tests failing in Windows right now unrelated to this PR... it looks like possible trouble with the shebang line... it looks to be a potential esformatter bug.

bcomnes commented 9 years ago

feross commented 9 years ago

Released as 1.6.7.

Flet commented 9 years ago

aww yeah