@w5s/commitlint-config 2.0.26 → 2.0.27

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/dist/index.cjs ADDED
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ var types = require('@commitlint/types');
4
+ var Changelog = require('@w5s/conventional-changelog');
5
+
6
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
7
+
8
+ var Changelog__default = /*#__PURE__*/_interopDefault(Changelog);
9
+
10
+ // src/index.ts
11
+ var $if = (when = "always") => (cond) => when === "always" ? cond : !cond;
12
+ var typeGitmojiStyle = (parsed, when = "always", value = "unicode") => {
13
+ const isUnicode = parsed.type != null && Changelog__default.default.Emoji.isUnicode(parsed.type);
14
+ const isEmoji = parsed.type != null && Changelog__default.default.Emoji.isText(parsed.type);
15
+ return value === "unicode" ? $if(when)(isUnicode) ? [true] : [false, `Type should ${when} be an unicode character`] : $if(when)(isEmoji) ? [true] : [false, `Type should ${when} be an valid :emoji:`];
16
+ };
17
+ var typeValidGitmoji = (parsed, when = "always") => {
18
+ const isValidGitmoji = parsed.type != null && Changelog__default.default.GitmojiCode.isValid(parsed.type);
19
+ return $if(when)(isValidGitmoji) ? [true] : [false, `Type should ${when} be an valid gitmoji (see https://gitmoji.dev)`];
20
+ };
21
+ var gitmojiPlugin = {
22
+ rules: {
23
+ "type-gitmoji-style": typeGitmojiStyle,
24
+ "type-valid-gitmoji": typeValidGitmoji
25
+ }
26
+ };
27
+
28
+ // src/index.ts
29
+ var { Error, Warning, Disabled } = types.RuleConfigSeverity;
30
+ var parserPreset = {
31
+ parserOpts: Changelog__default.default.parserOpts
32
+ };
33
+ var rules = {
34
+ "body-leading-blank": [Warning, "always"],
35
+ "body-max-line-length": [Error, "always", 100],
36
+ "footer-leading-blank": [Warning, "always"],
37
+ "footer-max-line-length": [Error, "always", 100],
38
+ "header-max-length": [Error, "always", 100],
39
+ "scope-case": [Error, "always", "lower-case"],
40
+ "subject-case": [Error, "always", ["sentence-case"]],
41
+ "subject-empty": [Error, "never"],
42
+ "subject-exclamation-mark": [Error, "never"],
43
+ "subject-full-stop": [Error, "never", "."],
44
+ "type-case": [Error, "always", "lower-case"],
45
+ "type-empty": [Error, "never"],
46
+ "type-enum": [Disabled],
47
+ "type-gitmoji-style": [Error, "always", "unicode"],
48
+ "type-valid-gitmoji": [Error, "always"]
49
+ };
50
+ var config = {
51
+ parserPreset,
52
+ rules,
53
+ plugins: [gitmojiPlugin]
54
+ };
55
+ var src_default = config;
56
+
57
+ module.exports = src_default;
58
+ //# sourceMappingURL=index.cjs.map
59
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin.ts","../src/index.ts"],"names":["Changelog","RuleConfigSeverity","conventionalChangelog"],"mappings":";;;;;;;;;;AAGA,IAAM,GAAA,GACJ,CAAC,IAAwC,GAAA,QAAA,KACzC,CAAC,IACC,KAAA,IAAA,KAAS,QAAW,GAAA,IAAA,GAAO,CAAC,IAAA,CAAA;AAEzB,IAAM,mBAA8C,CAAC,MAAA,EAAQ,IAAO,GAAA,QAAA,EAAU,QAAQ,SAAc,KAAA;AACzG,EAAM,MAAA,SAAA,GAAY,OAAO,IAAQ,IAAA,IAAA,IAAQA,2BAAU,KAAM,CAAA,SAAA,CAAU,OAAO,IAAI,CAAA,CAAA;AAC9E,EAAM,MAAA,OAAA,GAAU,OAAO,IAAQ,IAAA,IAAA,IAAQA,2BAAU,KAAM,CAAA,MAAA,CAAO,OAAO,IAAI,CAAA,CAAA;AAEzE,EAAA,OAAO,KAAU,KAAA,SAAA,GACb,GAAI,CAAA,IAAI,CAAE,CAAA,SAAS,CACjB,GAAA,CAAC,IAAI,CAAA,GACL,CAAC,KAAA,EAAO,CAAe,YAAA,EAAA,IAAI,CAA0B,wBAAA,CAAA,CAAA,GACvD,GAAI,CAAA,IAAI,CAAE,CAAA,OAAO,CACf,GAAA,CAAC,IAAI,CAAA,GACL,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AAU,EAAA,CAAC,eAAe,CAAC,CAAA;AAAA,EACnD,eAAA,EAAiB,CAAC,KAAA,EAAO,OAAO,CAAA;AAAA,EAChC,0BAAA,EAA4B,CAAC,KAAA,EAAO,OAAO,CAAA;AAAA,EAC3C,mBAAqB,EAAA,CAAC,KAAO,EAAA,OAAA,EAAS,GAAG,CAAA;AAAA,EACzC,WAAa,EAAA,CAAC,KAAO,EAAA,QAAA,EAAU,YAAY,CAAA;AAAA,EAC3C,YAAA,EAAc,CAAC,KAAA,EAAO,OAAO,CAAA;AAAA,EAC7B,WAAA,EAAa,CAAC,QAAQ,CAAA;AAAA,EACtB,oBAAsB,EAAA,CAAC,KAAO,EAAA,QAAA,EAAU,SAAS,CAAA;AAAA,EACjD,oBAAA,EAAsB,CAAC,KAAA,EAAO,QAAQ,CAAA;AACxC,CAAA,CAAA;AAEA,IAAM,MAAS,GAAA;AAAA,EACb,YAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA,EAAS,CAAC,aAAa,CAAA;AACzB,CAAA,CAAA;AAEA,IAAO,WAAQ,GAAA","file":"index.cjs","sourcesContent":["import type { Plugin, Rule, RuleConfigCondition } from '@commitlint/types';\nimport Changelog from '@w5s/conventional-changelog';\n\nconst $if =\n (when: RuleConfigCondition | undefined = 'always') =>\n (cond: boolean) =>\n when === 'always' ? cond : !cond;\n\nexport const typeGitmojiStyle: Rule<'unicode' | 'emoji'> = (parsed, when = 'always', value = 'unicode') => {\n const isUnicode = parsed.type != null && Changelog.Emoji.isUnicode(parsed.type);\n const isEmoji = parsed.type != null && Changelog.Emoji.isText(parsed.type);\n\n return value === 'unicode'\n ? $if(when)(isUnicode)\n ? [true]\n : [false, `Type should ${when} be an unicode character`]\n : $if(when)(isEmoji)\n ? [true]\n : [false, `Type should ${when} be an valid :emoji:`];\n};\n\nexport const typeValidGitmoji: Rule = (parsed, when = 'always') => {\n const isValidGitmoji = parsed.type != null && Changelog.GitmojiCode.isValid(parsed.type);\n\n return $if(when)(isValidGitmoji)\n ? [true]\n : [false, `Type should ${when} be an valid gitmoji (see https://gitmoji.dev)`];\n};\n\n/**\n * Gitmoji plugins\n */\nexport const gitmojiPlugin: Plugin = {\n rules: {\n 'type-gitmoji-style': typeGitmojiStyle,\n 'type-valid-gitmoji': typeValidGitmoji,\n },\n};\n","import { RuleConfigSeverity, type QualifiedRules, type LintOptions } from '@commitlint/types';\nimport conventionalChangelog from '@w5s/conventional-changelog';\nimport { gitmojiPlugin } from './plugin.js';\n\nconst { Error, Warning, Disabled } = RuleConfigSeverity;\n\nconst parserPreset: LintOptions = {\n parserOpts: conventionalChangelog.parserOpts as LintOptions['parserOpts'],\n};\n\nconst rules: QualifiedRules = {\n 'body-leading-blank': [Warning, 'always'],\n 'body-max-line-length': [Error, 'always', 100],\n 'footer-leading-blank': [Warning, 'always'],\n 'footer-max-line-length': [Error, 'always', 100],\n 'header-max-length': [Error, 'always', 100],\n 'scope-case': [Error, 'always', 'lower-case'],\n 'subject-case': [Error, 'always', ['sentence-case']],\n 'subject-empty': [Error, 'never'],\n 'subject-exclamation-mark': [Error, 'never'],\n 'subject-full-stop': [Error, 'never', '.'],\n 'type-case': [Error, 'always', 'lower-case'],\n 'type-empty': [Error, 'never'],\n 'type-enum': [Disabled],\n 'type-gitmoji-style': [Error, 'always', 'unicode'],\n 'type-valid-gitmoji': [Error, 'always'],\n};\n\nconst config = {\n parserPreset,\n rules,\n plugins: [gitmojiPlugin],\n};\n\nexport default config;\n"]}
@@ -0,0 +1,10 @@
1
+ import * as _commitlint_types from '@commitlint/types';
2
+ import { LintOptions } from '@commitlint/types';
3
+
4
+ declare const config: {
5
+ parserPreset: LintOptions;
6
+ rules: Partial<_commitlint_types.RulesConfig<_commitlint_types.RuleConfigQuality.Qualified>>;
7
+ plugins: _commitlint_types.Plugin[];
8
+ };
9
+
10
+ export { config as default };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
- import { type LintOptions } from '@commitlint/types';
1
+ import * as _commitlint_types from '@commitlint/types';
2
+ import { LintOptions } from '@commitlint/types';
3
+
2
4
  declare const config: {
3
5
  parserPreset: LintOptions;
4
- rules: Partial<import("@commitlint/types").RulesConfig<import("@commitlint/types").RuleConfigQuality.Qualified>>;
5
- plugins: import("@commitlint/types").Plugin[];
6
+ rules: Partial<_commitlint_types.RulesConfig<_commitlint_types.RuleConfigQuality.Qualified>>;
7
+ plugins: _commitlint_types.Plugin[];
6
8
  };
