@tony.ganchev/eslint-plugin-header 3.2.0 → 3.2.1

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.
@@ -41,6 +41,7 @@ const commentTypeOptions = Object.freeze({
41
41
  line: "line"
42
42
  });
43
43
 
44
+ /** @type {import('json-schema').JSONSchema4} */
44
45
  const schema = Object.freeze({
45
46
  $ref: "#/definitions/options",
46
47
  definitions: {
package/package.json CHANGED
@@ -1,33 +1,47 @@
1
1
  {
2
2
  "name": "@tony.ganchev/eslint-plugin-header",
3
- "version": "3.2.0",
3
+ "version": "3.2.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
+ "types": "index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./index.d.ts",
10
+ "import": "./index.js",
11
+ "require": "./index.js"
12
+ }
13
+ },
6
14
  "files": [
7
- "/lib/**/*.js",
8
- "!/lib/rules/test-utils.js"
15
+ "lib/**/*.js",
16
+ "index.d.ts*",
17
+ "types",
18
+ "!lib/rules/test-utils.js"
9
19
  ],
10
20
  "scripts": {
21
+ "build": "npx tsc",
22
+ "e2e": "npm run build && npx mocha --timeout 60000 tests/e2e/*.js",
11
23
  "eslint": "npx eslint .",
12
24
  "lint": "npm run eslint && npm run markdownlint",
13
25
  "markdownlint": "npx markdownlint-cli *.md",
14
26
  "test": "npm run lint && npm run unit && npm run e2e",
15
- "unit": "npx nyc --reporter=html --reporter=text --reporter=text-summary --reporter=lcov --check-coverage=true --statements=100 --branches=100 --lines=100 --functions=100 mocha tests/lib/*.js tests/lib/**/*.js",
16
- "e2e": "npx mocha --timeout 60000 tests/e2e/*.js"
27
+ "unit": "npx nyc --reporter=html --reporter=text --reporter=text-summary --reporter=lcov --check-coverage=true --statements=100 --branches=100 --lines=100 --functions=100 mocha tests/lib/*.js tests/lib/**/*.js"
17
28
  },
18
29
  "devDependencies": {
19
30
  "@eslint/eslintrc": "^3.3.3",
20
31
  "@eslint/js": "^9.39.2",
21
32
  "@eslint/markdown": "^7.5.1",
22
- "@stylistic/eslint-plugin": "^5.7.0",
33
+ "@stylistic/eslint-plugin": "^5.7.1",
34
+ "@types/node": "^25.2.1",
23
35
  "eslint": "^9.39.2",
24
36
  "eslint-plugin-eslint-plugin": "^7.3.0",
25
- "eslint-plugin-jsdoc": "^62.1.0",
37
+ "eslint-plugin-jsdoc": "^62.5.2",
26
38
  "eslint-plugin-n": "^17.23.2",
27
39
  "markdownlint-cli": "^0.47.0",
28
- "mocha": "^12.0.0-beta-5",
40
+ "mocha": "^12.0.0-beta-6",
29
41
  "nyc": "^17.1.0",
30
- "testdouble": "^3.20.2"
42
+ "testdouble": "^3.20.2",
43
+ "typescript": "^5.9.3",
44
+ "typescript-eslint": "^8.54.0"
31
45
  },
32
46
  "peerDependencies": {
33
47
  "eslint": ">=7.7.0"
@@ -38,7 +52,7 @@
38
52
  ],
39
53
  "repository": {
40
54
  "type": "git",
41
- "url": "https://github.com/tonyganchev/eslint-plugin-header.git"
55
+ "url": "git+https://github.com/tonyganchev/eslint-plugin-header.git"
42
56
  },
43
57
  "author": "Stuart Knightley",
44
58
  "license": "MIT",
@@ -0,0 +1,4 @@
1
+ export = pluginDefinition;
2
+ /** @type {import('eslint').ESLint.Plugin} */
3
+ declare const pluginDefinition: import("eslint").ESLint.Plugin;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":";AA4BA,6CAA6C;AAC7C,gCADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,CAKvC"}
@@ -0,0 +1,3 @@
1
+ declare function _exports(commentText: string): ["block" | "line", string[]];
2
+ export = _exports;
3
+ //# sourceMappingURL=comment-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment-parser.d.ts","sourceRoot":"","sources":["../../lib/comment-parser.js"],"names":[],"mappings":"AAsCiB,uCAJN,MAAM,GACJ,CAAC,OAAO,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,CAmBxC"}
@@ -0,0 +1,10 @@
1
+ declare namespace _exports {
2
+ export { RuleContext, SourceCode };
3
+ }
4
+ declare namespace _exports {
5
+ function contextSourceCode(context: RuleContext): SourceCode;
6
+ }
7
+ export = _exports;
8
+ type RuleContext = import("eslint").Rule.RuleContext;
9
+ type SourceCode = import("eslint").SourceCode;
10
+ //# sourceMappingURL=eslint-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint-utils.d.ts","sourceRoot":"","sources":["../../../lib/rules/eslint-utils.js"],"names":[],"mappings":";;;;IAsCuB,oCAHR,WAAW,GACT,UAAU,CAItB;;;mBAbQ,OAAO,QAAQ,EAAE,IAAI,CAAC,WAAW;kBACjC,OAAO,QAAQ,EAAE,UAAU"}
@@ -0,0 +1,100 @@
1
+ export { headerRule as header };
2
+ /**
3
+ * Import type definitions.
4
+ */
5
+ export type Fix = import("eslint").Rule.Fix;
6
+ /**
7
+ * Import type definitions.
8
+ */
9
+ export type NodeListener = import("eslint").Rule.NodeListener;
10
+ /**
11
+ * Import type definitions.
12
+ */
13
+ export type ReportFixer = import("eslint").Rule.ReportFixer;
14
+ /**
15
+ * Import type definitions.
16
+ */
17
+ export type RuleFixer = import("eslint").Rule.RuleFixer;
18
+ /**
19
+ * Import type definitions.
20
+ */
21
+ export type RuleContext = import("eslint").Rule.RuleContext;
22
+ /**
23
+ * Import type definitions.
24
+ */
25
+ export type Comment = import("estree").Comment;
26
+ /**
27
+ * Import type definitions.
28
+ */
29
+ export type Program = import("estree").Program;
30
+ /**
31
+ * Import type definitions.
32
+ */
33
+ export type SourceLocation = import("estree").SourceLocation;
34
+ /**
35
+ * Local type definitions.
36
+ */
37
+ export type HeaderLinePattern = {
38
+ pattern: string | RegExp;
39
+ template?: string;
40
+ };
41
+ /**
42
+ * Local type definitions.
43
+ */
44
+ export type HeaderLine = string | RegExp | HeaderLinePattern;
45
+ /**
46
+ * Local type definitions.
47
+ */
48
+ export type HeaderLines = HeaderLine | HeaderLine[];
49
+ /**
50
+ * Local type definitions.
51
+ */
52
+ export type LineEndingOption = "os" | "unix" | "windows";
53
+ /**
54
+ * Local type definitions.
55
+ */
56
+ export type HeaderSettings = {
57
+ lineEndings?: LineEndingOption;
58
+ };
59
+ /**
60
+ * Local type definitions.
61
+ */
62
+ export type CommentType = "block" | "line";
63
+ /**
64
+ * Local type definitions.
65
+ */
66
+ export type FileBasedConfig = {
67
+ file: string;
68
+ encoding?: BufferEncoding;
69
+ };
70
+ /**
71
+ * Local type definitions.
72
+ */
73
+ export type InlineConfig = {
74
+ commentType: CommentType;
75
+ lines: HeaderLine[];
76
+ };
77
+ /**
78
+ * Local type definitions.
79
+ */
80
+ export type TrailingEmptyLines = {
81
+ minimum?: number;
82
+ };
83
+ /**
84
+ * Local type definitions.
85
+ */
86
+ export type HeaderOptions = {
87
+ header: FileBasedConfig | InlineConfig;
88
+ trailingEmptyLines?: TrailingEmptyLines;
89
+ } & HeaderSettings;
90
+ /**
91
+ * Local type definitions.
92
+ */
93
+ export type AllHeaderOptions = [HeaderOptions] | [template: string] | [template: string, settings: HeaderSettings] | [type: CommentType, lines: HeaderLines] | [type: CommentType, lines: HeaderLines, settings: HeaderSettings] | [type: CommentType, lines: HeaderLines, minLines: number] | [type: CommentType, lines: HeaderLines, minLines: number, settings: HeaderSettings];
94
+ /**
95
+ * Local type definitions.
96
+ */
97
+ export type HeaderRuleConfig = import("eslint").Linter.RuleEntry<AllHeaderOptions>;
98
+ /** @type {import('eslint').Rule.RuleModule} */
99
+ declare const headerRule: import("eslint").Rule.RuleModule;
100
+ //# sourceMappingURL=header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../lib/rules/header.js"],"names":[],"mappings":";;;;kBAoCa,OAAO,QAAQ,EAAE,IAAI,CAAC,GAAG;;;;2BACzB,OAAO,QA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AK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,CAAC,GAC5D,CACM,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,cAAc,CAC1B;;;;+BAEQ,OAAO,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC;AAqbhE,+CAA+C;AAC/C,0BADW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU,CA+dzC"}
@@ -0,0 +1,4 @@
1
+ export const description: "";
2
+ export const recommended: true;
3
+ export const url: string;
4
+ //# sourceMappingURL=header.docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.docs.d.ts","sourceRoot":"","sources":["../../../lib/rules/header.docs.js"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ export type lineEndingOptions = string;
2
+ /**
3
+ * @enum {string}
4
+ */
5
+ export const lineEndingOptions: Readonly<{
6
+ os: "os";
7
+ unix: "unix";
8
+ windows: "windows";
9
+ }>;
10
+ export type commentTypeOptions = string;
11
+ /**
12
+ * @enum {string}
13
+ */
14
+ export const commentTypeOptions: Readonly<{
15
+ block: "block";
16
+ line: "line";
17
+ }>;
18
+ /** @type {import('json-schema').JSONSchema4} */
19
+ export const schema: import("json-schema").JSONSchema4;
20
+ //# sourceMappingURL=header.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.schema.d.ts","sourceRoot":"","sources":["../../../lib/rules/header.schema.js"],"names":[],"mappings":"gCA2BU,MAAM;AADhB;;GAEG;AACH;;;;GAIG;iCAGO,MAAM;AADhB;;GAEG;AACH;;;GAGG;AAEH,gDAAgD;AAChD,qBADW,OAAO,aAAa,EAAE,WAAW,CAwKzC"}
@@ -0,0 +1,10 @@
1
+ declare namespace _exports {
2
+ export { InvalidTestCase, TestCaseError };
3
+ }
4
+ declare namespace _exports {
5
+ function generateInvalidTestCaseNames(invalidTests: InvalidTestCase[]): InvalidTestCase[];
6
+ }
7
+ export = _exports;
8
+ type InvalidTestCase = import("eslint").RuleTester.InvalidTestCase;
9
+ type TestCaseError = import("eslint").RuleTester.TestCaseError;
10
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../lib/rules/test-utils.js"],"names":[],"mappings":";;;;IA4EkC,oDAJnB,eAAe,EAAE,GACf,eAAe,EAAE,CA2C7B;;;uBAvFQ,OAAO,QAAQ,EAAE,UAAU,CAAC,eAAe;qBAC3C,OAAO,QAAQ,EAAE,UAAU,CAAC,aAAa"}