🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-header

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-header

ESLint plugin to ensure that files begin with given comment

0.0.1
Source
npm
Version published
Weekly downloads
459K
1.29%
Maintainers
1
Weekly downloads
 
Created

What is eslint-plugin-header?

The eslint-plugin-header package is an ESLint plugin that allows you to enforce consistent header comments in your JavaScript files. This can be useful for ensuring that all files in a project contain specific licensing information, author details, or any other required header content.

What are eslint-plugin-header's main functionalities?

Enforce Header Comments

This feature allows you to enforce a specific header comment at the top of your JavaScript files. The configuration specifies the type of comment (block in this case) and the content of the header.

module.exports = {
  "plugins": ["header"],
  "rules": {
    "header/header": [2, "block", [
      "*",
      " This is a header comment",
      " Author: Your Name",
      " License: MIT",
      "*/"
    ]]
  }
};

Customizable Header Content

You can customize the content of the header to include project-specific information such as the project name, author, and date. This ensures that all files have consistent and up-to-date header information.

module.exports = {
  "plugins": ["header"],
  "rules": {
    "header/header": [2, "block", [
      "*",
      " Project: My Project",
      " Author: Your Name",
      " Date: 2023-10-01",
      "*/"
    ]]
  }
};

Support for Different Comment Styles

The plugin supports different styles of comments, such as line comments. This allows you to choose the comment style that best fits your project's coding standards.

module.exports = {
  "plugins": ["header"],
  "rules": {
    "header/header": [2, "line", [
      "// This is a header comment",
      "// Author: Your Name",
      "// License: MIT"
    ]]
  }
};

Other packages similar to eslint-plugin-header

Keywords

eslint

FAQs

Package last updated on 07 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts