Skip to content

ntnyq/prefer-newline-after-file-header

Require a newline after file header.

  • 💼 This rule is enabled in the ✅ recommended config.

  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule reports when no newline after file-header.

ts
/**
 * @file eslint config
 */

export const foobar = 'foobar'
correct
ts
// @file eslint config
export const foobar = 'foobar'
correct
ts
/**
 * @file eslint config
 */
correct
ts
/**
 * @file eslint config
 */
incorrect

🔧 Options

ts
export type Options = [
  {
    tags?: string[]
  },
]

Default to:

json
{
  "tags": [
    "@author",
    "@category",
    "@copyright",
    "@date",
    "@file",
    "@fileoverview",
    "@license",
    "@module",
    "@overview"
  ]
}

🚀 Version

This rule was introduced in eslint-plugin-ntnyq v0.9.0

🔍 Implementation