|
| 1 | +/** |
| 2 | + * @file Interfaces - Config |
| 3 | + * @module commitlint-config/interfaces/Config |
| 4 | + */ |
| 5 | + |
| 6 | +import type { ParserPreset } from '#src/types' |
| 7 | +import type * as commitlint from '@commitlint/types' |
| 8 | +import type PromptConfig from './config-prompt' |
| 9 | +import type RulesConfig from './config-rules' |
| 10 | + |
| 11 | +/** |
| 12 | + * Object representing `commitlint` configuration for [Flex Development][1]. |
| 13 | + * |
| 14 | + * [1]: https://flexdevelopment.llc |
| 15 | + * |
| 16 | + * @see https://commitlint.js.org/#/reference-configuration |
| 17 | + * |
| 18 | + * @extends {Required<Omit<commitlint.UserConfig,'extends'>>} |
| 19 | + */ |
| 20 | +interface Config extends Required<Omit<commitlint.UserConfig, 'extends'>> { |
| 21 | + /** |
| 22 | + * Use default ignore rules. |
| 23 | + * |
| 24 | + * @default true |
| 25 | + */ |
| 26 | + defaultIgnores: boolean |
| 27 | + |
| 28 | + /** |
| 29 | + * Report formatter. |
| 30 | + */ |
| 31 | + formatter: '@commitlint/format' |
| 32 | + |
| 33 | + /** |
| 34 | + * URL to show upon failure. |
| 35 | + * |
| 36 | + * @default 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint' |
| 37 | + */ |
| 38 | + helpUrl: string |
| 39 | + |
| 40 | + /** |
| 41 | + * Functions that return `true` if `commitlint` should ignore the given |
| 42 | + * message. |
| 43 | + * |
| 44 | + * @default [] |
| 45 | + */ |
| 46 | + ignores: ((commit: string) => boolean)[] |
| 47 | + |
| 48 | + /** |
| 49 | + * Commit parser preset. |
| 50 | + * |
| 51 | + * @see {@linkcode ParserPreset} |
| 52 | + * |
| 53 | + * @default parserPreset |
| 54 | + */ |
| 55 | + parserPreset: ParserPreset |
| 56 | + |
| 57 | + /** |
| 58 | + * Plugins to apply. |
| 59 | + * |
| 60 | + * @see {@linkcode commitlint.Plugin} |
| 61 | + * @see https://commitlint.js.org/#/reference-plugins |
| 62 | + * |
| 63 | + * @default [] |
| 64 | + */ |
| 65 | + plugins: (commitlint.Plugin | string)[] |
| 66 | + |
| 67 | + /** |
| 68 | + * Prompt configuration used by [`@commitlint/cz-commitlint`][1]. |
| 69 | + * |
| 70 | + * [1]: https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/cz-commitlint |
| 71 | + * |
| 72 | + * @see {@linkcode PromptConfig} |
| 73 | + * @see https://commitlint.js.org/#/reference-prompt |
| 74 | + * |
| 75 | + * @default prompt |
| 76 | + */ |
| 77 | + prompt: PromptConfig |
| 78 | + |
| 79 | + /** |
| 80 | + * Commit rules. |
| 81 | + * |
| 82 | + * Enforces [conventional commits][1], with the exception of additional casing |
| 83 | + * rules for consistency. |
| 84 | + * |
| 85 | + * [1]: https://www.conventionalcommits.org |
| 86 | + * |
| 87 | + * @see {@linkcode RulesConfig} |
| 88 | + * @see https://commitlint.js.org/#/reference-rules |
| 89 | + * |
| 90 | + * @default rules |
| 91 | + */ |
| 92 | + rules: RulesConfig |
| 93 | +} |
| 94 | + |
| 95 | +export type { Config as default } |
0 commit comments