How to make vscode-luacheck work with the luacheck.exe

Image for post
Image for post
luacheck is quite useful

If you’ve installed luacheck as a .exe and you need vscode-luacheck to work you’re currently going to need to implement a workaround. This appears to be a common issue I’ve seen with people using vscode and luacheck.

If the error you’re seeing is “Please install luacheck or check luacheck.path” you’re seeing, this tutorial is here to help!

Image for post
Image for post
Failure to find the folder even if you have luacheck added to the PATH variable

Solution!

Basically, the extension is looking for a luacheck.bat file! You can fix this by just creating a luacheck.bat file that forwards arguments to the folder

The file I’m using is simply this:

Image for post
Image for post
Put the .bat file right in with the luacheck executable

I put it right next to the path with the luacheck.exe. This results in linting on my files!

Hopefully the extension creators will fix this soon!

Didn’t work? Or don’t have things installed? Here’s the assumptions made:

Initial setup/installation

If you haven’t installed luacheck yet, we’re assuming the following is true:

Image for post
Image for post
The version of luacheck for VSCode that I’m using
  • You’re on Windows, using VSCode
  • You’ve installed the VSCode extension vscode-luacheck by dwengear
  • You’ve downloaded the luacheck.exe from the latest release and put in a folder on your path
  • You can execute luacheck on PowerShell and it finds the .exe (You may have to add luacheck to your path. Checkout the section in this tutorial about adding rojo to your path)

Getting this working in Linux or Mac

If you need this extension to work on Linux or Mac, you’re going to need to install luacheck the more traditional way, and not by copying the luacheck.exe.

Thanks for reading! I hope this article helps you out! Let me know if you have any questions!

Roblox Development

The stories, commentaries, and thoughts on game development.

James Onnen (Quenty)

Written by

I’m a maker. Designing and creating new things with people is my hobby. Former intern @Microsoft, @Roblox, @Garmin. Roblox Toy. Raikes 2019.

Roblox Development

The stories, commentaries, and thoughts on game development. Capturing the experience.

James Onnen (Quenty)

Written by

I’m a maker. Designing and creating new things with people is my hobby. Former intern @Microsoft, @Roblox, @Garmin. Roblox Toy. Raikes 2019.

Roblox Development

The stories, commentaries, and thoughts on game development. Capturing the experience.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store