@tony.ganchev/eslint-plugin-header 3.2.0 → 3.2.2
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/README.md +210 -77
- package/index.d.ts +29 -0
- package/index.js +7 -5
- package/lib/comment-parser.js +1 -1
- package/lib/rules/eslint-utils.js +2 -1
- package/lib/rules/header.docs.js +1 -12
- package/lib/rules/header.js +256 -145
- package/lib/rules/header.schema.js +1 -0
- package/package.json +55 -14
- package/types/index.d.ts +4 -0
- package/types/index.d.ts.map +1 -0
- package/types/lib/comment-parser.d.ts +3 -0
- package/types/lib/comment-parser.d.ts.map +1 -0
- package/types/lib/rules/eslint-utils.d.ts +10 -0
- package/types/lib/rules/eslint-utils.d.ts.map +1 -0
- package/types/lib/rules/header.d.ts +100 -0
- package/types/lib/rules/header.d.ts.map +1 -0
- package/types/lib/rules/header.docs.d.ts +3 -0
- package/types/lib/rules/header.docs.d.ts.map +1 -0
- package/types/lib/rules/header.schema.d.ts +20 -0
- package/types/lib/rules/header.schema.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -1,48 +1,89 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tony.ganchev/eslint-plugin-header",
|
|
3
|
-
"version": "3.2.
|
|
4
|
-
"description": "ESLint plugin
|
|
3
|
+
"version": "3.2.2",
|
|
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
|
+
"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
|
-
"
|
|
8
|
-
"
|
|
15
|
+
"lib/**/*.js",
|
|
16
|
+
"index.d.ts*",
|
|
17
|
+
"types"
|
|
9
18
|
],
|
|
10
19
|
"scripts": {
|
|
20
|
+
"build": "npx tsc",
|
|
21
|
+
"e2e": "npm run build && npx mocha --timeout 60000 tests/e2e/*.js",
|
|
11
22
|
"eslint": "npx eslint .",
|
|
12
23
|
"lint": "npm run eslint && npm run markdownlint",
|
|
13
24
|
"markdownlint": "npx markdownlint-cli *.md",
|
|
14
25
|
"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"
|
|
26
|
+
"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
27
|
},
|
|
18
28
|
"devDependencies": {
|
|
19
29
|
"@eslint/eslintrc": "^3.3.3",
|
|
20
|
-
"@eslint/js": "^
|
|
30
|
+
"@eslint/js": "^10.0.1",
|
|
21
31
|
"@eslint/markdown": "^7.5.1",
|
|
22
|
-
"@stylistic/eslint-plugin": "^5.
|
|
23
|
-
"
|
|
32
|
+
"@stylistic/eslint-plugin": "^5.8.0",
|
|
33
|
+
"@types/node": "^25.2.3",
|
|
34
|
+
"eslint": "^10.0.0",
|
|
24
35
|
"eslint-plugin-eslint-plugin": "^7.3.0",
|
|
25
|
-
"eslint-plugin-jsdoc": "^62.
|
|
36
|
+
"eslint-plugin-jsdoc": "^62.5.4",
|
|
26
37
|
"eslint-plugin-n": "^17.23.2",
|
|
27
38
|
"markdownlint-cli": "^0.47.0",
|
|
28
|
-
"mocha": "^12.0.0-beta-
|
|
39
|
+
"mocha": "^12.0.0-beta-9",
|
|
29
40
|
"nyc": "^17.1.0",
|
|
30
|
-
"testdouble": "^3.20.2"
|
|
41
|
+
"testdouble": "^3.20.2",
|
|
42
|
+
"typescript": "^5.9.3",
|
|
43
|
+
"typescript-eslint": "^8.56.0"
|
|
31
44
|
},
|
|
32
45
|
"peerDependencies": {
|
|
33
46
|
"eslint": ">=7.7.0"
|
|
34
47
|
},
|
|
48
|
+
"overrides": {
|
|
49
|
+
"eslint": "^10.0.0"
|
|
50
|
+
},
|
|
35
51
|
"keywords": [
|
|
36
52
|
"eslint",
|
|
37
|
-
"
|
|
53
|
+
"eslint-plugin",
|
|
54
|
+
"eslint9",
|
|
55
|
+
"flat-config",
|
|
56
|
+
"header",
|
|
57
|
+
"copyright",
|
|
58
|
+
"license",
|
|
59
|
+
"banner",
|
|
60
|
+
"notice",
|
|
61
|
+
"license-header",
|
|
62
|
+
"copyright-header",
|
|
63
|
+
"legal",
|
|
64
|
+
"gdpr",
|
|
65
|
+
"source-header",
|
|
66
|
+
"typescript",
|
|
67
|
+
"react",
|
|
68
|
+
"check",
|
|
69
|
+
"fix"
|
|
38
70
|
],
|
|
39
71
|
"repository": {
|
|
40
72
|
"type": "git",
|
|
41
73
|
"url": "https://github.com/tonyganchev/eslint-plugin-header.git"
|
|
42
74
|
},
|
|
43
|
-
"
|
|
75
|
+
"homepage": "https://github.com/tonyganchev/eslint-plugin-header#readme",
|
|
76
|
+
"bugs": {
|
|
77
|
+
"url": "https://github.com/tonyganchev/eslint-plugin-header/issues"
|
|
78
|
+
},
|
|
44
79
|
"license": "MIT",
|
|
80
|
+
"author": "Tony Ganchev",
|
|
45
81
|
"maintainers": [
|
|
82
|
+
"Gyokan Syuleymanov",
|
|
46
83
|
"Tony Ganchev"
|
|
84
|
+
],
|
|
85
|
+
"contributors": [
|
|
86
|
+
"Josh Kelley",
|
|
87
|
+
"Stuart Knightley"
|
|
47
88
|
]
|
|
48
89
|
}
|
package/types/index.d.ts
ADDED
|
@@ -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 @@
|
|
|
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,CAKtB;;;mBAdQ,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,QAAQ,EAAE,IAAI,CAAC,YAAY;;;;0BAClC,OAAO,QAAQ,EAAE,IAAI,CAAC,WAAW;;;;wBACjC,OAAO,QAAQ,EAAE,IAAI,CAAC,SAAS;;;;0BAC/B,OAAO,QAAQ,EAAE,IAAI,CAAC,WAA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AAO,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC;AAqbhE,+CAA+C;AAC/C,0BADW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU,CA8dzC"}
|
|
@@ -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"}
|