max-classes-per-file
Added in v0.8.1Configuration
rslint.config.ts
Rule Details
This rule enforces that each file may contain only a particular number of classes and no more.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
This rule may be configured with either an object or a number.
If the option is an object, it may contain one or both of:
ignoreExpressions: a boolean option (defaulted tofalse) to ignore class expressions.max: a numeric option (defaulted to 1) to specify the maximum number of classes.
Examples of correct code for this rule with { "max-classes-per-file": ["error", 2] }:
Examples of correct code for this rule with { "max-classes-per-file": ["error", { "ignoreExpressions": true }] }: