vue/max-len
enforce a maximum line length in
.vue
files
📖 Rule Details
This rule enforces a maximum line length to increase code readability and maintainability. This rule is the similar rule as core max-len rule but it applies to the source code in .vue
.
🔧 Options
js
{
"vue/max-len": ["error", {
"code": 80,
"template": 80,
"tabWidth": 2,
"comments": 80,
"ignorePattern": "",
"ignoreComments": false,
"ignoreTrailingComments": false,
"ignoreUrls": false,
"ignoreStrings": false,
"ignoreTemplateLiterals": false,
"ignoreRegExpLiterals": false,
"ignoreHTMLAttributeValues": false,
"ignoreHTMLTextContents": false,
}]
}
code
... enforces a maximum line length. default80
template
... enforces a maximum line length for<template>
. defaults to value ofcode
tabWidth
... specifies the character width for tab characters. default2
comments
... enforces a maximum line length for comments. defaults to value ofcode
ignorePattern
... ignores lines matching a regular expression. can only match a single line and need to be double escaped when written in YAML or JSONignoreComments
... iftrue
, ignores all trailing comments and comments on their own line. defaultfalse
ignoreTrailingComments
... iftrue
, ignores only trailing comments. defaultfalse
ignoreUrls
... iftrue
, ignores lines that contain a URL. defaultfalse
ignoreStrings
... iftrue
, ignores lines that contain a double-quoted or single-quoted string. defaultfalse
ignoreTemplateLiterals
... iftrue
, ignores lines that contain a template literal. defaultfalse
ignoreRegExpLiterals
... iftrue
, ignores lines that contain a RegExp literal. defaultfalse
ignoreHTMLAttributeValues
... iftrue
, ignores lines that contain a HTML attribute value. defaultfalse
ignoreHTMLTextContents
... iftrue
, ignores lines that contain a HTML text content. defaultfalse
"code": 40
"template": 120
"comments": 65
"ignoreComments": true
"ignoreTrailingComments": true
"ignoreUrls": true
"ignoreStrings": true
"ignoreTemplateLiterals": true
"ignoreRegExpLiterals": true
"ignoreHTMLAttributeValues": true
"ignoreHTMLTextContents": true
📚 Further Reading
🚀 Version
This rule was introduced in eslint-plugin-vue v6.1.0
🔍 Implementation
Taken with ❤️ from ESLint core