From aa73302d590d15631a7b9800262c831a4bc62819 Mon Sep 17 00:00:00 2001 From: Thomas Deinhamer Date: Fri, 22 Nov 2024 00:17:21 +0100 Subject: [PATCH] Add configuration for conventional commits --- configuration/conventional.js | 12 ++++++++++++ knip.config.js | 1 + package.json | 4 +++- pnpm-lock.yaml | 20 ++++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 configuration/conventional.js diff --git a/configuration/conventional.js b/configuration/conventional.js new file mode 100644 index 0000000..d4f4847 --- /dev/null +++ b/configuration/conventional.js @@ -0,0 +1,12 @@ +export default { + extends: ['@commitlint/config-conventional'], + plugins: ['@somehow-digital/commitlint-plugin-spellcheck'], + rules: { + 'spellcheck/body': [2, 'always'], + 'spellcheck/footer': [2, 'always'], + 'spellcheck/header': [2, 'always'], + 'spellcheck/scope': [2, 'always'], + 'spellcheck/subject': [2, 'always'], + 'spellcheck/type': [2, 'always'], + }, +}; diff --git a/knip.config.js b/knip.config.js index 66df392..7db73e1 100644 --- a/knip.config.js +++ b/knip.config.js @@ -3,6 +3,7 @@ export default { ignoreDependencies: [ 'commitlint-config-.*', '@somehow-digital/commitlint-plugin-spellcheck', + '@commitlint/config-conventional', ], project: ['configuration/**'], }; diff --git a/package.json b/package.json index 8598012..d4b1be3 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ }, "exports": { ".": "./configuration/basic.js", - "./basic": "./configuration/basic.js" + "./basic": "./configuration/basic.js", + "./conventional": "./configuration/conventional.js" }, "files": [ "./configuration/" @@ -33,6 +34,7 @@ "@commitlint/cli": "^19.5.0" }, "dependencies": { + "@commitlint/config-conventional": "^19.6.0", "@somehow-digital/commitlint-plugin-spellcheck": "^1.0.1" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5ce7958..5f86c59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@commitlint/config-conventional': + specifier: ^19.6.0 + version: 19.6.0 '@somehow-digital/commitlint-plugin-spellcheck': specifier: ^1.0.1 version: 1.0.1(cspell@8.15.3) @@ -61,6 +64,10 @@ packages: engines: {node: '>=v18'} hasBin: true + '@commitlint/config-conventional@19.6.0': + resolution: {integrity: sha512-DJT40iMnTYtBtUfw9ApbsLZFke1zKh6llITVJ+x9mtpHD08gsNXaIRqHTmwTZL3dNX5+WoyK7pCN/5zswvkBCQ==} + engines: {node: '>=v18'} + '@commitlint/config-validator@19.5.0': resolution: {integrity: sha512-CHtj92H5rdhKt17RmgALhfQt95VayrUo2tSqY9g2w+laAXyk7K/Ef6uPm9tn5qSIwSmrLjKaXK9eiNuxmQrDBw==} engines: {node: '>=v18'} @@ -722,6 +729,10 @@ packages: resolution: {integrity: sha512-ROjNchA9LgfNMTTFSIWPzebCwOGFdgkEq45EnvvrmSLvCtAw0HSmrCs7/ty+wAeYUZyNay0YMUNYFTRL72PkBQ==} engines: {node: '>=16'} + conventional-changelog-conventionalcommits@7.0.2: + resolution: {integrity: sha512-NKXYmMR/Hr1DevQegFB4MwfM5Vv0m4UIxKZTTYuD98lpTknaZlSRrDOG4X7wIXpGkfsYxZTghUN+Qq+T0YQI7w==} + engines: {node: '>=16'} + conventional-commits-parser@5.0.0: resolution: {integrity: sha512-ZPMl0ZJbw74iS9LuX9YIAiW8pfM5p3yh2o/NbXHbkFuZzY5jvdi5jFycEOkmBW5H5I7nA+D6f3UcsCLP2vvSEA==} engines: {node: '>=16'} @@ -1841,6 +1852,11 @@ snapshots: - '@types/node' - typescript + '@commitlint/config-conventional@19.6.0': + dependencies: + '@commitlint/types': 19.5.0 + conventional-changelog-conventionalcommits: 7.0.2 + '@commitlint/config-validator@19.5.0': dependencies: '@commitlint/types': 19.5.0 @@ -2582,6 +2598,10 @@ snapshots: dependencies: compare-func: 2.0.0 + conventional-changelog-conventionalcommits@7.0.2: + dependencies: + compare-func: 2.0.0 + conventional-commits-parser@5.0.0: dependencies: JSONStream: 1.3.5