@forsakringskassan/commitlint-config 1.2.0 → 1.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.
@@ -0,0 +1,105 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "type": "object",
4
+ "definitions": {
5
+ "rule": {
6
+ "oneOf": [
7
+ {
8
+ "description": "A rule",
9
+ "type": "array",
10
+ "items": [
11
+ {
12
+ "description": "Level: 0 disables the rule. For 1 it will be considered a warning, for 2 an error",
13
+ "type": "number",
14
+ "enum": [0, 1, 2]
15
+ },
16
+ {
17
+ "description": "Applicable: always|never: never inverts the rule",
18
+ "type": "string",
19
+ "enum": ["always", "never"]
20
+ },
21
+ {
22
+ "description": "Value: the value for this rule"
23
+ }
24
+ ],
25
+ "minItems": 1,
26
+ "maxItems": 3,
27
+ "additionalItems": false
28
+ },
29
+ {
30
+ "description": "A rule",
31
+ "typeof": "function"
32
+ }
33
+ ]
34
+ }
35
+ },
36
+ "properties": {
37
+ "extends": {
38
+ "description": "Resolveable ids to commitlint configurations to extend",
39
+ "oneOf": [
40
+ {
41
+ "type": "array",
42
+ "items": { "type": "string" }
43
+ },
44
+ { "type": "string" }
45
+ ]
46
+ },
47
+ "parserPreset": {
48
+ "description": "Resolveable id to conventional-changelog parser preset to import and use",
49
+ "oneOf": [
50
+ { "type": "string" },
51
+ {
52
+ "type": "object",
53
+ "properties": {
54
+ "name": { "type": "string" },
55
+ "path": { "type": "string" },
56
+ "parserOpts": {}
57
+ },
58
+ "additionalProperties": true
59
+ },
60
+ { "typeof": "function" }
61
+ ]
62
+ },
63
+ "helpUrl": {
64
+ "description": "Custom URL to show upon failure",
65
+ "type": "string"
66
+ },
67
+ "formatter": {
68
+ "description": "Resolveable id to package, from node_modules, which formats the output",
69
+ "type": "string"
70
+ },
71
+ "rules": {
72
+ "description": "Rules to check against",
73
+ "type": "object",
74
+ "propertyNames": { "type": "string" },
75
+ "additionalProperties": { "$ref": "#/definitions/rule" }
76
+ },
77
+ "plugins": {
78
+ "description": "Resolveable ids of commitlint plugins from node_modules",
79
+ "type": "array",
80
+ "items": {
81
+ "anyOf": [
82
+ { "type": "string" },
83
+ {
84
+ "type": "object",
85
+ "required": ["rules"],
86
+ "properties": {
87
+ "rules": {
88
+ "type": "object"
89
+ }
90
+ }
91
+ }
92
+ ]
93
+ }
94
+ },
95
+ "ignores": {
96
+ "type": "array",
97
+ "items": { "typeof": "function" },
98
+ "description": "Additional commits to ignore, defined by ignore matchers"
99
+ },
100
+ "defaultIgnores": {
101
+ "description": "Whether commitlint uses the default ignore rules",
102
+ "type": "boolean"
103
+ }
104
+ }
105
+ }
@@ -1,161 +1,174 @@
1
- var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __commonJS = (cb, mod) => function __require() {
3
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
4
- };
5
1
 
