Skip to content

Commit 4ae02dc

Browse files
committedFeb 11, 2025
refactor: overhaul
1 parent f6080d3 commit 4ae02dc

32 files changed

+1795
-160
lines changed
 

‎.husky/commit-msg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm exec commitlint --edit "$1"

‎.husky/pre-commit

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pnpm exec lint-staged
2+
pnpm exec vitest run

‎.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.hintrc
2+
pnpm-lock.yaml

‎commitlint.config.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
extends: ['@commitlint/config-conventional'],
3+
};

‎eslint.config.js

-34
This file was deleted.

‎eslint.config.mjs

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/** @type {import('eslint').Linter.Config[]} */
2+
import js from "@eslint/js";
3+
import eslintConfigPrettier from "eslint-config-prettier";
4+
import prettierPlugin from "eslint-plugin-prettier";
5+
import reactHooks from "eslint-plugin-react-hooks";
6+
import reactRefresh from "eslint-plugin-react-refresh";
7+
import globals from "globals";
8+
import tseslint from "typescript-eslint";
9+
10+
export default tseslint.config(
11+
{ ignores: ["dist", "node_modules"] },
12+
{
13+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
14+
files: ["**/*.{ts,tsx}"],
15+
languageOptions: {
16+
ecmaVersion: "latest",
17+
globals: globals.browser,
18+
},
19+
plugins: {
20+
"react-hooks": reactHooks,
21+
"react-refresh": reactRefresh,
22+
prettier: prettierPlugin,
23+
},
24+
rules: {
25+
...reactHooks.configs.recommended.rules,
26+
"react-refresh/only-export-components": [
27+
"warn",
28+
{ allowConstantExport: true },
29+
],
30+
...eslintConfigPrettier.rules,
31+
eqeqeq: ["error", "always"],
32+
"@typescript-eslint/no-explicit-any": "off",
33+
"@typescript-eslint/triple-slash-reference": "off",
34+
"@typescript-eslint/no-unused-vars": [
35+
"error",
36+
{
37+
args: "all",
38+
argsIgnorePattern: "^_",
39+
caughtErrors: "all",
40+
caughtErrorsIgnorePattern: "^_",
41+
destructuredArrayIgnorePattern: "^_",
42+
varsIgnorePattern: "^_",
43+
ignoreRestSiblings: true,
44+
},
45+
],
46+
},
47+
},
48+
);

‎lint-staged.config.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
"*.{ts,tsx}": ["pnpm run lint:fix", "pnpm run format:fix"],
3+
"*.{html,css,json}": "pnpm run format:fix",
4+
};

‎package.json

+25-2
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,55 @@
33
"private": true,
44
"version": "0.1.0",
55
"type": "module",
6+
"author": {
7+
"name": "SkyCodr (aka: Dulan Sudasinghe",
8+
"email": "dulan81@gmail.com"
9+
},
610
"scripts": {
711
"dev": "vite",
812
"build": "tsc -b && vite build",
9-
"lint": "eslint .",
13+
"lint": "eslint src/**/*.{ts,tsx}",
14+
"lint:fix": "eslint --fix src/**/*.{ts,tsx}",
15+
"format:fix": "prettier --write src/**/*.{ts,tsx}",
16+
"format:check": "prettier --check src/**/*.{ts,tsx}",
1017
"preview": "vite preview",
11-
"test": "vitest"
18+
"test": "vitest",
19+
"test:ui": "vitest --ui",
20+
"prepare": "husky"
1221
},
1322
"dependencies": {
1423
"react": "^19.0.0",
1524
"react-dom": "^19.0.0"
1625
},
1726
"devDependencies": {
27+
"@commitlint/cli": "^19.7.1",
28+
"@commitlint/config-conventional": "^19.7.1",
1829
"@eslint/js": "^9.19.0",
30+
"@testing-library/jest-dom": "^6.6.3",
31+
"@testing-library/react": "^16.2.0",
1932
"@types/react": "^19.0.8",
2033
"@types/react-dom": "^19.0.3",
2134
"@vitejs/plugin-react": "^4.3.4",
35+
"@vitest/coverage-v8": "^3.0.5",
36+
"@vitest/ui": "^3.0.5",
2237
"eslint": "^9.19.0",
38+
"eslint-config-prettier": "^10.0.1",
39+
"eslint-plugin-prettier": "^5.2.3",
2340
"eslint-plugin-react": "^7.37.4",
2441
"eslint-plugin-react-hooks": "^5.0.0",
2542
"eslint-plugin-react-refresh": "^0.4.18",
2643
"globals": "^15.14.0",
44+
"husky": "^9.1.7",
45+
"lint-staged": "^15.4.3",
2746
"prettier": "^3.4.2",
2847
"typescript": "~5.7.2",
2948
"typescript-eslint": "^8.22.0",
3049
"vite": "^6.1.0",
3150
"vitest": "^3.0.5"
3251
},
52+
"peerDependencies": {
53+
"react": "^19.0.0",
54+
"react-dom": "^19.0.0"
55+
},
3356
"packageManager": "pnpm@10.2.1+sha512.398035c7bd696d0ba0b10a688ed558285329d27ea994804a52bad9167d8e3a72bcb993f9699585d3ca25779ac64949ef422757a6c31102c12ab932e5cbe5cc92"
3457
}

0 commit comments

Comments
 (0)
Please sign in to comment.