File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,15 @@ class Luacheck {
3131 command ( document ) {
3232 const settings = this . coder . settings . luacheck ;
3333 let args = [ ] ;
34+ let luacheckrc_path
3435
3536 if ( settings . automaticOption ) {
3637 this . automaticOptions ( settings , args , document ) ;
3738 } else {
3839 const luacheckrc = path_1 . resolve ( settings . configFilePath , ".luacheckrc" ) ;
3940 if ( isFileSync ( luacheckrc ) ) {
4041 args . push ( '--config' , luacheckrc ) ;
42+ luacheckrc_path = path_1 . dirname ( luacheckrc )
4143 }
4244 }
4345
@@ -46,10 +48,11 @@ class Luacheck {
4648 args . push ( "--filename" , fileName , "-" ) ; //use stdin
4749
4850 let cmd = settings . execPath || default_luacheck_executor ;
51+ let cwd = path_1 . dirname ( luacheckrc_path || fileName ) ;
4952
5053 return {
5154 cmd : cmd ,
52- cwd : path_1 . dirname ( fileName ) ,
55+ cwd : cwd ,
5356 args : args
5457 } ;
5558 }
You can’t perform that action at this time.
0 commit comments