Skip to content

Commit

Permalink
refactor(commitlint): add defineConfig (#17)
Browse files Browse the repository at this point in the history
Co-authored-by: Almanov Nikita <[email protected]>
  • Loading branch information
github-actions[bot] and nikkeyl authored Mar 20, 2024
1 parent 5759b48 commit 1940c36
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 335 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: Commit Lint

on:
pull_request:
branches-ignore:
- dependabot/*
push:
branches-ignore:
- dependabot/*

jobs:
commit-lint:
Expand All @@ -11,11 +15,23 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10

if: ${{ github.actor != 'dependabot[bot]' }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set Up PNPM
uses: pnpm/action-setup@v3
with:
version: 8

- name: Set Up NodeJS
uses: actions/setup-node@v4
with:
cache: pnpm
node-version: lts/*

- name: Install Dependencies
run: pnpm i

- name: Lint
uses: wagoid/commitlint-github-action@v5
27 changes: 22 additions & 5 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
import type { UserConfig } from '@commitlint/types';
import { defineConfig } from '@archoleat/commitlint-define-config';

const commitLintConfig: UserConfig = {
export default defineConfig({
extends: ['@commitlint/config-conventional'],
};

export default commitLintConfig;
rules: {
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'spec',
'style',
],
],
},
});
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"type": "module",
"types": "index.d.ts",
"exports": {
".": "./index.js",
"./*": "./commitlint.config.ts"
".": "./index.js"
},
"files": [
"index.d.ts",
Expand All @@ -60,10 +59,10 @@
"commit": "cz"
},
"devDependencies": {
"@archoleat/commitlint-define-config": "^1.0.0",
"@archoleat/semantic-release-define-config": "file:",
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.3",
"@commitlint/types": "^18.6.1",
"@commitlint/config-conventional": "^19.1.0",
"@rollup/plugin-typescript": "^11.1.6",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
Expand Down
Loading

0 comments on commit 1940c36

Please sign in to comment.