@tony.ganchev/eslint-plugin-header 3.2.5 → 3.3.0

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.
@@ -142,6 +142,28 @@ const schema = Object.freeze({
142
142
  required: ["commentType", "lines"],
143
143
  additionalProperties: false
144
144
  },
145
+ header: {
146
+ anyOf: [
147
+ { $ref: "#/definitions/fileBasedHeader" },
148
+ { $ref: "#/definitions/inlineHeader" }
149
+ ],
150
+ description: "Header comment matching rules."
151
+ },
152
+ leadingComments: {
153
+ type: "object",
154
+ properties: {
155
+ comments: {
156
+ type: "array",
157
+ items: { $ref: "#/definitions/header" },
158
+ description: "The set of comment matching rules. The rule can match one or more comments against " +
159
+ "these rules."
160
+ }
161
+ },
162
+ required: ["comments"],
163
+ additionalProperties: false,
164
+ description: "Set of comments that can appear before the header comment. Useful for pragmas used by some " +
165
+ "tools that expect these to be the first comment in the file."
166
+ },
145
167
  trailingEmptyLines: {
146
168
  type: "object",
147
169
  properties: {
@@ -156,12 +178,8 @@ const schema = Object.freeze({
156
178
  newOptions: {
157
179
  type: "object",
158
180
  properties: {
159
- header: {
160
- anyOf: [
161
- { $ref: "#/definitions/fileBasedHeader" },
162
- { $ref: "#/definitions/inlineHeader" }
163
- ]
164
- },
181
+ header: { $ref: "#/definitions/header" },
182
+ leadingComments: { $ref: "#/definitions/leadingComments" },
165
183
  lineEndings: { $ref: "#/definitions/lineEndings" },
166
184
  trailingEmptyLines: { $ref: "#/definitions/trailingEmptyLines" }
167
185
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tony.ganchev/eslint-plugin-header",
3
- "version": "3.2.5",
3
+ "version": "3.3.0",
4
4
  "description": "The native ESLint 9/10 header plugin. A zero-bloat, drop-in replacement for 'eslint-plugin-header' with first-class Flat Config & TypeScript support. Auto-fix Copyright, License, and banner comments in JavaScrip and TypeScript files.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,19 +18,20 @@
18
18
  "CONTRIBUTING.md"
19
19
  ],
20
20
  "devDependencies": {
21
+ "@eslint/core": "^1.1.1",
21
22
  "@eslint/js": "^10.0.1",
22
23
  "@eslint/markdown": "^7.5.1",
23
- "@stylistic/eslint-plugin": "^5.9.0",
24
+ "@stylistic/eslint-plugin": "^5.10.0",
24
25
  "@types/estree": "^1.0.8",
25
26
  "@types/json-schema": "^7.0.15",
26
- "@types/node": "^25.3.0",
27
- "c8": "^10.1.3",
28
- "eslint": "^10.0.2",
29
- "eslint-plugin-eslint-plugin": "^7.3.1",
27
+ "@types/node": "^25.3.5",
28
+ "c8": "^11.0.0",
29
+ "eslint": "^10.0.3",
30
+ "eslint-plugin-eslint-plugin": "^7.3.2",
30
31
  "eslint-plugin-jsdoc": "^62.7.1",
31
32
  "eslint-plugin-n": "^17.24.0",
32
- "globals": "^17.3.0",
33
- "markdownlint-cli": "^0.47.0",
33
+ "globals": "^17.4.0",
34
+ "markdownlint-cli": "^0.48.0",
34
35
  "mocha": "12.0.0-beta-9",
35
36
  "testdouble": "^3.20.2",
36
37
  "typescript": "^5.9.3",
@@ -85,6 +85,18 @@ export type InlineConfig = {
85
85
  */
86
86
  lines: HeaderLine[];
87
87
  };
88
+ /**
89
+ * A set of comments that can appear before
90
+ * the header.
91
+ */
92
+ export type LeadingComments = {
93
+ /**
94
+ * The set of comments
95
+ * that are allowed. If none of the matching rules matches the first comment the
96
+ * rule assumes the first comment *is* the header.
97
+ */
98
+ comments: (FileBasedConfig | InlineConfig)[];
99
+ };
88
100
  /**
89
101
  * Rule configuration on the handling of
90
102
  * empty lines after the header comment.
@@ -102,6 +114,12 @@ export type HeaderOptionsWithoutSettings = {
102
114
  * for the header.
103
115
  */
104
116
  header: FileBasedConfig | InlineConfig;
117
+ /**
118
+ * The set of allowed comments to
119
+ * precede the header. Useful to allow position-sensitive pragma comments for
120
+ * certain tools.
121
+ */
122
+ leadingComments?: LeadingComments | undefined;
105
123
  /**
106
124
  * Rules about empty lines
107
125
  * after the header comment.
@@ -1 +1 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../lib/rules/header.js"],"names":[],"mappings":";2BAqCa,iBAAiB;0BACjB,gBAAgB;wBAChB,cAAc;0BACd,gBAAgB;;;;;yBAIhB,IAAI,GAAG,MAAM;;;;;;;;;;aAOZ,MAAM,GAAG,MAAM;;;;;;;;;;;;yBAOhB,MAAM,GAAG,MAAM,GAAG,iBAAiB;;;;;0BAGnC,UAAU,GAAG,UAAU,EAAE;;;;;;+BAEzB,IAAI,GAAG,MAAM,GAAG,SAAS;;;;;6BAGzB;IAAE,WAAW,CAAC,EAAE,gBAAgB,CAAA;CAAE;;;;;0BAElC,OAAO,GAAG,MAAM;;;;;;;;;;UAOf,MAAM;;;;;;;;;;;;;;;iBASN,WAAW;;;;;;WACX,UAAU,EAAE;;;;;;;;;;;;;;;;;;YAcZ,eAAe,GAAG,YAAY;;;;;;;;;;;4BAO/B,4BAA4B,GAAG,cAAc;oCAK7C,CAAC,QAAQ,EAAE,MAAM,CAAC;4CAClB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC;iCAE5C,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC;yCACvC,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,CAAC;yCAEjE,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC;iDAEzD,CACV,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,cAAc,CACvB;;;;+BACS,CAAC,aAAa,CAAC,GACvB,qBAAqB,GACrB,6BAA6B,GAC7B,kBAAkB,GAClB,0BAA0B,GAC1B,0BAA0B,GAC1B,kCAAkC;;;;;+BAK1B,iBAAiB,gBAAgB,CAAC;AAqb/C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,kBAAkB,GAClB,0BAA0B,GAC1B,0BAA0B,GAC1B,kCAAkC;;;;;+BAK1B,iBAAiB,gBAAgB,CAAC;AAsuB/C,8BAA8B;AAC9B,0BADW,eAAe,CAyLxB;0BAhhC4D,QAAQ;4BAAR,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"header.schema.d.ts","sourceRoot":"","sources":["../../../lib/rules/header.schema.js"],"names":[],"mappings":"gCA4BU,MAAM;AADhB;;GAEG;AACH;;;;GAIG;iCAGO,MAAM;AADhB;;GAEG;AACH;;;GAGG;AAEH,gDAAgD;AAChD,qBADW,OAAO,aAAa,EAAE,WAAW,CAwKzC"}
1
+ {"version":3,"file":"header.schema.d.ts","sourceRoot":"","sources":["../../../lib/rules/header.schema.js"],"names":[],"mappings":"gCA4BU,MAAM;AADhB;;GAEG;AACH;;;;GAIG;iCAGO,MAAM;AADhB;;GAEG;AACH;;;GAGG;AAEH,gDAAgD;AAChD,qBADW,OAAO,aAAa,EAAE,WAAW,CA0LzC"}