Rule: max-classes-per-file

A file may not contain more than the specified number of classes


Ensures that files have a single responsibility so that that classes each exist in their own files


The one required argument is an integer indicating the maximum number of classes that can appear in a file. An optional argument "exclude-class-expressions" can be provided to exclude class expressions from the overall class count.

Config examples
"max-classes-per-file": [true, 1]
"max-classes-per-file": [true, 5, "exclude-class-expressions"]
  "type": "array",
  "items": [
      "type": "number",
      "minimum": 1
      "type": "string",
      "enum": [
  "additionalItems": false,
  "minLength": 1,
  "maxLength": 2