-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Type checking | ||
|
||
|
||
1. Download and install [Luau language server](https://marketplace.visualstudio.com/items?itemName=JohnnyMorganz.luau-lsp) for VS Code. | ||
2. Open `data` folder in VS Code. | ||
3. Create VS Code workspace settings (`data/.vscode/settings.json`). | ||
4. Put following json there: | ||
```js | ||
{ | ||
"luau-lsp.types.definitionFiles": ["scripts/lumix.d.lua"], | ||
} | ||
``` | ||
5. Create `.luaurc` in `data\scripts\` and put following json there: | ||
```js | ||
{ | ||
"languageMode": "nonstrict", | ||
"lint": { "*": true, "FunctionUnused": false }, | ||
"lintErrors": true, | ||
"globals": ["expect"] | ||
} | ||
``` | ||
6. Typechecking should now work, you can test with following script: | ||
```lua | ||
function onInputEvent(event : InputEvent) | ||
return event.some_prop | ||
end | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters