From 31a86b19b3f937b6310e34ccded12d41305cce0b Mon Sep 17 00:00:00 2001 From: Peter Kulko Date: Mon, 25 Nov 2024 19:37:22 +0200 Subject: [PATCH] feat: added commitlint --- config/{commitlint.config.js => .commitlintrc.js} | 0 lib/presets.js | 8 +++++++- package-lock.json | 12 ++++++++---- package.json | 4 +--- 4 files changed, 16 insertions(+), 8 deletions(-) rename config/{commitlint.config.js => .commitlintrc.js} (100%) diff --git a/config/commitlint.config.js b/config/.commitlintrc.js similarity index 100% rename from config/commitlint.config.js rename to config/.commitlintrc.js diff --git a/lib/presets.js b/lib/presets.js index de8fe7e..6723438 100644 --- a/lib/presets.js +++ b/lib/presets.js @@ -26,4 +26,10 @@ const stylelint = new ConfigPreset({ searchFilepaths, }); -module.exports = { eslint, stylelint }; +const commitlint = new ConfigPreset({ + defaultFilename: '.commitlintrc', + searchFilenames: ['.commitlintrc', '.commitlintrc.js'], + searchFilepaths, +}); + +module.exports = { eslint, stylelint, commitlint }; diff --git a/package-lock.json b/package-lock.json index e79049c..70231da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,14 +9,12 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "chalk": "4.1.2", "webpack-merge": "^5.10.0" }, "devDependencies": { "@commitlint/config-conventional": "^17.4.0", "@edx/stylelint-config-edx": "^2.3.3", - "@openedx/frontend-build": "13.0.27", - "stylelint": "^15.11.0" + "@openedx/frontend-build": "13.0.27" } }, "node_modules/@ampproject/remapping": { @@ -4079,6 +4077,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -5145,6 +5144,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5367,6 +5367,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -5377,7 +5378,8 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "node_modules/color-string": { "version": "1.9.1", @@ -8441,6 +8443,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -15942,6 +15945,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, diff --git a/package.json b/package.json index beab5d3..4391039 100644 --- a/package.json +++ b/package.json @@ -10,13 +10,11 @@ "author": "", "license": "ISC", "dependencies": { - "chalk": "4.1.2", "webpack-merge": "^5.10.0" }, "devDependencies": { "@commitlint/config-conventional": "^17.4.0", - "@openedx/frontend-build": "13.0.27", "@edx/stylelint-config-edx": "^2.3.3", - "stylelint": "^15.11.0" + "@openedx/frontend-build": "13.0.27" } }