Skip to content

Commit cf2f90a

Browse files
refactor: add define-config function (#13)
Co-authored-by: Almanov Nikita <[email protected]>
1 parent 940af36 commit cf2f90a

File tree

9 files changed

+183
-159
lines changed

9 files changed

+183
-159
lines changed

.github/workflows/codeql.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ on:
55
branches:
66
- main
77
paths:
8+
- index.d.ts
9+
- index.js
810
- index.ts
911
- package.json
1012
push:
1113
branches:
1214
- main
1315
paths:
16+
- index.d.ts
17+
- index.js
1418
- index.ts
1519
- package.json
1620

define-config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { UserConfig } from '@commitlint/types';
2+
3+
/**
4+
* Define an Commitlint config.
5+
*
6+
* @param {object} config Commitlint config.
7+
*
8+
* @returns Commitlint config.
9+
*/
10+
const defineConfig = (config: UserConfig): UserConfig => {
11+
return config;
12+
};
13+
14+
export { defineConfig };

index.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1 @@
1-
import type { UserConfig } from '@commitlint/types';
2-
3-
/**
4-
* Define an Commitlint config.
5-
*
6-
* @param {object} config Commitlint config.
7-
*
8-
* @returns Commitlint config.
9-
*/
10-
const defineConfig = (config: UserConfig): UserConfig => {
11-
return config;
12-
};
13-
14-
export { defineConfig };
1+
const n=e=>e;export{n as defineConfig};

lint-staged.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export default {
22
'**/*': 'prettier --write',
3-
'index.ts': 'eslint --fix',
3+
'define-config.ts': 'eslint --fix',
44
};

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@
3939
"type": "module",
4040
"types": "index.d.ts",
4141
"exports": {
42-
".": "./index.js"
42+
".": "./index.js",
43+
"./index.ts": "./index.ts"
4344
},
4445
"files": [
4546
"index.d.ts",
46-
"index.js"
47+
"index.js",
48+
"index.ts"
4749
],
4850
"scripts": {
4951
"init": "pnpm i && husky && git submodule update",
@@ -54,22 +56,22 @@
5456
"lint:editorconfig": "editorconfig-checker",
5557
"lint:formatting": "prettier . --check",
5658
"lint:md": "remark . --quiet",
57-
"lint:ts": "eslint index.ts --fix",
59+
"lint:ts": "eslint define-config.ts --fix",
5860
"prettify": "prettier . --write",
5961
"commit": "cz"
6062
},
6163
"dependencies": {
6264
"@commitlint/types": "^19.0.3"
6365
},
6466
"devDependencies": {
65-
"@archoleat/semantic-release-define-config": "^1.1.0",
67+
"@archoleat/semantic-release-define-config": "^1.1.1",
6668
"@commitlint/cli": "^19.2.1",
6769
"@commitlint/config-conventional": "^19.1.0",
6870
"@rollup/plugin-typescript": "^11.1.6",
6971
"@semantic-release/changelog": "^6.0.3",
7072
"@semantic-release/git": "^10.0.1",
71-
"@typescript-eslint/eslint-plugin": "^7.3.1",
72-
"@typescript-eslint/parser": "^7.3.1",
73+
"@typescript-eslint/eslint-plugin": "^7.4.0",
74+
"@typescript-eslint/parser": "^7.4.0",
7375
"@vitest/coverage-v8": "^1.4.0",
7476
"conventional-changelog-conventionalcommits": "^7.0.2",
7577
"cz-conventional-changelog": "^3.3.0",
@@ -80,7 +82,7 @@
8082
"eslint-import-resolver-typescript": "^3.6.1",
8183
"eslint-plugin-import": "^2.29.1",
8284
"eslint-plugin-unicorn": "^51.0.1",
83-
"globals": "^14.0.0",
85+
"globals": "^15.0.0",
8486
"husky": "^9.0.11",
8587
"lint-staged": "^15.2.2",
8688
"prettier": "^3.2.5",
@@ -89,7 +91,7 @@
8991
"remark-preset-lint-consistent": "^5.1.2",
9092
"remark-preset-lint-markdown-style-guide": "^5.1.3",
9193
"remark-preset-lint-recommended": "^6.1.3",
92-
"rollup": "^4.13.0",
94+
"rollup": "^4.13.1",
9395
"rollup-plugin-dts": "^6.1.0",
9496
"rollup-plugin-esbuild": "^6.1.1",
9597
"semantic-release": "^23.0.6",

0 commit comments

Comments
 (0)