Skip to content

Commit

Permalink
refactor(commitlint): add defineConfig (#3)
Browse files Browse the repository at this point in the history
Co-authored-by: Almanov Nikita <131481562+nikkeyl@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and nikkeyl authored Mar 20, 2024
1 parent e49cd9a commit 342cc0c
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 334 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
8 changes: 3 additions & 5 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { UserConfig } from '@commitlint/types';
import { defineConfig } from '@archoleat/commitlint-define-config';

const commitLintConfig: UserConfig = {
export default defineConfig({
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
Expand All @@ -21,6 +21,4 @@ const commitLintConfig: UserConfig = {
],
],
},
};

export default commitLintConfig;
});
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default defineFlatConfig([
},
rules: {
'import/exports-last': 'error',
'import/extensions': ['error', { ts: 'always' }],
'import/group-exports': 'error',
'import/no-commonjs': 'error',
'import/no-namespace': 'error',
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
"type": "module",
"types": "index.d.ts",
"exports": {
".": "./index.js",
"./*": "./commitlint.config.ts"
".": "./index.js"
},
"files": [
"index.d.ts",
Expand All @@ -64,10 +63,10 @@
"chalk": "^5.3.0"
},
"devDependencies": {
"@archoleat/commitlint-define-config": "^1.0.0",
"@archoleat/semantic-release-define-config": "^1.1.0",
"@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 342cc0c

Please sign in to comment.