chore [P-137]: установка commitlint

попытка привести все в соответствие
This commit is contained in:
Nukeap committed 2025-02-06 08:29:41 +03:00
1 parent 62855a2d06
commit 6f968bf5f5
4 files changed
+1204 -1

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
npm run commitlint --edit ${1}
+34
View File
@@ -0,0 +1,34 @@
export default {
rules: {
'header-max-length': [2, 'always', 72], // Максимальная длина заголовка
'jira-issue': [2, 'always'], // Правило для проверки номера задачи
},
plugins: [
{
rules: {
'jira-issue': ({ header }) => {
const jiraIssuePattern =
/^(feat|fix|docs|style|refactor|perf|test|chore)\s+\[([A-Z]+-\d+)\]:\s+(.+)/;
const match = header.match(jiraIssuePattern);
if (!match) {
return [
false,
`Заголовок должен содержать тип, номер задачи и название коммита. Формат: <тип> [<номер задачи>]: <название>
'feat' - Новый функционал
'fix' - Исправление ошибки
'docs' - Изменения в документации
'style' - Изменения, не влияющие на функциональность
'refactor' - Изменения кода, не исправляющие ошибки и не добавляющие функционал
'perf' - Изменения, улучшающие производительность
'test' - Добавление тестов
'chore' - Изменения в процессе сборки или вспомогательных инструментах`,
];
}
return [true];
},
},
},
],
};
+1162
View File
File diff suppressed because it is too large. Load diff
+5 -1
View File
@@ -1,13 +1,17 @@
{
"type": "module",
"scripts": {
"docs:dev": "vue-md-parser && vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"postinstall": "git config core.hooksPath .git-hooks",
"lint-staged": "lint-staged"
"lint-staged": "lint-staged",
"commitlint":"commitlint --edit"
},
"devDependencies": {
"@commitlint/cli": "^19.7.1",
"@commitlint/config-conventional": "^19.7.1",
"@eslint/js": "^9.19.0",
"eslint": "^9.19.0",
"eslint-config-prettier": "^10.0.1",