The Luau Mode Setter extension for Visual Studio Code allows you to easily toggle different mode directives in .luau files used in Roblox development. You are recommended to read the motivation section first.
Features and How To Use
The plugin auto activates when .luau file is found in the workspace. This will also deactivate if no all .luau files deleted.
In .luau, there are Type inference modes, three of them are "nocheck", "nonstrict", "strict". You can refer to them through this link: https://luau.org/typecheck
Below, I quoted from the original site (14 Nov 2024)
There are three modes currently available. They must be annotated on the top few lines among the comments.
--!nocheck,
--!nonstrict (default), and
--!strict
nocheck mode will simply not start the type inference engine whatsoever.
In modern Roblox, Luau practice, we code on VScode, Then sync the code to Roblox Editor through rojo
When coding, most of the time the project use a mix of .luau and .lua file (mostly from third party library). These large .lua files often cause unwanted error/warning for the Luau LSP (e.g JohnnyMorganz.luau-lsp).
Thus, this extension helps developers to mass-update strict mode on these files (and all .luau script)
This also brings more quality-of-life features to the development and ease a bit of pain when coding in .luau
Known Issues
The extension will be activated automatically when .luau file existed in workspace. This also disabled automatically if no .luau files found (e.g when you delete all .luau file from the project)
However, after you delete all files, the extension cannot re-activated. You must restart vscode to activate it again.