@commitlint/config-patternplate
Advanced tools
Comparing version
18
index.js
@@ -1,15 +0,15 @@ | ||
import path from 'node:path'; | ||
import path from "node:path"; | ||
import configAngular from '@commitlint/config-angular'; | ||
import {glob} from 'glob'; | ||
import merge from 'lodash.merge'; | ||
import configAngular from "@commitlint/config-angular"; | ||
import { glob } from "glob"; | ||
import merge from "lodash.merge"; | ||
function pathToId(root, filePath) { | ||
const relativePath = path.relative(root, filePath); | ||
return path.dirname(relativePath).split(path.sep).join('/'); | ||
return path.dirname(relativePath).split(path.sep).join("/"); | ||
} | ||
async function getPatternIDs() { | ||
const root = path.resolve(process.cwd(), './patterns'); | ||
const pattern = path.resolve(root, '**/pattern.json'); | ||
const root = path.resolve(process.cwd(), "./patterns"); | ||
const pattern = path.resolve(root, "**/pattern.json"); | ||
const files = glob(pattern); | ||
@@ -21,5 +21,5 @@ return files.map((result) => pathToId(root, result)); | ||
rules: { | ||
'scope-enum': () => | ||
getPatternIDs().then((ids) => [2, 'always', ids.concat(['system'])]), | ||
"scope-enum": () => | ||
getPatternIDs().then((ids) => [2, "always", ids.concat(["system"])]), | ||
}, | ||
}); |
{ | ||
"name": "@commitlint/config-patternplate", | ||
"type": "module", | ||
"version": "19.8.0", | ||
"version": "19.8.1", | ||
"description": "Lint your commits, patternplate-style", | ||
@@ -35,3 +35,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@commitlint/config-angular": "^19.8.0", | ||
"@commitlint/config-angular": "^19.8.1", | ||
"glob": "^10.3.10", | ||
@@ -41,6 +41,6 @@ "lodash.merge": "^4.6.2" | ||
"devDependencies": { | ||
"@commitlint/utils": "^19.8.0", | ||
"@commitlint/utils": "^19.8.1", | ||
"@types/lodash.merge": "^4.6.8" | ||
}, | ||
"gitHead": "e82f05a737626bb69979d14564f5ff601997f679" | ||
"gitHead": "3c302008cabeb0b08cd246b2417a51a9d745a918" | ||
} |
3876
0.05%