Skip to content

Use placeholder in "template" to set current year #38

@bennycode

Description

@bennycode

First of all: I love your plugin! It saved me from the cumbersome task of adding a license header to all code that I write during business hours. 🙇

In my config I am using the "template" functionality and I was wondering if it is possible to add placeholders to it so that the current year can be used?

Example:

  "header/header": [
      "error",
      "block",
      [
        {
          "pattern": "Copyright",
          "template": "\r\n * Title\r\n * Copyright ({{ currentYear }}) 2021 Company\r\n"
        }
      ],
      2
    ]

To build this feature a templating engine like "Nunjucks" could be used: https://mozilla.github.io/nunjucks/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions