forked from vuepress/ecosystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.ts
More file actions
26 lines (22 loc) · 840 Bytes
/
commitlint.config.ts
File metadata and controls
26 lines (22 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { readdirSync, statSync } from 'node:fs'
import { join } from 'node:path'
import { getDirname } from 'vuepress/utils'
const __dirname = getDirname(import.meta.url)
const getSubDirectories = (dir: string): string[] =>
readdirSync(dir).filter((item) => statSync(join(dir, item)).isDirectory())
const pluginPackages = getSubDirectories(join(__dirname, 'plugins')).flatMap(
(category) => getSubDirectories(join(__dirname, 'plugins', category)),
)
const themePackages = getSubDirectories(join(__dirname, 'themes'))
const toolPackages = getSubDirectories(join(__dirname, 'tools'))
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [
2,
'always',
['e2e', 'release', ...pluginPackages, ...themePackages, ...toolPackages],
],
'footer-max-line-length': [0],
},
}