Skip to content

Commit bee0db1

Browse files
committed
chore: added commitlint
1 parent d936661 commit bee0db1

File tree

5 files changed

+886
-28
lines changed

5 files changed

+886
-28
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm lint && pnpm test:ci

commitlint.config.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import type { UserConfig } from '@commitlint/types';
2+
3+
const Configuration: UserConfig = {
4+
extends: ['@commitlint/config-conventional'],
5+
parserPreset: 'conventional-changelog-atom',
6+
formatter: '@commitlint/format',
7+
rules: {
8+
'type-enum': [
9+
2,
10+
'always',
11+
[
12+
'feat', // New feature
13+
'fix', // Bug fix
14+
'docs', // Documentation changes
15+
'style', // Changes that do not affect the meaning of the code (white-space, formatting, etc.)
16+
'refactor', // Code changes that neither fix a bug nor add a feature
17+
'perf', // Performance improvement
18+
'test', // Adding missing tests or correcting existing tests
19+
'build', // Changes that affect the build system or external dependencies (example scopes: npm)
20+
'ci', // Changes to CI configuration files and scripts
21+
'chore', // Other changes that don't modify src or test files
22+
'revert', // Reverts a previous commit
23+
],
24+
],
25+
'scope-enum': [
26+
2,
27+
'always',
28+
[
29+
'setup', // Project setup
30+
'config', // Configuration files
31+
'deps', // Dependency updates
32+
'feature', // Feature-specific changes
33+
'bug', // Bug fixes
34+
'docs', // Documentation
35+
'style', // Code style/formatting
36+
'refactor', // Code refactoring
37+
'test', // Tests
38+
'build', // Build scripts or configuration
39+
'ci', // Continuous integration
40+
'release', // Release related changes
41+
'other', // Other changes
42+
],
43+
],
44+
},
45+
};
46+
47+
export default Configuration;

package.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"postbuild": "cp -f static/.htaccess out/.htaccess || true",
99
"lint": "eslint .",
1010
"lint:fix": "eslint . --fix",
11+
"lint-staged": "lint-staged",
1112
"test": "vitest",
1213
"test:ui": "vitest --ui",
1314
"test:ci": "vitest --run",
@@ -17,7 +18,8 @@
1718
"test:e2e:headed": "PLAYWRIGHT_TEST=1 playwright test --headed",
1819
"fetch:versions": "npx tsx scripts/fetch-versions.ts",
1920
"fetch:downloads": "npx tsx scripts/fetch-downloads.ts",
20-
"update:data": "npm run fetch:versions && npm run fetch:downloads"
21+
"update:data": "npm run fetch:versions && npm run fetch:downloads",
22+
"prepare": "husky"
2123
},
2224
"dependencies": {
2325
"@fortawesome/fontawesome-free": "^7.1.0",
@@ -32,23 +34,29 @@
3234
"sass": "^1.93.2"
3335
},
3436
"devDependencies": {
37+
"@commitlint/cli": "^20.1.0",
38+
"@commitlint/config-conventional": "^20.0.0",
39+
"@commitlint/types": "^20.0.0",
40+
"@eslint/js": "^9.0.0",
41+
"@next/eslint-plugin-next": "15.5.4",
3542
"@playwright/test": "^1.56.1",
3643
"@testing-library/jest-dom": "^6.9.1",
3744
"@testing-library/react": "^16.3.0",
3845
"@testing-library/user-event": "^14.6.1",
3946
"@types/node": "^20.19.24",
4047
"@types/react": "^19.2.2",
4148
"@types/react-dom": "^19.2.2",
49+
"@typescript-eslint/eslint-plugin": "^8.0.0",
50+
"@typescript-eslint/parser": "^8.0.0",
4251
"@vitejs/plugin-react": "^5.1.0",
4352
"@vitest/coverage-v8": "3.2.4",
53+
"conventional-changelog-atom": "^5.0.0",
4454
"eslint": "^9.0.0",
4555
"eslint-config-next": "15.5.4",
46-
"@typescript-eslint/parser": "^8.0.0",
47-
"@typescript-eslint/eslint-plugin": "^8.0.0",
48-
"@eslint/js": "^9.0.0",
49-
"@next/eslint-plugin-next": "15.5.4",
5056
"globals": "^15.12.0",
57+
"husky": "^9.1.7",
5158
"jsdom": "^27.0.1",
59+
"lint-staged": "^16.2.6",
5260
"postcss": "^8.5.6",
5361
"tailwindcss": "^3.4.18",
5462
"typescript": "^5.9.3",

0 commit comments

Comments
 (0)