Skip to content

Commit 7ef2744

Browse files
author
Nico Ismaili
committed
chore: added linting
/spend 5m
1 parent 76916da commit 7ef2744

File tree

17 files changed

+470
-134
lines changed

17 files changed

+470
-134
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ jobs:
1919
- name: Install dependencies (Cache hit will skip actual installation)
2020
run: |
2121
bun install --frozen-lockfile
22+
- name: Lint code
23+
run: |
24+
bun run lint
25+
- name: Run tests
26+
run: |
27+
bun test
2228
- name: Build package
2329
run: |
2430
bun run build

.lintstagedrc.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'*.{js,jsx,ts,tsx}':
2+
- bun lint:fix
3+
4+
'*.{json,md,yml,yaml}':
5+
- bun lint:fix

CHANGELOG.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,20 @@
22

33
## [1.2.1](https://github.com/nico-i/commitlint-plugin-spend/compare/v1.2.0...v1.2.1) (2025-06-02)
44

5-
65
### Miscellaneous Chores
76

8-
* release 1.2.0 ([f0b158b](https://github.com/nico-i/commitlint-plugin-spend/commit/f0b158b6774a8e74a68b21fb631af3e98ef061f4))
9-
* release 1.2.1 ([d5206ab](https://github.com/nico-i/commitlint-plugin-spend/commit/d5206ab2b96a9006a720d140739414c896103ad7))
10-
* removed previous releases ([537f883](https://github.com/nico-i/commitlint-plugin-spend/commit/537f883aa0c8cf5e4a89761cd177fc8fbc0fd058))
7+
- release 1.2.0 ([f0b158b](https://github.com/nico-i/commitlint-plugin-spend/commit/f0b158b6774a8e74a68b21fb631af3e98ef061f4))
8+
- release 1.2.1 ([d5206ab](https://github.com/nico-i/commitlint-plugin-spend/commit/d5206ab2b96a9006a720d140739414c896103ad7))
9+
- removed previous releases ([537f883](https://github.com/nico-i/commitlint-plugin-spend/commit/537f883aa0c8cf5e4a89761cd177fc8fbc0fd058))
1110

1211
## [1.2.0](https://github.com/nico-i/commitlint-plugin-spend/compare/v1.0.0...v1.2.0) (2025-06-02)
1312

14-
1513
### Miscellaneous Chores
1614

17-
* release 1.2.0 ([f0b158b](https://github.com/nico-i/commitlint-plugin-spend/commit/f0b158b6774a8e74a68b21fb631af3e98ef061f4))
15+
- release 1.2.0 ([f0b158b](https://github.com/nico-i/commitlint-plugin-spend/commit/f0b158b6774a8e74a68b21fb631af3e98ef061f4))
1816

1917
## [1.0.0](https://github.com/nico-i/commitlint-plugin-spend/compare/v1.2.0...v1.0.0) (2025-06-01)
2018

21-
2219
### Miscellaneous Chores
2320

24-
* removed previous releases ([537f883](https://github.com/nico-i/commitlint-plugin-spend/commit/537f883aa0c8cf5e4a89761cd177fc8fbc0fd058))
21+
- removed previous releases ([537f883](https://github.com/nico-i/commitlint-plugin-spend/commit/537f883aa0c8cf5e4a89761cd177fc8fbc0fd058))

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,24 @@ feat: implement user authentication
8080
/spend
8181
```
8282

83-
*Error: Spend directive must contain at least one time value*
83+
_Error: Spend directive must contain at least one time value_
8484

8585
```text
8686
fix: resolve database connection timeout
8787
8888
/spend 25h 70m
8989
```
9090

91-
*Error: The time value "25h" exceeds the maximum value for "h" (max value: 23)*
91+
_Error: The time value "25h" exceeds the maximum value for "h" (max value: 23)_
9292

9393
```text
9494
refactor: optimize API response handling
9595
9696
/spend 30m 2h 1d
9797
```
9898

99-
*Error: Time values are not in the correct order. Time values must be ordered from largest to smallest unit*
99+
_Error: Time values are not in the correct order. Time values must be ordered from largest to smallest unit_
100100

101101
## License
102102

103-
[MIT](./LICENSE)
103+
[MIT](./LICENSE)

bun.lock

Lines changed: 316 additions & 9 deletions
Large diffs are not rendered by default.

commitlint.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { type UserConfig } from "@commitlint/types";
2-
import spendPlugin from "./index";
1+
import { type UserConfig } from '@commitlint/types';
2+
import spendPlugin from './index';
33

44
export default {
5-
extends: ["@commitlint/config-conventional"],
5+
extends: [`@commitlint/config-conventional`],
66
rules: {
7-
spend: [2, "always"],
7+
spend: [2, `always`],
88
},
99
plugins: [spendPlugin],
1010
} satisfies UserConfig;

eslint.config.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'eslint/config';
2+
import config from '@nico-i/eslint-config';
3+
4+
export default defineConfig([
5+
...config,
6+
{
7+
ignores: [`node_modules/`, `out/`, `coverage/`],
8+
},
9+
]);

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Plugin } from "@commitlint/types";
2-
import { validateCommitMsg } from "./src/utils/validateCommitMsg/validateCommitMsg";
1+
import type { Plugin } from '@commitlint/types';
2+
import { validateCommitMsg } from './src/utils/validateCommitMsg/validateCommitMsg';
33

44
export default {
55
rules: {

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
"url": "https://github.com/nico-i/commitlint-plugin-spend/issues"
3535
},
3636
"scripts": {
37-
"build": "bun test && bun build ./index.ts --outdir ./out",
37+
"build": "bun build ./index.ts --outdir ./out --minify",
38+
"lint": "eslint . --ext .ts && prettier . --check",
39+
"lint:fix": "eslint . --ext .ts --fix && prettier . --write",
3840
"prepare": "husky || true"
3941
},
4042
"peerDependencies": {
@@ -45,8 +47,13 @@
4547
"@commitlint/config-conventional": "19.8.1",
4648
"@commitlint/core": "19.8.1",
4749
"@commitlint/types": "19.8.1",
50+
"@nico-i/eslint-config": "2.7.0",
51+
"@nico-i/prettier-config": "1.0.2",
4852
"@types/bun": "1.2.15",
4953
"@types/node": "22.15.29",
50-
"husky": "9.1.7"
54+
"eslint": "9.28.0",
55+
"husky": "9.1.7",
56+
"lint-staged": "16.1.0",
57+
"prettier": "3.5.3"
5158
}
5259
}

prettier.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import config from '@nico-i/prettier-config';
2+
3+
export default {
4+
...config,
5+
};

0 commit comments

Comments
 (0)