Esc

exit_in_module

Finds a module ends the process.

Category restriction, allow by default.

Off by default; the example is shown with the rule enabled.

Example
#import "Basic";

open_config :: (path: string) -> int {
    if path.count == 0 {
        exit(1);
    }

    return path.count;
}
Diagnostic
warning[exit_in_module]: a module should not end the process
  --> example.jai:5:9
   |
 5 |         exit(1);
   |         ^^^^^^^
   |
   = help: return an error and let the program decide whether to exit
Fixed
#import "Basic";

open_config :: (path: string) -> int, bool {
    if path.count == 0 return 0, false;

    return path.count, true;
}

A file belongs to a module when it or a directory above it holds a module.jai, with no tests or test folder in between (those hold programs that use the module).