Skip to content
This repository was archived by the owner on May 10, 2026. It is now read-only.
This repository was archived by the owner on May 10, 2026. It is now read-only.

[core] Per-rule configuration in .krolik.json #39

@anatolykoptev

Description

@anatolykoptev

Description

Allow enabling/disabling rules and changing severity per-project via configuration.

Example Config

{
  "rules": {
    "any-type": "off",
    "console-log": "warn",
    "complexity": { 
      "severity": "error", 
      "maxComplexity": 15 
    },
    "ts-ignore": {
      "severity": "error",
      "allowWithDescription": true
    }
  }
}

Config Resolution

  1. Default rule config (built-in)
  2. .krolik.json in project root
  3. CLI flags (highest priority)

Tasks

  • Define JSON schema for rules config
  • Add rules section parsing in config loader
  • Implement rule filtering by config
  • Support severity override per rule
  • Support rule-specific options
  • Add config validation with helpful errors

Schema

interface RulesConfig {
  [ruleId: string]: 
    | 'off' | 'warn' | 'error'  // Simple
    | {                          // Detailed
        severity: 'off' | 'warn' | 'error';
        [option: string]: unknown;
      }
}

Acceptance Criteria

  • Rules can be disabled with "rule": "off"
  • Severity can be overridden
  • Rule-specific options work
  • Invalid config shows helpful error
  • Documentation for all rule options

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions