
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Node.JS bindings for luacheck.
You must have luacheck 0.10.0+ installed
and available in your PATH variable.
npm install luacheck
var luacheck = require("luacheck");
var errors = luacheck(sourceFilename, options);
console.log(errors); // or `luacheck.errors` for the most recent invocation
The options argument is a dictionary that accepts the following keys:
node-luacheck:cwdType: String
Default: undefined
By default luacheck is executed from the source file's directory to work
around some weird .luacheckrc behavior in older versions of luacheck. If this is not what you want,
you can override the working directory by passing a path to this parameter.
WARNING: source filenames are resolved relative to the current process' working
directory, not cwd.
execType: String
Default: undefined
If set, it should be a directory that contains luacheck (or luacheck.bat on
Windows). Useful if for whatever reason you can't have it added to your PATH.
luacheck:noGlobalType: Boolean
Default: false
Filter out warnings related to global variables.
DEPRECATED: use global in a .luacheckrc file instead.
noUnusedType: Boolean
Default: false
Filter out warnings related to unused variables and values.
DEPRECATED: use unused in a .luacheckrc file instead.
noRedefinedType: Boolean
Default: false
Filter out warnings related to redefined variables.
DEPRECATED: use redefined in a .luacheckrc file instead.
noUnusedArgsType: Boolean
Default: false
Filter out warnings related to unused arguments and loop variables.
DEPRECATED: use unused_args in a .luacheckrc file instead.
noUnusedSecondariesType: Boolean
Default: false
Filter out warnings related to unused variables set together with used ones. See Secondary values and variables.
DEPRECATED: use unused_secondaries in a .luacheckrc file instead.
noUnusedGlobalsType: Boolean
Default: false
Filter out warnings related to set but unused global variables.
DEPRECATED: use unused_globals in a .luacheckrc file instead.
stdType: String
Default: _G
Set standard globals to use. Must be one of:
_G - globals of the Lua interpreter luacheck runs on (default);lua51 - globals of Lua 5.1;lua52 - globals of Lua 5.2;lua52c - globals of Lua 5.2 compiled with LUA_COMPAT_ALL;lua53 - globals of Lua 5.3;lua53c - globals of Lua 5.3 compiled with LUA_COMPAT_5_2;luajit - globals of LuaJIT 2.0;min - intersection of globals of Lua 5.1, Lua 5.2 and LuaJIT 2.0;max - union of globals of Lua 5.1, Lua 5.2 and LuaJIT 2.0;none - no standard globals.DEPRECATED: use std in a .luacheckrc file instead.
globalsType: Array of Strings
Default: []
Add custom globals on top of standard ones.
DEPRECATED: use globals in a .luacheckrc file instead.
readGlobalsType: Array of Strings
Default: []
Add custom read-only globals on top of standard ones.
DEPRECATED: use read_globals in a .luacheckrc file instead.
newGlobalsType: Array of Strings
Default: []
Set custom globals. Removes custom globals added previously.
DEPRECATED: use new_globals in a .luacheckrc file instead.
newReadGlobalsType: Array of Strings
Default: []
Set read-only globals. Removes read-only globals added previously.
DEPRECATED: use new_read_globals in a .luacheckrc file instead.
compatType: Boolean
Default: false
Equivalent to {"std": "max"}.
DEPRECATED: use std = "max" or compat in a .luacheckrc file instead.
allowDefinedType: Boolean
Default: false
Allow defining globals implicitly by setting them. See Implicitly defined globals
DEPRECATED: use allow_defined in a .luacheckrc file instead.
allowDefinedTopType: Boolean
Default: false
Allow defining globals implicitly by setting them in the top level scope. See Implicitly defined globals
DEPRECATED: use allow_defined_top in a .luacheckrc file instead.
moduleType: Boolean
Default: false
Limit visibility of implicitly defined globals to their files. See Modules
DEPRECATED: use module in a .luacheckrc file instead.
ignoreType: Array of Strings
Default: []
Filter out warnings matching patterns. See Patterns
DEPRECATED: use ignore in a .luacheckrc file instead.
enableType: Array of Strings
Default: []
Do not filter out warnings matching patterns. See Patterns
DEPRECATED: use enable in a .luacheckrc file instead.
onlyType: Array of Strings
Default: []
Filter out warnings not matching patterns. See Patterns
DEPRECATED: use only in a .luacheckrc file instead.
noInlineType: Boolean
Default: false
Disable inline options.
DEPRECATED: use inline in a .luacheckrc file instead.
configType: String
Default: undefined
Path to custom config file
(default: .luacheckrc).
noConfigType: Boolean
Default: false
Flag indicating whether config loading should be disabled or not. Pass in
true to disable config loading.
DEPRECATED: You should always use a .luacheckrc file instead of passing
options via the CLI.
cacheType: String
Default: undefined
Path to cache file. (default: .luacheckcache).
See Caching
noCacheType: Boolean
Default: true
Do not use cache. Defaults to true in order to work without LuaFileSystem.
See Caching
jobsType: Integer (Strictly Positive)
Default: 1
Check jobs files in parallel. Requires LuaLanes. Defaults to 1 in order
to work without it.
Q: Help, I'm getting a The input line is too long error message on Windows.
A: This is a known issue on all versions of Windows. Switch to using config files and it's highly unlikely that you'll hit the limit again.
Since this is a thin wrapper on top of luacheck, we don't consider bugs
unless running luacheck with identical options produces different results.
Everything else should be reported directly to luacheck
node-luacheck is licensed under the MIT license.
FAQs
luacheck bindings for Node.JS
We found that luacheck demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.