Skip to content

yml/max-len ​

enforce a maximum line length

📖 Rule Details ​

This rule enforces a maximum line length in YAML files.

Now loading...

🔧 Options ​

yaml
yml/max-len:
  - error
  - code: 80
    tabWidth: 4
    comments: 80
    ignorePattern: ""
    ignoreComments: false
    ignoreTrailingComments: false
    ignoreUrls: false
    ignoreStrings: false
  • code ... The maximum line length. Default is 80.
  • tabWidth ... The character width used for tab characters. Default is 4.
  • comments ... The maximum line length for lines that contain only a comment. If omitted, comment lines use code.
  • ignorePattern ... Ignores lines that match this regular expression.
  • ignoreComments ... Ignores all comment lines and trailing comments. Default is false.
  • ignoreTrailingComments ... Ignores only trailing comments. The rest of the line is still measured. Default is false.
  • ignoreUrls ... Ignores lines that contain a URL. Default is false.
  • ignoreStrings ... Ignores lines that contain a double-quoted or single-quoted scalar. Plain scalars and block scalars (|, >) are still checked. Default is false.

These options work like the @stylistic/max-len options with the same names. See here for details. The JavaScript-specific options ignoreTemplateLiterals and ignoreRegExpLiterals are not supported, and the options must be given as an object.

{ ignoreStrings: true } ​

Now loading...

🚀 Version ​

This rule was introduced in eslint-plugin-yml v3.10.0

🔍 Implementation ​

Taken with ❤️ from ESLint core