A little utility tool to lint common performance issues in FiveM or RedM scripts
The package you download from npm/yarn is the CLI build.
- Clone this repository
- Inside that folder run
yarn
- After you installad all the dependencies, run
yarn build-fivem
- Start the resource using
start fxlinter
fxLinter exposes a server event (fxLinter:lint
), to lint any folder.
Args:
path: string
The folder to lint
ignores: string, string
Folders, files, names to ignore (such as node_modules, .git etc)
callback: an array containing all the linting results.
Array strucutre:
[{
rule: string, // the rule name
line: number, // the line number
lineTxt: string, // the line itself
file: string, // the file path
level: "warn" | "error" | "off" // severity of the issue
}, /* more results here*/]
To get a humanly readalbe text for the errors, you can use the `fxLinter:getLocale` event (server)
Args:
rule: `string` the rule name
locale: `string` the locale code (default is `en`) WIP callback: the locale string