@w5s/commitlint-config 2.1.9 → 2.1.11

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.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import * as _commitlint_types from '@commitlint/types';
2
- import { LintOptions } from '@commitlint/types';
3
2
 
4
3
  declare const config: {
5
4
  parserPreset: {
6
- parserOpts: Exclude<LintOptions["parserOpts"], undefined>;
5
+ parserOpts: any;
7
6
  };
8
7
  rules: Partial<_commitlint_types.RulesConfig<_commitlint_types.RuleConfigQuality.Qualified>>;
9
8
  plugins: _commitlint_types.Plugin[];
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { RuleConfigSeverity } from '@commitlint/types';
2
- import Changelog from '@w5s/conventional-changelog';
2
+ import conventionalChangelogPreset, { Emoji, GitmojiCode } from '@w5s/conventional-changelog';
3
3
 
4
4
  // src/index.ts
5
5
  var $if = (when = "always") => (cond) => when === "always" ? cond : !cond;
6
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);
7
+ const isUnicode = parsed.type != null && Emoji.isUnicode(parsed.type);
8
+ const isEmoji = parsed.type != null && Emoji.isText(parsed.type);
9
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:`];
10
10
  };
11
11
  var typeValidGitmoji = (parsed, when = "always") => {
12
- const isValidGitmoji = parsed.type != null && Changelog.GitmojiCode.isValid(parsed.type);
12
+ const isValidGitmoji = parsed.type != null && GitmojiCode.isValid(parsed.type);
13
13
  return $if(when)(isValidGitmoji) ? [true] : [false, `Type should ${when} be an valid gitmoji (see https://gitmoji.dev)`];
14
14
  };
