strict

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StrictRule = rule.Rule{
	Name: "strict",
	Run: func(ctx rule.RuleContext, options any) rule.RuleListeners {
		optStr := utils.GetOptionsString(options)
		if optStr == "" {
			optStr = "safe"
		}

		var m strictMode
		switch optStr {
		case "never":
			m = modeNever
		case "global":
			m = modeGlobal
		case "function":
			m = modeFunction
		case "safe":

			m = modeFunction
		default:
			m = modeFunction
		}

		if ast.IsExternalModule(ctx.SourceFile) {
			m = modeModule
		}

		handleProgram(ctx, m)

		if m == modeFunction {
			return buildFunctionModeListeners(ctx)
		}
		return buildSimpleListeners(ctx, m)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL