diff --git a/docs/rules/README.md b/docs/rules/README.md index 397841d4e..b23b0535c 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -153,6 +153,7 @@ For example: | [vue/key-spacing](./key-spacing.md) | enforce consistent spacing between keys and values in object literal properties | :wrench: | | [vue/keyword-spacing](./keyword-spacing.md) | enforce consistent spacing before and after keywords | :wrench: | | [vue/match-component-file-name](./match-component-file-name.md) | require component name property to match its file name | | +| [vue/max-len](./max-len.md) | enforce a maximum line length | | | [vue/no-boolean-default](./no-boolean-default.md) | disallow boolean defaults | :wrench: | | [vue/no-deprecated-scope-attribute](./no-deprecated-scope-attribute.md) | disallow deprecated `scope` attribute (in Vue.js 2.5.0+) | :wrench: | | [vue/no-deprecated-slot-attribute](./no-deprecated-slot-attribute.md) | disallow deprecated `slot` attribute (in Vue.js 2.6.0+) | :wrench: | diff --git a/docs/rules/max-len.md b/docs/rules/max-len.md new file mode 100644 index 000000000..4dc5ba8d5 --- /dev/null +++ b/docs/rules/max-len.md @@ -0,0 +1,329 @@ +--- +pageClass: rule-details +sidebarDepth: 0 +title: vue/max-len +description: enforce a maximum line length +--- +# vue/max-len +> enforce a maximum line length + +## :book: 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`. + + + +```vue + + + + + +``` + + + +## :wrench: 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. default `80` +- `template` ... enforces a maximum line length for `