15
15
  var gitmojiPlugin = {
@@ -22,7 +22,8 @@ var gitmojiPlugin = {
22
22
  // src/index.ts
23
23
  var { Error, Warning, Disabled } = RuleConfigSeverity;
24
24
  var parserPreset = {
25
- parserOpts: Changelog.parserOpts
25
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, unicorn/no-await-expression-member, @typescript-eslint/no-unsafe-member-access
26
+ parserOpts: (await conventionalChangelogPreset()).parser
26
27
  };
27
28
  var rules = {
28
29
  "body-leading-blank": [Warning, "always"],
package/dist/index.js.map CHANGED
@@ -1 +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;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;AAC9E,EAAM,MAAA,OAAA,GAAU,OAAO,IAAQ,IAAA,IAAA,IAAQ,UAAU,KAAM,CAAA,MAAA,CAAO,OAAO,IAAI,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;AACzD,CAAA;AAEO,IAAM,gBAAyB,GAAA,CAAC,MAAQ,EAAA,IAAA,GAAO,QAAa,KAAA;AACjE,EAAM,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a,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;AACxC,CAAA;AAEA,IAAM,MAAS,GAAA;AAAA,EACb,YAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA,EAAS,CAAC,aAAa;AACzB,CAAA;AAGA,IAAO,aAAQ,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 = {\n parserOpts: conventionalChangelog.parserOpts as Exclude<LintOptions['parserOpts'], undefined>,\n} satisfies LintOptions;\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\n// eslint-disable-next-line import/no-default-export\nexport default config;\n"]}
1
+ {"version":3,"sources":["../src/plugin.ts","../src/index.ts"],"names":[],"mappings":";;;;AAGA,IAAM,GAAA,GACJ,CAAC,IAAA,GAAwC,QAAA,KACzC,CAAC,IAAA,KACC,IAAA,KAAS,QAAA,GAAW,IAAA,GAAO,CAAC,IAAA;AAEzB,IAAM,mBAA8C,CAAC,MAAA,EAAQ,IAAA,GAAO,QAAA,EAAU,QAAQ,SAAA,KAAc;AACzG,EAAA,MAAM,YAAY,MAAA,CAAO,IAAA,IAAQ,QAAQ,KAAA,CAAM,SAAA,CAAU,OAAO,IAAI,CAAA;AACpE,EAAA,MAAM,UAAU,MAAA,CAAO,IAAA,IAAQ,QAAQ,KAAA,CAAM,MAAA,CAAO,OAAO,IAAI,CAAA;AAE/D,EAAA,OAAO,KAAA,KAAU,SAAA,GACb,GAAA,CAAI,IAAI,CAAA,CAAE,SAAS,CA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,EAAU,GAAG,CAAA;AAAA,EAC1C,YAAA,EAAc,CAAC,KAAA,EAAO,QAAA,EAAU,YAAY,CAAA;AAAA,EAC5C,gBAAgB,CAAC,KAAA,EAAO,QAAA,EAAU,CAAC,eAAe,CAAC,CAAA;AAAA,EACnD,eAAA,EAAiB,CAAC,KAAA,EAAO,OAAO,CAAA;AAAA,EAChC,0BAAA,EAA4B,CAAC,KAAA,EAAO,OAAO,CAAA;AAAA,EAC3C,mBAAA,EAAqB,CAAC,KAAA,EAAO,OAAA,EAAS,GAAG,CAAA;AAAA,EACzC,WAAA,EAAa,CAAC,KAAA,EAAO,QAAA,EAAU,YAAY,CAAA;AAAA,EAC3C,YAAA,EAAc,CAAC,KAAA,EAAO,OAAO,CAAA;AAAA,EAC7B,WAAA,EAAa,CAAC,QAAQ,CAAA;AAAA,EACtB,oBAAA,EAAsB,CAAC,KAAA,EAAO,QAAA,EAAU,SAAS,CAAA;AAAA,EACjD,oBAAA,EAAsB,CAAC,KAAA,EAAO,QAAQ;AACxC,CAAA;AAEA,IAAM,MAAA,GAAS;AAAA,EACb,YAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA,EAAS,CAAC,aAAa;AACzB,CAAA;AAGA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["import type { Plugin, Rule, RuleConfigCondition } from '@commitlint/types';\nimport { Emoji, GitmojiCode } 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 && Emoji.isUnicode(parsed.type);\n const isEmoji = parsed.type != null && 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 && 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 conventionalChangelogPreset from '@w5s/conventional-changelog';\nimport { gitmojiPlugin } from './plugin.js';\n\nconst { Error, Warning, Disabled } = RuleConfigSeverity;\n\nconst parserPreset = {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, unicorn/no-await-expression-member, @typescript-eslint/no-unsafe-member-access\n parserOpts: (await conventionalChangelogPreset()).parser as any,\n} satisfies LintOptions;\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\n// eslint-disable-next-line import/no-default-export\nexport default config;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/commitlint-config",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "description": "Commitlint configuration presets",
5
5
  "keywords": [
6
6
  "commitlint",
@@ -47,7 +47,7 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@commitlint/types": "^19.0.0",
50
- "@w5s/conventional-changelog": "^2.2.2"
50
+ "@w5s/conventional-changelog": "^2.2.4"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@commitlint/cli": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
@@ -64,5 +64,5 @@
64
64
  "access": "public"
65
65
  },
66
66
  "sideEffect": false,
67
- "gitHead": "4617d8f7fa8546c928dcb225e5a2735302ce1c85"
67
+ "gitHead": "e50ce223ae442c3c06efe68aae22809092184290"
68
68
  }
package/src/index.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import { RuleConfigSeverity, type QualifiedRules, type LintOptions } from '@commitlint/types';
2
- import conventionalChangelog from '@w5s/conventional-changelog';
2
+ import conventionalChangelogPreset from '@w5s/conventional-changelog';
3
3
  import { gitmojiPlugin } from './plugin.js';
4
4
 
5
5
  const { Error, Warning, Disabled } = RuleConfigSeverity;
6
6
 
7
7
  const parserPreset = {
8
- parserOpts: conventionalChangelog.parserOpts as Exclude<LintOptions['parserOpts'], undefined>,
8
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, unicorn/no-await-expression-member, @typescript-eslint/no-unsafe-member-access
9
+ parserOpts: (await conventionalChangelogPreset()).parser as any,
9
10
  } satisfies LintOptions;
10
11
 
11
12
  const rules: QualifiedRules = {
package/src/plugin.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { Plugin, Rule, RuleConfigCondition } from '@commitlint/types';
2
- import Changelog from '@w5s/conventional-changelog';
2
+ import { Emoji, GitmojiCode } 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 && Changelog.Emoji.isUnicode(parsed.type);
11
- const isEmoji = parsed.type != null && Changelog.Emoji.isText(parsed.type);
10
+ const isUnicode = parsed.type != null && Emoji.isUnicode(parsed.type);
11
+ const isEmoji = parsed.type != null && 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 && Changelog.GitmojiCode.isValid(parsed.type);
23
+ const isValidGitmoji = parsed.type != null && GitmojiCode.isValid(parsed.type);
24
24
 
25
25
  return $if(when)(isValidGitmoji)
26
26
  ? [true]