Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to automatically add date #27

Open
Franziskus1988 opened this issue Jun 17, 2020 · 2 comments
Open

Add possibility to automatically add date #27

Franziskus1988 opened this issue Jun 17, 2020 · 2 comments

Comments

@Franziskus1988
Copy link

It would be really nice, if it would be possible to automatically add e.g. current year instead of using hard coded values.

In VSCode there is the possibility to use e.g. $CURRENT_YEAR in the snippets.

@hubgit
Copy link

hubgit commented Oct 12, 2020

You can do this with a template and a variable:

// eslintrc.js

const year = new Date().getFullYear()

module.exports = () => {
  "rules": {
        "header/header": [2, "block", [
            {"pattern": " Copyright \\d{4}", "template": ` Copyright ${year}`}, 
            "My Company"
        ]]
    }
}

@robross0606
Copy link

An ideal way to get the information needed for a proper copyright statement would be to analyze git history for the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants