Configuration
ForgetzLint works without a configuration file and provides default rules out of the box.
If you need to customize the rules, you can create a forgetzlint.config.mjs file in the root directory of your project.
Basic Configuration
Section titled “Basic Configuration”Create a forgetzlint.config.mjs file:
export default { rules: { "no-console": "warning", "no-debugger": "error", "no-any": "off" }};The configuration file allows you to change the severity of each rule.
Configuration File
Section titled “Configuration File”The configuration file should be placed in your project root:
my-project/├── src/├── package.json├── forgetzlint.config.mjs└── ...ForgetzLint automatically uses the configuration when running from the project root.
Rule Severity
Section titled “Rule Severity”Each rule can have one of three severity levels:
| Severity | Description |
|---|---|
error |
Reports the issue as an error |
warning |
Reports the issue as a warning |
off |
Disables the rule |
For example:
export default { rules: { "no-console": "warning", "no-debugger": "off", "no-any": "error" }};Default Configuration
Section titled “Default Configuration”If no configuration file is provided, ForgetzLint uses the following default rules:
{ "no-console": "error", "no-debugger": "error", "no-any": "error"}This means all three rules are enabled as errors by default.
Disabling Rules
Section titled “Disabling Rules”You can disable a rule by setting its severity to off.
export default { rules: { "no-console": "off", "no-debugger": "error", "no-any": "off" }};In this example, no-console and no-any are disabled while no-debugger remains enabled.
Configuration Options
Section titled “Configuration Options”ForgetzLint currently supports the following rules:
| Option | Type | Description |
|---|---|---|
no-console |
string |
Detects the use of console statements |
no-debugger |
string |
Detects debugger statements |
no-any |
string |
Detects explicit any types |
Each option accepts error, warning, or off.
Next Steps
Section titled “Next Steps”Continue to the Rules guide to learn more about the rules available in ForgetzLint.