7
- export default config;
9
+
10
+ export { config as default };
package/dist/index.js CHANGED
@@ -1,35 +1,53 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
1
+ import { RuleConfigSeverity } from '@commitlint/types';
2
+ import Changelog from '@w5s/conventional-changelog';
3
+
4
+ // src/index.ts
5
+ var $if = (when = "always") => (cond) => when === "always" ? cond : !cond;
6
+ var typeGitmojiStyle = (parsed, when = "always", value = "unicode") => {
7
+ const isUnicode = parsed.type != null && Changelog.Emoji.isUnicode(parsed.type);
8
+ const isEmoji = parsed.type != null && Changelog.Emoji.isText(parsed.type);
9
+ return value === "unicode" ? $if(when)(isUnicode) ? [true] : [false, `Type should ${when} be an unicode character`] : $if(when)(isEmoji) ? [true] : [false, `Type should ${when} be an valid :emoji:`];
4
10
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const types_1 = require("@commitlint/types");
7
- const conventional_changelog_1 = __importDefault(require("@w5s/conventional-changelog"));
8
- const plugin_js_1 = require("./plugin.js");
9
- const { Error, Warning, Disabled } = types_1.RuleConfigSeverity;
10
- const parserPreset = {
11
- parserOpts: conventional_changelog_1.default.parserOpts,
11
+ var typeValidGitmoji = (parsed, when = "always") => {
12
+ const isValidGitmoji = parsed.type != null && Changelog.GitmojiCode.isValid(parsed.type);
13
+ return $if(when)(isValidGitmoji) ? [true] : [false, `Type should ${when} be an valid gitmoji (see https://gitmoji.dev)`];
12
14
  };
13
- const rules = {
14
- 'body-leading-blank': [Warning, 'always'],
15
- 'body-max-line-length': [Error, 'always', 100],
16
- 'footer-leading-blank': [Warning, 'always'],
17
- 'footer-max-line-length': [Error, 'always', 100],
18
- 'header-max-length': [Error, 'always', 100],
19
- 'scope-case': [Error, 'always', 'lower-case'],
20
- 'subject-case': [Error, 'always', ['sentence-case']],
21
- 'subject-empty': [Error, 'never'],
22
- 'subject-exclamation-mark': [Error, 'never'],
23
- 'subject-full-stop': [Error, 'never', '.'],
24
- 'type-case': [Error, 'always', 'lower-case'],
25
- 'type-empty': [Error, 'never'],
26
- 'type-enum': [Disabled],
27
- 'type-gitmoji-style': [Error, 'always', 'unicode'],
28
- 'type-valid-gitmoji': [Error, 'always'],
15
+ var gitmojiPlugin = {
16
+ rules: {
17
+ "type-gitmoji-style": typeGitmojiStyle,
18
+ "type-valid-gitmoji": typeValidGitmoji
19
+ }
29
20
  };
30
- const config = {
31
- parserPreset,
32
- rules,
33
- plugins: [plugin_js_1.gitmojiPlugin],
21
+
22
+ // src/index.ts
23
+ var { Error, Warning, Disabled } = RuleConfigSeverity;
24
+ var parserPreset = {
25
+ parserOpts: Changelog.parserOpts
34
26
  };
35
- exports.default = config;
27
+ var rules = {
28
+ "body-leading-blank": [Warning, "always"],
29
+ "body-max-line-length": [Error, "always", 100],
30
+ "footer-leading-blank": [Warning, "always"],
31
+ "footer-max-line-length": [Error, "always", 100],
32
+ "header-max-length": [Error, "always", 100],
33
+ "scope-case": [Error, "always", "lower-case"],
34
+ "subject-case": [Error, "always", ["sentence-case"]],
35
+ "subject-empty": [Error, "never"],
36
+ "subject-exclamation-mark": [Error, "never"],
37
+ "subject-full-stop": [Error, "never", "."],
38
+ "type-case": [Error, "always", "lower-case"],
39
+ "type-empty": [Error, "never"],
40
+ "type-enum": [Disabled],
41
+ "type-gitmoji-style": [Error, "always", "unicode"],
42
+ "type-valid-gitmoji": [Error, "always"]
43
+ };
44
+ var config = {
45
+ parserPreset,
46
+ rules,
47
+ plugins: [gitmojiPlugin]
48
+ };
49
+ var src_default = config;
50
+
51
+ export { src_default as default };
52
+ //# sourceMappingURL=index.js.map
53
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin.ts","../src/index.ts"],"names":["conventionalChangelog"],"mappings":";;;;AAGA,IAAM,GAAA,GACJ,CAAC,IAAwC,GAAA,QAAA,KACzC,CAAC,IACC,KAAA,IAAA,KAAS,QAAW,GAAA,IAAA,GAAO,CAAC,IAAA,CAAA;AAEzB,IAAM,mBAA8C,CAAC,MAAA,EAAQ,IAAO,GAAA,QAAA,EAAU,QAAQ,SAAc,KAAA;AACzG,EAAM,MAAA,SAAA,GAAY,OAAO,IAAQ,IAAA,IAAA,IAAQ,UAAU,KAAM,CAAA,SAAA,CAAU,OAAO,IAAI,CAAA,CAAA;AAC9E,EAAM,MAAA,OAAA,GAAU,OAAO,IAAQ,IAAA,IAAA,IAAQ,UAAU,KAAM,CAAA,MAAA,CAAO,OAAO,IAAI,CAAA,CAAA;AAEzE,EAAA,OAAO,KAAU,KAAA,SAAA,GACb,GAAI,CAAA,IAAI,CAAE,CAAA,SAAS,CACjB,GAAA,CAAC,IAAI,CAAA,GACL,CAAC,KAAA,EAAO,CAAe,YAAA,EAAA,IAAI,CAA0B,wBAAA,CAAA,CAAA,GACvD,GAAI,CAAA,IAAI,CAAE,CAAA,OAAO,CACf,GAAA,CAAC,IAAI,CAAA,GACL,CAAC,KAAA,EAAO,CAAe,YAAA,EAAA,IAAI,CAAsB,oBAAA,CAAA,CAAA,CAAA;AACzD,CAAA,CAAA;AAEO,IAAM,gBAAyB,GAAA,CAAC,MAAQ,EAAA,IAAA,GAAO,QAAa,KAAA;AACjE,EAAM,MAAA,cAAA,GAAiB,OAAO,IAAQ,IAAA,IAAA,IAAQ,UAAU,WAAY,CAAA,OAAA,CAAQ,OAAO,IAAI,CAAA,CAAA;AAEvF,EAAA,OAAO,GAAI,CAAA,IAAI,CAAE,CAAA,cAAc,CAC3B,GAAA,CAAC,IAAI,CAAA,GACL,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CAAA;AAAA,EACtB,oBAAsB,EAAA,CAAC,KAAO,EAAA,QAAA,EAAU,SAAS,CAAA;AAAA,EACjD,oBAAA,EAAsB,CAAC,KAAA,EAAO,QAAQ,CAAA;AACxC,CAAA,CAAA;AAEA,IAAM,MAAS,GAAA;AAAA,EACb,YAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA,EAAS,CAAC,aAAa,CAAA;AACzB,CAAA,CAAA;AAEA,IAAO,WAAQ,GAAA","file":"index.js","sourcesContent":["import type { Plugin, Rule, RuleConfigCondition } from '@commitlint/types';\nimport Changelog from '@w5s/conventional-changelog';\n\nconst $if =\n (when: RuleConfigCondition | undefined = 'always') =>\n (cond: boolean) =>\n when === 'always' ? cond : !cond;\n\nexport const typeGitmojiStyle: Rule<'unicode' | 'emoji'> = (parsed, when = 'always', value = 'unicode') => {\n const isUnicode = parsed.type != null && Changelog.Emoji.isUnicode(parsed.type);\n const isEmoji = parsed.type != null && Changelog.Emoji.isText(parsed.type);\n\n return value === 'unicode'\n ? $if(when)(isUnicode)\n ? [true]\n : [false, `Type should ${when} be an unicode character`]\n : $if(when)(isEmoji)\n ? [true]\n : [false, `Type should ${when} be an valid :emoji:`];\n};\n\nexport const typeValidGitmoji: Rule = (parsed, when = 'always') => {\n const isValidGitmoji = parsed.type != null && Changelog.GitmojiCode.isValid(parsed.type);\n\n return $if(when)(isValidGitmoji)\n ? [true]\n : [false, `Type should ${when} be an valid gitmoji (see https://gitmoji.dev)`];\n};\n\n/**\n * Gitmoji plugins\n */\nexport const gitmojiPlugin: Plugin = {\n rules: {\n 'type-gitmoji-style': typeGitmojiStyle,\n 'type-valid-gitmoji': typeValidGitmoji,\n },\n};\n","import { RuleConfigSeverity, type QualifiedRules, type LintOptions } from '@commitlint/types';\nimport conventionalChangelog from '@w5s/conventional-changelog';\nimport { gitmojiPlugin } from './plugin.js';\n\nconst { Error, Warning, Disabled } = RuleConfigSeverity;\n\nconst parserPreset: LintOptions = {\n parserOpts: conventionalChangelog.parserOpts as LintOptions['parserOpts'],\n};\n\nconst rules: QualifiedRules = {\n 'body-leading-blank': [Warning, 'always'],\n 'body-max-line-length': [Error, 'always', 100],\n 'footer-leading-blank': [Warning, 'always'],\n 'footer-max-line-length': [Error, 'always', 100],\n 'header-max-length': [Error, 'always', 100],\n 'scope-case': [Error, 'always', 'lower-case'],\n 'subject-case': [Error, 'always', ['sentence-case']],\n 'subject-empty': [Error, 'never'],\n 'subject-exclamation-mark': [Error, 'never'],\n 'subject-full-stop': [Error, 'never', '.'],\n 'type-case': [Error, 'always', 'lower-case'],\n 'type-empty': [Error, 'never'],\n 'type-enum': [Disabled],\n 'type-gitmoji-style': [Error, 'always', 'unicode'],\n 'type-valid-gitmoji': [Error, 'always'],\n};\n\nconst config = {\n parserPreset,\n rules,\n plugins: [gitmojiPlugin],\n};\n\nexport default config;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/commitlint-config",
3
- "version": "2.0.26",
3
+ "version": "2.0.27",
4
4
  "description": "Commitlint configuration presets",
5
5
  "keywords": [
6
6
  "commitlint",
@@ -18,9 +18,18 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "author": "Julien Polo <julien.polo@gmail.com>",
21
- "type": "commonjs",
21
+ "type": "module",
22
22
  "exports": {
23
- ".": "./index.js",
23
+ ".": {
24
+ "require": {
25
+ "types": "./dist/index.d.cts",
26
+ "default": "./dist/index.cjs"
27
+ },
28
+ "import": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ }
32
+ },
24
33
  "./dist/*": "./dist/*"
25
34
  },
26
35
  "typings": "./index.d.ts",
@@ -38,7 +47,7 @@
38
47
  },
39
48
  "dependencies": {
40
49
  "@commitlint/types": "^18.0.0",
41
- "@w5s/conventional-changelog": "^2.0.24"
50
+ "@w5s/conventional-changelog": "^2.0.25"
42
51
  },
43
52
  "peerDependencies": {
44
53
  "@commitlint/cli": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
@@ -54,5 +63,6 @@
54
63
  "publishConfig": {
55
64
  "access": "public"
56
65
  },
57
- "gitHead": "966ebbb065df3e68092eb80c3ff2c15858989edb"
66
+ "sideEffect": false,
67
+ "gitHead": "9a8e28010a7d06e5ff4672fa4f2f4b8368706cdf"
58
68
  }
package/src/plugin.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Plugin, Rule, RuleConfigCondition } from '@commitlint/types';
2
- import { Emoji, GitmojiCode } from '@w5s/conventional-changelog';
2
+ import Changelog from '@w5s/conventional-changelog';
3
3
 
4
4
  const $if =
5
5
  (when: RuleConfigCondition | undefined = 'always') =>
@@ -7,8 +7,8 @@ const $if =
7
7
  when === 'always' ? cond : !cond;
8
8
 
9
9
  export const typeGitmojiStyle: Rule<'unicode' | 'emoji'> = (parsed, when = 'always', value = 'unicode') => {
10
- const isUnicode = parsed.type != null && Emoji.isUnicode(parsed.type);
11
- const isEmoji = parsed.type != null && Emoji.isText(parsed.type);
10
+ const isUnicode = parsed.type != null && Changelog.Emoji.isUnicode(parsed.type);
11
+ const isEmoji = parsed.type != null && Changelog.Emoji.isText(parsed.type);
12
12
 
13
13
  return value === 'unicode'
14
14
  ? $if(when)(isUnicode)
@@ -20,7 +20,7 @@ export const typeGitmojiStyle: Rule<'unicode' | 'emoji'> = (parsed, when = 'alwa
20
20
  };
21
21
 
22
22
  export const typeValidGitmoji: Rule = (parsed, when = 'always') => {
23
- const isValidGitmoji = parsed.type != null && GitmojiCode.isValid(parsed.type);
23
+ const isValidGitmoji = parsed.type != null && Changelog.GitmojiCode.isValid(parsed.type);
24
24
 
25
25
  return $if(when)(isValidGitmoji)
26
26
  ? [true]
package/dist/plugin.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { Plugin, Rule } from '@commitlint/types';
2
- export declare const typeGitmojiStyle: Rule<'unicode' | 'emoji'>;
3
- export declare const typeValidGitmoji: Rule;
4
- /**
5
- * Gitmoji plugins
6
- */
7
- export declare const gitmojiPlugin: Plugin;
package/dist/plugin.js DELETED
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gitmojiPlugin = exports.typeValidGitmoji = exports.typeGitmojiStyle = void 0;
4
- const conventional_changelog_1 = require("@w5s/conventional-changelog");
5
- const $if = (when = 'always') => (cond) => when === 'always' ? cond : !cond;
6
- const typeGitmojiStyle = (parsed, when = 'always', value = 'unicode') => {
7
- const isUnicode = parsed.type != null && conventional_changelog_1.Emoji.isUnicode(parsed.type);
8
- const isEmoji = parsed.type != null && conventional_changelog_1.Emoji.isText(parsed.type);
9
- return value === 'unicode'
10
- ? $if(when)(isUnicode)
11
- ? [true]
12
- : [false, `Type should ${when} be an unicode character`]
13
- : $if(when)(isEmoji)
14
- ? [true]
15
- : [false, `Type should ${when} be an valid :emoji:`];
16
- };
17
- exports.typeGitmojiStyle = typeGitmojiStyle;
18
- const typeValidGitmoji = (parsed, when = 'always') => {
19
- const isValidGitmoji = parsed.type != null && conventional_changelog_1.GitmojiCode.isValid(parsed.type);
20
- return $if(when)(isValidGitmoji)
21
- ? [true]
22
- : [false, `Type should ${when} be an valid gitmoji (see https://gitmoji.dev)`];
23
- };
24
- exports.typeValidGitmoji = typeValidGitmoji;
25
- /**
26
- * Gitmoji plugins
27
- */
28
- exports.gitmojiPlugin = {
29
- rules: {
30
- 'type-gitmoji-style': exports.typeGitmojiStyle,
31
- 'type-valid-gitmoji': exports.typeValidGitmoji,
32
- },
33
- };
@@ -1 +0,0 @@
1
- {"root":["../src/index.ts","../src/plugin.ts"],"version":"5.6.2"}
package/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import Config from './dist/index.js';
2
-
3
- export = Config;
package/index.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./dist/index.js').default;