Consistency

max-component-lines

Flag single-file components exceeding a configurable line count.

Warns when a component file grows beyond the configured line ceiling. Long components are the asymptote of AI iterative editing — easier to ask the agent to add than to extract — and the rule keeps the codebase decomposable.

Behavior

  • Fixable: No.
  • Suggestions: No.

Options

["warn", {
  "maxLines": 300,
  "ignoreComments": false,
  "ignoreBlankLines": false
}]

Examples

Bad:

// 600-line single-file component

Good:

// Decomposed into focused sub-components

Related rules

Use it

Enable max-component-lines in your eslint.config.js:

import deslint from '@deslint/eslint-plugin';

export default [
  {
    plugins: { deslint },
    rules: {
      'deslint/max-component-lines': 'error',
    },
  },
];

Found a false positive? Report it on GitHub →

Back to all rules