Skip to content

vue/max-lines-per-block

enforce maximum number of lines in Vue SFC blocks

📖 Rule Details

This rule enforces a maximum number of lines per block, in order to aid in maintainability and reduce complexity.

🔧 Options

This rule takes an object, where you can specify the maximum number of lines in each type of SFC block and customize the line counting behavior. The following properties can be specified for the object.

  • script ... Specify the maximum number of lines in <script> block. Won't enforce limitation if not specified.
  • template ... Specify the maximum number of lines in <template> block. Won't enforce limitation if not specified.
  • style ... Specify the maximum number of lines in <style> block. Won't enforce limitation if not specified.
  • skipBlankLines ... Ignore lines made up purely of whitespaces.

{ template: 2 }

Now loading...

{ script: 1, skipBlankLines: true }

Now loading...

🚀 Version

This rule was introduced in eslint-plugin-vue v9.15.0

🔍 Implementation