midscene/commitlint.config.js
zhouxiao.shaw 4de7fd81f7 feat(record): improve session management and code quality
- Optimize session creation to use timestamp naming by default without requiring modal input
     - Improve UI layout to display titles and descriptions more effectively in both list and
     detail views
     - Apply code formatting improvements across the codebase for better readability
     - Fix linting issues in scripts and component files
2025-06-01 11:30:06 +08:00

52 lines
1.1 KiB
JavaScript

// commitlint.config.js
const fs = require('node:fs');
const path = require('node:path');
// read subdirectories of the directory
function getSubdirectories(dir) {
if (!fs.existsSync(dir)) return [];
return fs
.readdirSync(dir, {
withFileTypes: true,
})
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name);
}
// get subdirectories of the directory
const appsScopes = getSubdirectories(path.join(__dirname, 'apps'));
const packagesScopes = getSubdirectories(path.join(__dirname, 'packages'));
// merge all scopes and remove duplicates
const allScopes = [
// basic scopes
'workflow',
'llm',
'playwright',
'puppeteer',
'mcp',
'blog',
'bridge',
'record',
// automatically added scopes
...appsScopes,
...packagesScopes,
];
// remove duplicates
const uniqueScopes = [...new Set(allScopes)];
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [
2, // Level: Error
'always', // Apply rule always
uniqueScopes,
],
// Add rule to disallow empty scopes
'scope-empty': [2, 'never'],
},
};