From c4e7da769daa33926e2ba87f208757030e0f2eef Mon Sep 17 00:00:00 2001 From: Andrey Polischuk Date: Tue, 27 Feb 2024 11:07:58 +0300 Subject: [PATCH] fix(commitlint-config): fix parser presets --- packages/commitlint-config/conventional.js | 6 +----- packages/commitlint-config/index.js | 8 +------- packages/commitlint-config/preset-conventional.js | 6 ++++++ packages/commitlint-config/preset-simple.js | 8 ++++++++ 4 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 packages/commitlint-config/preset-conventional.js create mode 100644 packages/commitlint-config/preset-simple.js diff --git a/packages/commitlint-config/conventional.js b/packages/commitlint-config/conventional.js index 546d36b..d78f84a 100644 --- a/packages/commitlint-config/conventional.js +++ b/packages/commitlint-config/conventional.js @@ -1,12 +1,8 @@ module.exports = { extends: ['@commitlint/config-conventional'], + parserPreset: './preset-conventional', rules: { 'references-empty': [2, 'never'], 'subject-case': [2, 'never', ['start-case', 'pascal-case', 'upper-case']] - }, - parserPreset: { - parserOpts: { - issuePrefixes: ['#', '[A-Z]{2,10}-'] - } } } diff --git a/packages/commitlint-config/index.js b/packages/commitlint-config/index.js index cfa5461..70cbd6e 100644 --- a/packages/commitlint-config/index.js +++ b/packages/commitlint-config/index.js @@ -1,13 +1,7 @@ module.exports = { extends: ['./conventional.js'], + parserPreset: './preset-simple', rules: { 'type-empty': [0] - }, - parserPreset: { - parserOpts: { - headerPattern: /^(.*)$/, - headerCorrespondence: ['subject'], - issuePrefixes: ['#', '[A-Z]{2,10}-'] - } } } diff --git a/packages/commitlint-config/preset-conventional.js b/packages/commitlint-config/preset-conventional.js new file mode 100644 index 0000000..86abbdd --- /dev/null +++ b/packages/commitlint-config/preset-conventional.js @@ -0,0 +1,6 @@ +module.exports = { + name: 'conventional-changelog-conventionalcommits', + parserOpts: { + issuePrefixes: ['#', '[A-Z]{2,10}-'] + } +} diff --git a/packages/commitlint-config/preset-simple.js b/packages/commitlint-config/preset-simple.js new file mode 100644 index 0000000..2bf60c2 --- /dev/null +++ b/packages/commitlint-config/preset-simple.js @@ -0,0 +1,8 @@ +module.exports = { + name: 'conventional-changelog-conventionalcommits', + parserOpts: { + headerPattern: /^(.*)$/, + headerCorrespondence: ['subject'], + issuePrefixes: ['#', '[A-Z]{2,10}-'] + } +}