-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathheadright.config.js
More file actions
118 lines (104 loc) · 2.91 KB
/
headright.config.js
File metadata and controls
118 lines (104 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*!
* Copyright (c) 2024, Rahul Gupta and Multipart Fetch contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* SPDX-License-Identifier: MPL-2.0
*/
import { EOL } from "os";
import dedent from "dedent";
const settings = Object.freeze({
notice: {
/* Header Format
Properties not used need not be specified in these settings */
template:
"Copyright (c) $<year>, $<author> and Multipart Fetch contributors." +
EOL +
EOL +
"$<license>" +
EOL +
EOL +
"SPDX-License-Identifier: $<spdx>",
/* Query pattern for template string
Since we do not use a templating engine */
queryPattern: /\$<.*?>/g,
/* Author of commit files
(If not specifies will be queried directly from local git configuration) */
// author: '',
/* Contact Information of Commit File Author
(If not specified will be queried directly from local git configuration) */
// contact: '',
/* Custom strings
Properties starting with pkg are retrieved from package.json at cwd */
custom: {
/* Add your own custom property */
// property1: '',
},
/* License */
license: {
/* License Header
(Preferred over header file) */
notice: dedent`
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
`,
/* Location of the License header file
(relative to cwd) */
// location: '',
},
/* License SPDX identifier
(If not specified will be obtained from package.json file at cwd) */
// spdx: '',
},
add: {
/* Regex to detect template */
detect: /Copyright \(c\) (?:\d{4}|-|, )*/g,
/* Regex for File Prefixes to preserve */
filePrefix: {
js: [
"#!.*?",
"#\\s*.*?coding=.*?",
"\\/\\/\\s*@flow.*?",
"\\/\\*\\s*@flow\\s*\\*\\/",
],
},
/* Comment style wrapping the header */
commentStyles: {
code: {
blockStart: "/*!\n",
blockEnd: "\n */",
lineStart: " * ",
},
markup: {
blockStart: "<!--\n",
blockEnd: "\n-->",
lineStart: " ",
},
none: {
blockStart: "",
blockEnd: "",
lineStart: "",
},
},
/* Mapping file type to comment style */
extensionStyleMap: {
js: "code",
},
},
update: {
/* Regex to Update */
match: /Copyright \(c\) (\d{4}|-|, )*(\d{4}), /,
},
/* Files to ignore in Globstar format */
ignore: [
"{**,.}/[.]*/**",
"{**,.}/node_modules/**",
"{**,.}/coverage/**",
"{**,.}/dist/**",
"{**,.}/_*/**",
],
});
export default settings;