This is an example Vue file.
``` After applying the fix: ```vueThis is an example Vue file.
``` Since the `vue-eslint-parser` package strives to maintain compatibility with rules targeting JavaScript, it exposes Vue AST tokens to rules in different ways than the default ESlint parser. The means of exposing HTML Comment nodes are of specific interest to this plugin, and the mechanism to access these are substantially different than how a plugin would typically read a comment node, making it necessary to both specify this particular parser as well as setting the flag. ### Options | Name | Type | Required | Default | Description | | ---------------- | ----------------------------------------------------------------- | ----------------------- | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | source | `"file" \| "string"` | Yes | | Indicates how the header content is supplied. | | style | `"line" \| "jsdoc"` | No | `"jsdoc"` | Indicates the comment style to enforce. A leading line-style comment block will only include adjacent line comments, although a line comment's content may be empty. No effect if `enableVueSupport: true`. | | content | string | When `source: "string"` | | The string to enforce in the header comment. | | path | string | When `source: "file"` | | The path to a file containing the header content to enforce. | | preservePragmas | boolean | No | `true` | Preserves existing pragma expressions in leading comments when updating header. No effect when `style: "line"`. | | blockPrefix | string | No | [See below](#default-prefixes-and-suffixes) | Content at the start of the leading comment block. | | blockSuffix | string | No | [See below](#default-prefixes-and-suffixes) | Content at the end of the leading comment block. | | linePrefix | string | No | [See below](#default-prefixes-and-suffixes) | Content prepended to the start of each line of content. | | trailingNewlines | number | No | | Number of empty lines to enforce after the leading comment. | | variables | object | No | | The keys to find and values to fill when formatting the provided header. Values must be strings. | | patterns | `{ [key: string] : { pattern: string; defaultValue?: string; } }` | No | | The keys to find and Regex patterns to validate when matching the provided header. **WARNING!** Default values must be provided for errors to be `--fix`able. | | enableVueSupport | boolean | No | `false` | **EXPERIMENTAL!** Enable support for parsing `.vue` files. Must be used with `vue-eslint-parser`. [See above](#usage-with-vue) for details. | #### Default Prefixes and Suffixes Example configuration: ```js export default [ { // ... rules: { "headers/header-format": [ "error", { source: "string", content: "This is a header.", // ...{Additional Configuration} }, ], }, }, ]; ``` The subsequent section titles contain the additional configuration inserted above, and the resulting comment that will be produced. ##### style: "line" Expected/produced header: ```js // This is a header. ``` - Default block prefix: None - Default block suffix: None - Default line prefix: `" "` ##### style: "jsdoc" Expected/produced header: ```js /** * This is a header. */ ``` - Default block prefix: `"*\n"` - Default block suffix: `"\n "` - Default line prefix: `" * "` ##### enableVueSupport: true Expected/produced header: ```vue ``` - Default block prefix: `"\n"` - Default block suffix: `"\n"` - Default line prefix: `" "` ## When Not To Use It Do not use this rule if you have no use for enforcing leading text content in a file header.