Rules Over Options
Each rule should have a single purpose. Make multiple rules work together to achieve more complex behaviors instead of adding options to a single rule.
Why?
- Rules are easier to maintain.
- Rules are easier to document.
- Rules are easier to test.
- Rules are easier to setup and use.
- Rules are easier to understand and reason about. (both for human and GitHub Copilot).
- Rules are easier to enforce (e.g. in CI or editor).
- Rules are easier to categorize (e.g. by type or severity).
- Rules are easier to enable/disable conditionally (e.g. in config's presets or based on file path or file extension).
- The behavior of rules is easier to understand, predict and debug.
- The behavior of rules is easier to modify without backward compatibility concerns. Options are harder to change once they are in use.
- The error messages of rules are easier to identify in codebase.
- The error messages of rules are easier to search for on the internet (e.g. StackOverflow).