6
- // node_modules/@commitlint/config-conventional/index.js
7
- var require_config_conventional = __commonJS({
8
- "node_modules/@commitlint/config-conventional/index.js"(exports2, module2) {
9
- module2.exports = {
10
- parserPreset: "conventional-changelog-conventionalcommits",
11
- rules: {
12
- "body-leading-blank": [1, "always"],
13
- "body-max-line-length": [2, "always", 100],
14
- "footer-leading-blank": [1, "always"],
15
- "footer-max-line-length": [2, "always", 100],
16
- "header-max-length": [2, "always", 100],
17
- "subject-case": [
18
- 2,
19
- "never",
20
- ["sentence-case", "start-case", "pascal-case", "upper-case"]
21
- ],
22
- "subject-empty": [2, "never"],
23
- "subject-full-stop": [2, "never", "."],
24
- "type-case": [2, "always", "lower-case"],
25
- "type-empty": [2, "never"],
26
- "type-enum": [
27
- 2,
28
- "always",
29
- [
30
- "build",
31
- "chore",
32
- "ci",
33
- "docs",
34
- "feat",
35
- "fix",
36
- "perf",
37
- "refactor",
38
- "revert",
39
- "style",
40
- "test"
41
- ]
42
- ]
43
- },
44
- prompt: {
45
- questions: {
46
- type: {
47
- description: "Select the type of change that you're committing",
48
- enum: {
49
- feat: {
50
- description: "A new feature",
51
- title: "Features",
52
- emoji: "\u2728"
53
- },
54
- fix: {
55
- description: "A bug fix",
56
- title: "Bug Fixes",
57
- emoji: "\u{1F41B}"
58
- },
59
- docs: {
60
- description: "Documentation only changes",
61
- title: "Documentation",
62
- emoji: "\u{1F4DA}"
63
- },
64
- style: {
65
- description: "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
66
- title: "Styles",
67
- emoji: "\u{1F48E}"
68
- },
69
- refactor: {
70
- description: "A code change that neither fixes a bug nor adds a feature",
71
- title: "Code Refactoring",
72
- emoji: "\u{1F4E6}"
73
- },
74
- perf: {
75
- description: "A code change that improves performance",
76
- title: "Performance Improvements",
77
- emoji: "\u{1F680}"
78
- },
79
- test: {
80
- description: "Adding missing tests or correcting existing tests",
81
- title: "Tests",
82
- emoji: "\u{1F6A8}"
83
- },
84
- build: {
85
- description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
86
- title: "Builds",
87
- emoji: "\u{1F6E0}"
88
- },
89
- ci: {
90
- description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
91
- title: "Continuous Integrations",
92
- emoji: "\u2699\uFE0F"
93
- },
94
- chore: {
95
- description: "Other changes that don't modify src or test files",
96
- title: "Chores",
97
- emoji: "\u267B\uFE0F"
98
- },
99
- revert: {
100
- description: "Reverts a previous commit",
101
- title: "Reverts",
102
- emoji: "\u{1F5D1}"
103
- }
104
- }
2
+ import { dirname as _$_dirname } from "node:path";
3
+ import { createRequire as _$_createRequire } from "node:module";
4
+ import { fileURLToPath as _$_fileURLToPath } from "node:url";
5
+
6
+ const require = _$_createRequire(import.meta.url);
7
+ const __dirname = _$_dirname(_$_fileURLToPath(import.meta.url));
8
+
9
+
10
+ // src/config/default.ts
11
+ import { fileURLToPath } from "node:url";
12
+
13
+ // node_modules/@commitlint/types/lib/rules.js
14
+ var RuleConfigSeverity;
15
+ (function(RuleConfigSeverity2) {
16
+ RuleConfigSeverity2[RuleConfigSeverity2["Disabled"] = 0] = "Disabled";
17
+ RuleConfigSeverity2[RuleConfigSeverity2["Warning"] = 1] = "Warning";
18
+ RuleConfigSeverity2[RuleConfigSeverity2["Error"] = 2] = "Error";
19
+ })(RuleConfigSeverity || (RuleConfigSeverity = {}));
20
+ var RuleConfigQuality;
21
+ (function(RuleConfigQuality2) {
22
+ RuleConfigQuality2[RuleConfigQuality2["User"] = 0] = "User";
23
+ RuleConfigQuality2[RuleConfigQuality2["Qualified"] = 1] = "Qualified";
24
+ })(RuleConfigQuality || (RuleConfigQuality = {}));
25
+
26
+ // node_modules/@commitlint/config-conventional/lib/index.js
27
+ var lib_default = {
28
+ parserPreset: "conventional-changelog-conventionalcommits",
29
+ rules: {
30
+ "body-leading-blank": [RuleConfigSeverity.Warning, "always"],
31
+ "body-max-line-length": [RuleConfigSeverity.Error, "always", 100],
32
+ "footer-leading-blank": [RuleConfigSeverity.Warning, "always"],
33
+ "footer-max-line-length": [
34
+ RuleConfigSeverity.Error,
35
+ "always",
36
+ 100
37
+ ],
38
+ "header-max-length": [RuleConfigSeverity.Error, "always", 100],
39
+ "header-trim": [RuleConfigSeverity.Error, "always"],
40
+ "subject-case": [
41
+ RuleConfigSeverity.Error,
42
+ "never",
43
+ ["sentence-case", "start-case", "pascal-case", "upper-case"]
44
+ ],
45
+ "subject-empty": [RuleConfigSeverity.Error, "never"],
46
+ "subject-full-stop": [RuleConfigSeverity.Error, "never", "."],
47
+ "type-case": [RuleConfigSeverity.Error, "always", "lower-case"],
48
+ "type-empty": [RuleConfigSeverity.Error, "never"],
49
+ "type-enum": [
50
+ RuleConfigSeverity.Error,
51
+ "always",
52
+ [
53
+ "build",
54
+ "chore",
55
+ "ci",
56
+ "docs",
57
+ "feat",
58
+ "fix",
59
+ "perf",
60
+ "refactor",
61
+ "revert",
62
+ "style",
63
+ "test"
64
+ ]
65
+ ]
66
+ },
67
+ prompt: {
68
+ questions: {
69
+ type: {
70
+ description: "Select the type of change that you're committing",
71
+ enum: {
72
+ feat: {
73
+ description: "A new feature",
74
+ title: "Features",
75
+ emoji: "\u2728"
105
76
  },
106
- scope: {
107
- description: "What is the scope of this change (e.g. component or file name)"
77
+ fix: {
78
+ description: "A bug fix",
79
+ title: "Bug Fixes",
80
+ emoji: "\u{1F41B}"
108
81
  },
109
- subject: {
110
- description: "Write a short, imperative tense description of the change"
82
+ docs: {
83
+ description: "Documentation only changes",
84
+ title: "Documentation",
85
+ emoji: "\u{1F4DA}"
111
86
  },
112
- body: {
113
- description: "Provide a longer description of the change"
87
+ style: {
88
+ description: "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",
89
+ title: "Styles",
90
+ emoji: "\u{1F48E}"
114
91
  },
115
- isBreaking: {
116
- description: "Are there any breaking changes?"
92
+ refactor: {
93
+ description: "A code change that neither fixes a bug nor adds a feature",
94
+ title: "Code Refactoring",
95
+ emoji: "\u{1F4E6}"
117
96
  },
118
- breakingBody: {
119
- description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself"
97
+ perf: {
98
+ description: "A code change that improves performance",
99
+ title: "Performance Improvements",
100
+ emoji: "\u{1F680}"
120
101
  },
121
- breaking: {
122
- description: "Describe the breaking changes"
102
+ test: {
103
+ description: "Adding missing tests or correcting existing tests",
104
+ title: "Tests",
105
+ emoji: "\u{1F6A8}"
123
106
  },
124
- isIssueAffected: {
125
- description: "Does this change affect any open issues?"
107
+ build: {
108
+ description: "Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)",
109
+ title: "Builds",
110
+ emoji: "\u{1F6E0}"
126
111
  },
127
- issuesBody: {
128
- description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself"
112
+ ci: {
113
+ description: "Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)",
114
+ title: "Continuous Integrations",
115
+ emoji: "\u2699\uFE0F"
129
116
  },
130
- issues: {
131
- description: 'Add issue references (e.g. "fix #123", "re #123".)'
117
+ chore: {
118
+ description: "Other changes that don't modify src or test files",
119
+ title: "Chores",
120
+ emoji: "\u267B\uFE0F"
121
+ },
122
+ revert: {
123
+ description: "Reverts a previous commit",
124
+ title: "Reverts",
125
+ emoji: "\u{1F5D1}"
132
126
  }
133
127
  }
128
+ },
129
+ scope: {
130
+ description: "What is the scope of this change (e.g. component or file name)"
131
+ },
132
+ subject: {
133
+ description: "Write a short, imperative tense description of the change"
134
+ },
135
+ body: {
136
+ description: "Provide a longer description of the change"
137
+ },
138
+ isBreaking: {
139
+ description: "Are there any breaking changes?"
140
+ },
141
+ breakingBody: {
142
+ description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself"
143
+ },
144
+ breaking: {
145
+ description: "Describe the breaking changes"
146
+ },
147
+ isIssueAffected: {
148
+ description: "Does this change affect any open issues?"
149
+ },
150
+ issuesBody: {
151
+ description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself"
152
+ },
153
+ issues: {
154
+ description: 'Add issue references (e.g. "fix #123", "re #123".)'
134
155
  }
135
- };
156
+ }
136
157
  }
137
- });
158
+ };
138
159
 
139
- // src/messages.js
140
- var require_messages = __commonJS({
141
- "src/messages.js"(exports2, module2) {
142
- module2.exports = {
143
- MISSING_JIRA_REFERENCE: `subject should contain JIRA reference in the form of "(fixes XY-123)" or "(refs XY-123)"`
144
- };
145
- }
146
- });
160
+ // src/messages.ts
161
+ var messages_default = {
162
+ MISSING_JIRA_REFERENCE: `subject should contain JIRA reference in the form of "(fixes XY-123)" or "(refs XY-123)"`
163
+ };
147
164
 
148
- // src/config/default.js
149
- var path = require("path");
150
- var preset = require_config_conventional();
151
- var messages = require_messages();
152
- var distDir = path.join(__dirname, "..");
153
- module.exports = {
154
- parserPreset: path.join(distDir, "parser.js"),
155
- formatter: path.join(distDir, "format.js"),
156
- prompt: preset.prompt,
165
+ // src/config/default.ts
166
+ var config = {
167
+ parserPreset: fileURLToPath(new URL("../parser.js", import.meta.url)),
168
+ formatter: fileURLToPath(new URL("../format.js", import.meta.url)),
169
+ prompt: lib_default.prompt,
157
170
  rules: {
158
- ...preset.rules,
171
+ ...lib_default.rules,
159
172
  /* the changelog is included with the commits by semantic-release and
160
173
  * contains quite long lines and we don't really consider the body format to
161
174
  * be important so we disable max length (header still applies) */
@@ -169,11 +182,15 @@ module.exports = {
169
182
  "jira-reference": ({ subject }) => {
170
183
  const jira = /\((refs|fixes) [A-Z]+-[0-9]+\)$/;
171
184
  return [
172
- subject && subject.match(jira),
173
- messages.MISSING_JIRA_REFERENCE
185
+ Boolean(subject && subject.match(jira)),
186
+ messages_default.MISSING_JIRA_REFERENCE
174
187
  ];
175
188
  }
176
189
  }
177
190
  }
178
191
  ]
179
192
  };
193
+ var default_default = config;
194
+ export {
195
+ default_default as default
196
+ };