{"_id":"eslint-plugin-header","_rev":"2942740","name":"eslint-plugin-header","description":"ESLint plugin to ensure that files begin with given comment","dist-tags":{"latest":"3.1.1"},"maintainers":[{"name":"stuk","email":""}],"time":{"modified":"2023-04-21T09:34:50.000Z","created":"2015-08-07T02:19:02.519Z","3.1.1":"2021-02-03T05:05:25.148Z","3.1.0":"2020-08-31T00:18:56.275Z","3.0.0":"2019-02-04T07:16:56.891Z","2.0.0":"2018-08-29T15:58:53.143Z","1.2.0":"2017-09-13T03:42:00.181Z","1.1.0":"2017-08-25T17:49:39.766Z","1.0.0":"2017-02-21T00:36:58.075Z","0.1.0":"2015-09-10T14:54:01.789Z","0.0.2":"2015-08-07T02:36:37.267Z","0.0.1":"2015-08-07T02:19:02.519Z"},"users":{},"author":{"name":"Stuart Knightley"},"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"versions":{"3.1.1":{"name":"eslint-plugin-header","version":"3.1.1","description":"ESLint plugin to ensure that files begin with given comment","main":"index.js","scripts":{"test":"npm run lint && npm run unit","unit":"mocha tests/lib/*.js tests/lib/**/*.js","lint":"eslint ."},"devDependencies":{"eslint":"^7.7.0","mocha":"^8.1.1"},"peerDependencies":{"eslint":">=7.7.0"},"keywords":["eslint","eslintplugin"],"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"author":{"name":"Stuart Knightley"},"license":"MIT","gitHead":"d1e2575f6e6d12b2fdc167c07885242082cc944f","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","_id":"eslint-plugin-header@3.1.1","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"shasum":"6ce512432d57675265fac47292b50d1eff11acd6","size":6889,"noattachment":false,"key":"/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-header/download/eslint-plugin-header-3.1.1.tgz"},"_npmUser":{"name":"stuk","email":"npm@website.stuartk.com"},"directories":{},"maintainers":[{"name":"stuk","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-header_3.1.1_1612328725006_0.02177489170868485"},"_hasShrinkwrap":false,"publish_time":1612328725148,"_cnpm_publish_time":1612328725148,"_cnpmcore_publish_time":"2021-12-16T17:48:05.792Z"},"3.1.0":{"name":"eslint-plugin-header","version":"3.1.0","description":"ESLint plugin to ensure that files begin with given comment","main":"index.js","scripts":{"test":"npm run lint && npm run unit","unit":"mocha tests/lib/*.js tests/lib/**/*.js","lint":"eslint ."},"devDependencies":{"eslint":"^7.7.0","mocha":"^8.1.1"},"peerDependencies":{"eslint":">=7.7.0"},"keywords":["eslint","eslintplugin"],"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"author":{"name":"Stuart Knightley"},"license":"MIT","gitHead":"d09923d9ccb40da28c85fe79064422238544d864","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","_id":"eslint-plugin-header@3.1.0","_nodeVersion":"14.9.0","_npmVersion":"6.14.7","dist":{"shasum":"5e6819489a7722ae0c5c237387f78350d755c1d5","size":6843,"noattachment":false,"key":"/eslint-plugin-header/-/eslint-plugin-header-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-header/download/eslint-plugin-header-3.1.0.tgz"},"maintainers":[{"name":"stuk","email":""}],"_npmUser":{"name":"stuk","email":"npm@website.stuartk.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-header_3.1.0_1598833136176_0.6007768194121756"},"_hasShrinkwrap":false,"publish_time":1598833136275,"_cnpm_publish_time":1598833136275,"_cnpmcore_publish_time":"2021-12-16T17:48:06.051Z"},"3.0.0":{"name":"eslint-plugin-header","version":"3.0.0","description":"ESLint plugin to ensure that files begin with given comment","main":"index.js","scripts":{"test":"npm run lint && npm run unit","unit":"mocha tests/lib/*.js tests/lib/**/*.js","lint":"eslint ."},"devDependencies":{"eslint":"^5.12.0","mocha":"^5.2.0"},"peerDependencies":{"eslint":">=0.18.0"},"keywords":["eslint","eslintplugin"],"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"author":{"name":"Stuart Knightley"},"license":"MIT","gitHead":"e840ff6ef58d8cf469e464a39526f7957f0a3607","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","_id":"eslint-plugin-header@3.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.4","_npmUser":{"name":"stuk","email":"npm@website.stuartk.com"},"dist":{"shasum":"0e048b5f0adfdd9754142d59d551ae6bfdaf90ad","size":6575,"noattachment":false,"key":"/eslint-plugin-header/-/eslint-plugin-header-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-header/download/eslint-plugin-header-3.0.0.tgz"},"maintainers":[{"name":"stuk","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-header_3.0.0_1549264616792_0.8249308028569058"},"_hasShrinkwrap":false,"publish_time":1549264616891,"_cnpm_publish_time":1549264616891,"_cnpmcore_publish_time":"2021-12-16T17:48:06.261Z"},"2.0.0":{"name":"eslint-plugin-header","version":"2.0.0","description":"ESLint plugin to ensure that files begin with given comment","main":"index.js","scripts":{"test":"npm run lint && npm run unit","unit":"mocha tests/lib/*.js tests/lib/**/*.js","lint":"eslint ."},"devDependencies":{"eslint":"^1.0.0","mocha":"^2.2.5"},"peerDependencies":{"eslint":">=0.18.0"},"keywords":["eslint","eslintplugin"],"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"author":{"name":"Stuart Knightley"},"license":"MIT","gitHead":"f9a0711269769c782c4b7bd65cee3452b1cd4270","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","_id":"eslint-plugin-header@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.3","_npmUser":{"name":"stuk","email":"npm@website.stuartk.com"},"dist":{"shasum":"c0f729f4e6669d8f63881977bb9dcafafdac2420","size":6124,"noattachment":false,"key":"/eslint-plugin-header/-/eslint-plugin-header-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-header/download/eslint-plugin-header-2.0.0.tgz"},"maintainers":[{"name":"stuk","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-header_2.0.0_1535558332920_0.9827763956344475"},"_hasShrinkwrap":false,"publish_time":1535558333143,"_cnpm_publish_time":1535558333143,"_cnpmcore_publish_time":"2021-12-16T17:48:06.469Z"},"1.2.0":{"name":"eslint-plugin-header","version":"1.2.0","description":"ESLint plugin to ensure that files begin with given comment","main":"index.js","scripts":{"test":"npm run lint && npm run unit","unit":"mocha tests/lib/*.js tests/lib/**/*.js","lint":"eslint ."},"devDependencies":{"eslint":"^1.0.0","mocha":"^2.2.5"},"peerDependencies":{"eslint":">=0.18.0"},"keywords":["eslint","eslintplugin"],"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"author":{"name":"Stuart Knightley"},"license":"MIT","gitHead":"80d5def18d39d25979712389714597a6f8064a9b","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","_id":"eslint-plugin-header@1.2.0","_shasum":"f704779c6fbc7c668f180d835de1f462b0467c37","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.3","_npmUser":{"name":"stuk","email":"stuart@stuartk.com"},"dist":{"shasum":"f704779c6fbc7c668f180d835de1f462b0467c37","size":5709,"noattachment":false,"key":"/eslint-plugin-header/-/eslint-plugin-header-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-header/download/eslint-plugin-header-1.2.0.tgz"},"maintainers":[{"name":"stuk","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-header-1.2.0.tgz_1505274120070_0.002591016935184598"},"directories":{},"publish_time":1505274120181,"_hasShrinkwrap":false,"_cnpm_publish_time":1505274120181,"_cnpmcore_publish_time":"2021-12-16T17:48:06.679Z"},"1.1.0":{"name":"eslint-plugin-header","version":"1.1.0","description":"ESLint plugin to ensure that files begin with given comment","main":"index.js","scripts":{"test":"mocha tests/lib/*.js tests/lib/**/*.js","lint":"eslint ."},"devDependencies":{"eslint":"^1.0.0","mocha":"^2.2.5"},"peerDependencies":{"eslint":">=0.18.0"},"keywords":["eslint","eslintplugin"],"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"author":{"name":"Stuart Knightley"},"license":"MIT","gitHead":"19243337a06868772ec691d70da9f794bc21dc40","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","_id":"eslint-plugin-header@1.1.0","_shasum":"06ec2ddb8e1d51b07932a4c0557e3c49a993a1d4","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"stuk","email":"stuart@stuartk.com"},"dist":{"shasum":"06ec2ddb8e1d51b07932a4c0557e3c49a993a1d4","size":4437,"noattachment":false,"key":"/eslint-plugin-header/-/eslint-plugin-header-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-header/download/eslint-plugin-header-1.1.0.tgz"},"maintainers":[{"name":"stuk","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/eslint-plugin-header-1.1.0.tgz_1503683379695_0.1674358940217644"},"directories":{},"publish_time":1503683379766,"_hasShrinkwrap":false,"_cnpm_publish_time":1503683379766,"_cnpmcore_publish_time":"2021-12-16T17:48:06.881Z"},"1.0.0":{"name":"eslint-plugin-header","version":"1.0.0","description":"ESLint plugin to ensure that files begin with given comment","main":"index.js","scripts":{"test":"mocha tests/lib/*.js tests/lib/**/*.js","lint":"eslint ."},"devDependencies":{"eslint":"^1.0.0","mocha":"^2.2.5"},"peerDependencies":{"eslint":">=0.18.0"},"keywords":["eslint","eslintplugin"],"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"author":{"name":"Stuart Knightley"},"license":"MIT","gitHead":"b80905c22f92d202626fc2f90440be624939d15a","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","_id":"eslint-plugin-header@1.0.0","_shasum":"3990ec8be67e30694fcbee672c5f8a5ae4c80cf8","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"stuk","email":"stuart@stuartk.com"},"dist":{"shasum":"3990ec8be67e30694fcbee672c5f8a5ae4c80cf8","size":4949,"noattachment":false,"key":"/eslint-plugin-header/-/eslint-plugin-header-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-header/download/eslint-plugin-header-1.0.0.tgz"},"maintainers":[{"name":"stuk","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/eslint-plugin-header-1.0.0.tgz_1487637417859_0.8986519337631762"},"directories":{},"publish_time":1487637418075,"_hasShrinkwrap":false,"_cnpm_publish_time":1487637418075,"_cnpmcore_publish_time":"2021-12-16T17:48:07.086Z"},"0.1.0":{"name":"eslint-plugin-header","version":"0.1.0","description":"ESLint plugin to ensure that files begin with given comment","main":"index.js","scripts":{"test":"mocha tests/lib/*.js tests/lib/**/*.js","lint":"eslint ."},"devDependencies":{"eslint":"^1.0.0","mocha":"^2.2.5"},"peerDependencies":{"eslint":">=0.18.0"},"keywords":["eslint","eslintplugin"],"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"author":{"name":"Stuart Knightley"},"license":"MIT","gitHead":"70e13d264785445c4c54819b68b260f1f89988dd","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","_id":"eslint-plugin-header@0.1.0","_shasum":"bfa0b905e1951035ef51155709f9ad7c535b0bc6","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"stuk","email":"stuart@stuartk.com"},"dist":{"shasum":"bfa0b905e1951035ef51155709f9ad7c535b0bc6","size":4370,"noattachment":false,"key":"/eslint-plugin-header/-/eslint-plugin-header-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-header/download/eslint-plugin-header-0.1.0.tgz"},"maintainers":[{"name":"stuk","email":""}],"directories":{},"publish_time":1441896841789,"_hasShrinkwrap":false,"_cnpm_publish_time":1441896841789,"_cnpmcore_publish_time":"2021-12-16T17:48:07.294Z"},"0.0.2":{"name":"eslint-plugin-header","version":"0.0.2","description":"ESLint plugin to ensure that files begin with given comment","main":"index.js","scripts":{"test":"mocha tests/**/*.js","lint":"eslint ."},"devDependencies":{"eslint":"^1.0.0","mocha":"^2.2.5"},"peerDependencies":{"eslint":">=0.18.0"},"keywords":["eslint","eslintplugin"],"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"author":{"name":"Stuart Knightley"},"license":"MIT","gitHead":"4a6c4eac73bf8c65ee633f782a632e4dddb1b3a1","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","_id":"eslint-plugin-header@0.0.2","_shasum":"22976aa39da787249efa33c4dde683a46b3d9187","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.0.0","_npmUser":{"name":"stuk","email":"stuart@stuartk.com"},"dist":{"shasum":"22976aa39da787249efa33c4dde683a46b3d9187","size":3448,"noattachment":false,"key":"/eslint-plugin-header/-/eslint-plugin-header-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-header/download/eslint-plugin-header-0.0.2.tgz"},"maintainers":[{"name":"stuk","email":""}],"directories":{},"publish_time":1438914997267,"_hasShrinkwrap":false,"_cnpm_publish_time":1438914997267,"_cnpmcore_publish_time":"2021-12-16T17:48:07.530Z"},"0.0.1":{"name":"eslint-plugin-header","version":"0.0.1","description":"ESLint plugin to ensure that files begin with given comment","main":"index.js","scripts":{"test":"mocha tests/**/*.js","lint":"eslint ."},"devDependencies":{"eslint":"^1.0.0","mocha":"^2.2.5"},"peerDependencies":{"eslint":">=0.18.0"},"keywords":["eslint","eslintplugin"],"repository":{"type":"git","url":"git+https://github.com/Stuk/eslint-plugin-header.git"},"author":{"name":"Stuart Knightley"},"license":"MIT","gitHead":"4f58a1fc1402b419cfe9fc2cbe74da0fffbf521d","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","_id":"eslint-plugin-header@0.0.1","_shasum":"df885edc17646399c961060f11311601875be092","_from":".","_npmVersion":"2.13.3","_nodeVersion":"3.0.0","_npmUser":{"name":"stuk","email":"stuart@stuartk.com"},"dist":{"shasum":"df885edc17646399c961060f11311601875be092","size":3094,"noattachment":false,"key":"/eslint-plugin-header/-/eslint-plugin-header-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/eslint-plugin-header/download/eslint-plugin-header-0.0.1.tgz"},"maintainers":[{"name":"stuk","email":""}],"directories":{},"publish_time":1438913942519,"_hasShrinkwrap":false,"_cnpm_publish_time":1438913942519,"_cnpmcore_publish_time":"2021-12-16T17:48:07.719Z"}},"readme":"eslint-plugin-header\n====================\n\nESLint plugin to ensure that files begin with given comment.\n\nOften you will want to have a copyright notice at the top of every file. This ESLint plugin checks that the first comment in every file has the contents defined in the rule settings.\n\n## Usage\n\nThis rule takes 1, 2 or 3 arguments with an optional settings object.\n\n### 1 argument\n\nIn the 1 argument form the argument is the filename of a file that contains the comment(s) that should appear at the top of every file:\n\n```json\n{\n    \"plugins\": [\n        \"header\"\n    ],\n    \"rules\": {\n        \"header/header\": [2, \"config/header.js\"]\n    }\n}\n```\n\nconfig/header.js:\n\n```js\n// Copyright 2015\n// My company\n```\n\nDue to limitations in eslint plugins, the file is read relative to the working directory that eslint is executed in. If you run eslint from elsewhere in your tree then the header file will not be found.\n\n### 2 arguments\n\nIn the 2 argument form the first must be either `\"block\"` or `\"line\"` to indicate what style of comment should be used. The second is either a string (including newlines) of the comment, or an array of each line of the comment.\n\n```json\n{\n    \"plugins\": [\n        \"header\"\n    ],\n    \"rules\": {\n        \"header/header\": [2, \"block\", \"Copyright 2015\\nMy Company\"]\n    }\n}\n```\n\n### 3 arguments\n\nThe optional third argument which defaults to 1 specifies the number of newlines that are enforced after the header.\n\nZero newlines:\n```json\n{\n    \"plugins\": [\n        \"header\"\n    ],\n    \"rules\": {\n        \"header/header\": [2, \"block\", [\" Copyright now\",\"My Company \"], 0]\n    }\n}\n```\n```js\n/* Copyright now\nMy Company */ console.log(1)\n```\n\nOne newline (default)\n```json\n{\n    \"plugins\": [\n        \"header\"\n    ],\n    \"rules\": {\n        \"header/header\": [2, \"block\", [\" Copyright now\",\"My Company \"], 1]\n    }\n}\n```\n```js\n/* Copyright now\nMy Company */\nconsole.log(1)\n```\n\ntwo newlines\n```json\n{\n    \"plugins\": [\n        \"header\"\n    ],\n    \"rules\": {\n        \"header/header\": [2, \"block\", [\" Copyright now\",\"My Company \"], 2]\n    }\n}\n```\n```js\n/* Copyright now\nMy Company */\n\nconsole.log(1)\n```\n\n#### Regular expressions\n\nInstead of a string to be checked for exact matching you can also supply a regular expression. Be aware that you have to escape backslashes:\n\n```json\n{\n    \"plugins\": [\n        \"header\"\n    ],\n    \"rules\": {\n        \"header/header\": [2, \"block\", [\n            {\"pattern\": \" Copyright \\\\d{4}\"},\n            \"My Company\"\n        ]]\n    }\n}\n```\n\nThis would match:\n\n```js\n/* Copyright 2808\nMy Company*/\n```\n\nWhen you use a regular expression `pattern`, you can also provide a `template` property, to provide the comment value when using `eslint --fix`:\n\n```json\n{\n    \"plugins\": [\n        \"header\"\n    ],\n    \"rules\": {\n        \"header/header\": [2, \"block\", [\n            {\"pattern\": \" Copyright \\\\d{4}\", \"template\": \" Copyright 2019\"}, \n            \"My Company\"\n        ]]\n    }\n}\n```\n\n### Line Endings\n\nThe rule works with both unix and windows line endings. For ESLint `--fix`, the rule will use the line ending format of the current operating system (via the node `os` package). This setting can be overwritten as follows:\n```json\n\"rules\": {\n    \"header/header\": [2, \"block\", [\"Copyright 2018\", \"My Company\"], {\"lineEndings\": \"windows\"}]\n}\n```\nPossible values are `unix` for `\\n` and `windows` for `\\r\\n` line endings.\n\n## Examples\n\nThe following examples are all valid.\n\n`\"block\", \"Copyright 2015, My Company\"`:\n\n```js\n/*Copyright 2015, My Company*/\nconsole.log(1);\n```\n\n`\"line\", [\"Copyright 2015\", \"My Company\"]]`:\n\n```js\n//Copyright 2015\n//My Company\nconsole.log(1)\n```\n\n`\"line\", [{pattern: \"^Copyright \\\\d{4}$\"}, {pattern: \"^My Company$\"}]]`:\n\n```js\n//Copyright 2017\n//My Company\nconsole.log(1)\n```\n\n### With more decoration\n\n```json\n\"header/header\": [2, \"block\", [\n    \"************************\",\n    \" * Copyright 2015\",\n    \" * My Company\",\n    \" ************************\"\n]\n```\n\n```js\n/*************************\n * Copyright 2015\n * My Company\n *************************/\n console.log(1);\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/Stuk/eslint-plugin-header#readme","bugs":{"url":"https://github.com/Stuk/eslint-plugin-header/issues"},"license":"MIT"}