@tony.ganchev/eslint-plugin-header 3.1.5 → 3.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/rules/header.js +3 -2
- package/package.json +2 -2
package/lib/rules/header.js
CHANGED
|
@@ -168,8 +168,9 @@ function genCommentsRange(context, comments, eol) {
|
|
|
168
168
|
*/
|
|
169
169
|
function genPrependFixer(commentType, node, headerLines, eol, numNewlines) {
|
|
170
170
|
return function(fixer) {
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
const insertPos = (node.comments.length && node.comments[0].type === "Shebang") ? node.comments[0].range[1] + eol.length : 0;
|
|
172
|
+
return fixer.insertTextBeforeRange(
|
|
173
|
+
[insertPos, 0 /* don't care */],
|
|
173
174
|
genCommentBody(commentType, headerLines, eol, numNewlines)
|
|
174
175
|
);
|
|
175
176
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tony.ganchev/eslint-plugin-header",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"description": "ESLint plugin to ensure files begin with a given comment, usually a copyright or license notice.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "npm run lint && npm run unit",
|
|
12
|
-
"unit": "nyc --reporter=html --reporter=text --reporter=text-summary mocha tests/lib/**/*.js",
|
|
12
|
+
"unit": "nyc --reporter=html --reporter=text --reporter=text-summary --check-coverage=true --statements=98 --branches=90 --lines=98 --functions=100 mocha tests/lib/**/*.js",
|
|
13
13
|
"lint": "eslint ."
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|