@tony.ganchev/eslint-plugin-header 3.1.3 → 3.1.4
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/.github/workflows/npm-publish.yml +2 -2
- package/.github/workflows/test.yml +1 -1
- package/CHANGELOG.md +8 -0
- package/eslint.config.mjs +168 -0
- package/lib/rules/header.js +1 -1
- package/package.json +7 -4
- package/.eslintrc.yml +0 -94
|
@@ -14,7 +14,7 @@ jobs:
|
|
|
14
14
|
- uses: actions/checkout@v4
|
|
15
15
|
- uses: actions/setup-node@v4
|
|
16
16
|
with:
|
|
17
|
-
node-version:
|
|
17
|
+
node-version: 24
|
|
18
18
|
- run: npm ci
|
|
19
19
|
- run: npm test
|
|
20
20
|
|
|
@@ -25,7 +25,7 @@ jobs:
|
|
|
25
25
|
- uses: actions/checkout@v4
|
|
26
26
|
- uses: actions/setup-node@v4
|
|
27
27
|
with:
|
|
28
|
-
node-version:
|
|
28
|
+
node-version: 24
|
|
29
29
|
registry-url: https://registry.npmjs.org/
|
|
30
30
|
- run: npm ci
|
|
31
31
|
- run: npm publish
|
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import js from "@eslint/js";
|
|
6
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
7
|
+
import jsdoc from "eslint-plugin-jsdoc";
|
|
8
|
+
|
|
9
|
+
const filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const dirname = path.dirname(filename);
|
|
11
|
+
const compat = new FlatCompat({
|
|
12
|
+
baseDirectory: dirname,
|
|
13
|
+
recommendedConfig: js.configs.recommended,
|
|
14
|
+
allConfig: js.configs.all
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const jsRules = {
|
|
18
|
+
extends: [
|
|
19
|
+
...compat.extends("eslint:recommended"),
|
|
20
|
+
],
|
|
21
|
+
rules: {
|
|
22
|
+
indent: [2, 4, {
|
|
23
|
+
SwitchCase: 1,
|
|
24
|
+
}],
|
|
25
|
+
|
|
26
|
+
"brace-style": [2, "1tbs"],
|
|
27
|
+
|
|
28
|
+
camelcase: [2, {
|
|
29
|
+
properties: "never",
|
|
30
|
+
}],
|
|
31
|
+
|
|
32
|
+
"callback-return": [2, ["cb", "callback", "next"]],
|
|
33
|
+
"comma-spacing": 2,
|
|
34
|
+
"comma-style": [2, "last"],
|
|
35
|
+
"consistent-return": 2,
|
|
36
|
+
curly: [2, "all"],
|
|
37
|
+
"default-case": 2,
|
|
38
|
+
|
|
39
|
+
"dot-notation": [2, {
|
|
40
|
+
allowKeywords: true,
|
|
41
|
+
}],
|
|
42
|
+
|
|
43
|
+
"eol-last": 2,
|
|
44
|
+
eqeqeq: 2,
|
|
45
|
+
"func-style": [2, "declaration"],
|
|
46
|
+
"guard-for-in": 2,
|
|
47
|
+
|
|
48
|
+
"key-spacing": [2, {
|
|
49
|
+
beforeColon: false,
|
|
50
|
+
afterColon: true,
|
|
51
|
+
}],
|
|
52
|
+
|
|
53
|
+
"new-cap": 2,
|
|
54
|
+
"new-parens": 2,
|
|
55
|
+
"no-alert": 2,
|
|
56
|
+
"no-array-constructor": 2,
|
|
57
|
+
"no-caller": 2,
|
|
58
|
+
"no-console": 0,
|
|
59
|
+
"no-delete-var": 2,
|
|
60
|
+
"no-eval": 2,
|
|
61
|
+
"no-extend-native": 2,
|
|
62
|
+
"no-extra-bind": 2,
|
|
63
|
+
"no-fallthrough": 2,
|
|
64
|
+
"no-floating-decimal": 2,
|
|
65
|
+
"no-implied-eval": 2,
|
|
66
|
+
"no-invalid-this": 2,
|
|
67
|
+
"no-iterator": 2,
|
|
68
|
+
"no-label-var": 2,
|
|
69
|
+
"no-labels": 2,
|
|
70
|
+
"no-lone-blocks": 2,
|
|
71
|
+
"no-loop-func": 2,
|
|
72
|
+
"no-mixed-spaces-and-tabs": [2, false],
|
|
73
|
+
"no-multi-spaces": 2,
|
|
74
|
+
"no-multi-str": 2,
|
|
75
|
+
"no-native-reassign": 2,
|
|
76
|
+
"no-nested-ternary": 2,
|
|
77
|
+
"no-new": 2,
|
|
78
|
+
"no-new-func": 2,
|
|
79
|
+
"no-new-object": 2,
|
|
80
|
+
"no-new-wrappers": 2,
|
|
81
|
+
"no-octal": 2,
|
|
82
|
+
"no-octal-escape": 2,
|
|
83
|
+
"no-process-exit": 2,
|
|
84
|
+
"no-proto": 2,
|
|
85
|
+
"no-redeclare": 2,
|
|
86
|
+
"no-return-assign": 2,
|
|
87
|
+
"no-script-url": 2,
|
|
88
|
+
"no-sequences": 2,
|
|
89
|
+
"no-shadow": 2,
|
|
90
|
+
"no-shadow-restricted-names": 2,
|
|
91
|
+
"no-spaced-func": 2,
|
|
92
|
+
"no-trailing-spaces": 2,
|
|
93
|
+
"no-undef": 2,
|
|
94
|
+
"no-undef-init": 2,
|
|
95
|
+
"no-undefined": 2,
|
|
96
|
+
"no-underscore-dangle": 2,
|
|
97
|
+
"no-unused-expressions": 2,
|
|
98
|
+
|
|
99
|
+
"no-unused-vars": [2, {
|
|
100
|
+
vars: "all",
|
|
101
|
+
args: "after-used",
|
|
102
|
+
}],
|
|
103
|
+
|
|
104
|
+
"no-use-before-define": 2,
|
|
105
|
+
"no-with": 2,
|
|
106
|
+
quotes: [2, "double"],
|
|
107
|
+
radix: 2,
|
|
108
|
+
semi: 2,
|
|
109
|
+
|
|
110
|
+
"semi-spacing": [2, {
|
|
111
|
+
before: false,
|
|
112
|
+
after: true,
|
|
113
|
+
}],
|
|
114
|
+
|
|
115
|
+
"keyword-spacing": [2, {
|
|
116
|
+
after: true,
|
|
117
|
+
}],
|
|
118
|
+
|
|
119
|
+
"space-before-blocks": 2,
|
|
120
|
+
"space-before-function-paren": [2, "never"],
|
|
121
|
+
"space-infix-ops": 2,
|
|
122
|
+
|
|
123
|
+
"space-unary-ops": [2, {
|
|
124
|
+
words: true,
|
|
125
|
+
nonwords: false,
|
|
126
|
+
}],
|
|
127
|
+
|
|
128
|
+
"spaced-comment": [2, "always", {
|
|
129
|
+
exceptions: ["-"],
|
|
130
|
+
}],
|
|
131
|
+
|
|
132
|
+
strict: [2, "global"],
|
|
133
|
+
|
|
134
|
+
"wrap-iife": 2,
|
|
135
|
+
yoda: [2, "never"],
|
|
136
|
+
"no-catch-shadow": 0,
|
|
137
|
+
"no-mixed-requires": 2,
|
|
138
|
+
"no-new-require": 2,
|
|
139
|
+
"no-path-concat": 2,
|
|
140
|
+
"global-strict": [0, "always"],
|
|
141
|
+
"handle-callback-err": [2, "err"],
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export default defineConfig([
|
|
146
|
+
jsdoc.configs["flat/recommended"],
|
|
147
|
+
{
|
|
148
|
+
files: ["lib/**/*.js"],
|
|
149
|
+
languageOptions: {
|
|
150
|
+
sourceType: "commonjs",
|
|
151
|
+
globals: {
|
|
152
|
+
...globals.node,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
...jsRules,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
files: ["tests/**/*.js"],
|
|
159
|
+
languageOptions: {
|
|
160
|
+
sourceType: "script",
|
|
161
|
+
globals: {
|
|
162
|
+
...globals.node,
|
|
163
|
+
...globals.mocha,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
...jsRules,
|
|
167
|
+
},
|
|
168
|
+
]);
|
package/lib/rules/header.js
CHANGED
|
@@ -215,7 +215,7 @@ module.exports = {
|
|
|
215
215
|
},
|
|
216
216
|
create: function(context) {
|
|
217
217
|
var options = context.options;
|
|
218
|
-
var numNewlines = options.length > 2 ? options[2] : 1;
|
|
218
|
+
var numNewlines = options.length > 2 && typeof options[2] === "number" ? options[2] : 1;
|
|
219
219
|
var eol = getEOL(options);
|
|
220
220
|
|
|
221
221
|
// If just one option then read comment from file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tony.ganchev/eslint-plugin-header",
|
|
3
|
-
"version": "3.1.
|
|
4
|
-
"description": "ESLint plugin to ensure
|
|
3
|
+
"version": "3.1.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
|
"scripts": {
|
|
7
7
|
"test": "npm run lint && npm run unit",
|
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
"lint": "eslint ."
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"eslint": "^
|
|
13
|
-
"
|
|
12
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
13
|
+
"@eslint/js": "^9.32.0",
|
|
14
|
+
"eslint": "^9.32.0",
|
|
15
|
+
"eslint-plugin-jsdoc": "^52.0.4",
|
|
16
|
+
"mocha": "^11.7.1"
|
|
14
17
|
},
|
|
15
18
|
"peerDependencies": {
|
|
16
19
|
"eslint": ">=7.7.0"
|
package/.eslintrc.yml
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
root: true
|
|
2
|
-
|
|
3
|
-
env:
|
|
4
|
-
node: true
|
|
5
|
-
|
|
6
|
-
extends:
|
|
7
|
-
"eslint:recommended"
|
|
8
|
-
|
|
9
|
-
rules:
|
|
10
|
-
indent: [2, 4, {SwitchCase: 1}]
|
|
11
|
-
brace-style: [2, "1tbs"]
|
|
12
|
-
camelcase: [2, { properties: "never" }]
|
|
13
|
-
callback-return: [2, ["cb", "callback", "next"]]
|
|
14
|
-
comma-spacing: 2
|
|
15
|
-
comma-style: [2, "last"]
|
|
16
|
-
consistent-return: 2
|
|
17
|
-
curly: [2, "all"]
|
|
18
|
-
default-case: 2
|
|
19
|
-
dot-notation: [2, { allowKeywords: true }]
|
|
20
|
-
eol-last: 2
|
|
21
|
-
eqeqeq: 2
|
|
22
|
-
func-style: [2, "declaration"]
|
|
23
|
-
guard-for-in: 2
|
|
24
|
-
key-spacing: [2, { beforeColon: false, afterColon: true }]
|
|
25
|
-
new-cap: 2
|
|
26
|
-
new-parens: 2
|
|
27
|
-
no-alert: 2
|
|
28
|
-
no-array-constructor: 2
|
|
29
|
-
no-caller: 2
|
|
30
|
-
no-console: 0
|
|
31
|
-
no-delete-var: 2
|
|
32
|
-
no-eval: 2
|
|
33
|
-
no-extend-native: 2
|
|
34
|
-
no-extra-bind: 2
|
|
35
|
-
no-fallthrough: 2
|
|
36
|
-
no-floating-decimal: 2
|
|
37
|
-
no-implied-eval: 2
|
|
38
|
-
no-invalid-this: 2
|
|
39
|
-
no-iterator: 2
|
|
40
|
-
no-label-var: 2
|
|
41
|
-
no-labels: 2
|
|
42
|
-
no-lone-blocks: 2
|
|
43
|
-
no-loop-func: 2
|
|
44
|
-
no-mixed-spaces-and-tabs: [2, false]
|
|
45
|
-
no-multi-spaces: 2
|
|
46
|
-
no-multi-str: 2
|
|
47
|
-
no-native-reassign: 2
|
|
48
|
-
no-nested-ternary: 2
|
|
49
|
-
no-new: 2
|
|
50
|
-
no-new-func: 2
|
|
51
|
-
no-new-object: 2
|
|
52
|
-
no-new-wrappers: 2
|
|
53
|
-
no-octal: 2
|
|
54
|
-
no-octal-escape: 2
|
|
55
|
-
no-process-exit: 2
|
|
56
|
-
no-proto: 2
|
|
57
|
-
no-redeclare: 2
|
|
58
|
-
no-return-assign: 2
|
|
59
|
-
no-script-url: 2
|
|
60
|
-
no-sequences: 2
|
|
61
|
-
no-shadow: 2
|
|
62
|
-
no-shadow-restricted-names: 2
|
|
63
|
-
no-spaced-func: 2
|
|
64
|
-
no-trailing-spaces: 2
|
|
65
|
-
no-undef: 2
|
|
66
|
-
no-undef-init: 2
|
|
67
|
-
no-undefined: 2
|
|
68
|
-
no-underscore-dangle: 2
|
|
69
|
-
no-unused-expressions: 2
|
|
70
|
-
no-unused-vars: [2, {vars: "all", args: "after-used"}]
|
|
71
|
-
no-use-before-define: 2
|
|
72
|
-
no-with: 2
|
|
73
|
-
quotes: [2, "double"]
|
|
74
|
-
radix: 2
|
|
75
|
-
semi: 2
|
|
76
|
-
semi-spacing: [2, {before: false, after: true}]
|
|
77
|
-
keyword-spacing: [2, {"after": true }]
|
|
78
|
-
space-before-blocks: 2
|
|
79
|
-
space-before-function-paren: [2, "never"]
|
|
80
|
-
space-infix-ops: 2
|
|
81
|
-
space-unary-ops: [2, {words: true, nonwords: false}]
|
|
82
|
-
spaced-comment: [2, "always", { exceptions: ["-"]}]
|
|
83
|
-
strict: [2, "global"]
|
|
84
|
-
valid-jsdoc: [2, { prefer: { "return": "returns"}}]
|
|
85
|
-
wrap-iife: 2
|
|
86
|
-
yoda: [2, "never"]
|
|
87
|
-
|
|
88
|
-
# Previously on by default in node environment
|
|
89
|
-
no-catch-shadow: 0
|
|
90
|
-
no-mixed-requires: 2
|
|
91
|
-
no-new-require: 2
|
|
92
|
-
no-path-concat: 2
|
|
93
|
-
global-strict: [0, "always"]
|
|
94
|
-
handle-callback-err: [2, "err"]
|