Skip to content

Commit a6be6ce

Browse files
committed
chore: add prettier and eslint-config-prettier
Configure Prettier with single quotes, semis, trailing commas, and 100-char width. Add eslint-config-prettier to disable conflicting ESLint rules. Fix pre-existing lint errors (no-explicit-any, prefer-const).
1 parent d74c3cf commit a6be6ce

8 files changed

Lines changed: 53 additions & 4 deletions

File tree

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
node_modules
3+
package-lock.json

.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"singleQuote": true,
3+
"semi": true,
4+
"trailingComma": "all",
5+
"printWidth": 100
6+
}

eslint.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import globals from 'globals'
33
import reactHooks from 'eslint-plugin-react-hooks'
44
import reactRefresh from 'eslint-plugin-react-refresh'
55
import tseslint from 'typescript-eslint'
6+
import eslintConfigPrettier from 'eslint-config-prettier'
67
import { defineConfig, globalIgnores } from 'eslint/config'
78

89
export default defineConfig([
@@ -20,4 +21,5 @@ export default defineConfig([
2021
globals: globals.browser,
2122
},
2223
},
24+
eslintConfigPrettier,
2325
])

package-lock.json

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"dev": "vite",
1515
"build": "tsc -b && vite build",
1616
"lint": "eslint .",
17+
"format": "prettier --write .",
18+
"format:check": "prettier --check .",
1719
"preview": "vite preview"
1820
},
1921
"dependencies": {
@@ -35,9 +37,11 @@
3537
"@types/react-dom": "^19.2.3",
3638
"@vitejs/plugin-react": "^5.1.1",
3739
"eslint": "^9.39.1",
40+
"eslint-config-prettier": "^10.1.8",
3841
"eslint-plugin-react-hooks": "^7.0.1",
3942
"eslint-plugin-react-refresh": "^0.4.24",
4043
"globals": "^16.5.0",
44+
"prettier": "^3.8.1",
4145
"tailwindcss": "^4.1.18",
4246
"typescript": "~5.9.3",
4347
"typescript-eslint": "^8.46.4",

src/components/AlgorithmOverview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const NODE_WIDTH = 160;
1919
const NODE_HEIGHT = 50;
2020

2121
// Custom node component for overview
22-
function OverviewFlowNode({ data, selected }: { data: any; selected: boolean }) {
22+
function OverviewFlowNode({ data, selected }: { data: Record<string, unknown>; selected: boolean }) {
2323
const colorClass = categoryColors[data.category as OverviewNode['category']] || 'border-gray-500 bg-gray-500/10';
2424

2525
return (

src/components/FlowCanvas.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function FlowCanvas() {
136136
});
137137

138138
// Generate edges
139-
let edgeList: Edge[] = [];
139+
const edgeList: Edge[] = [];
140140
const edgeSet = new Set<string>();
141141

142142
if (isOverview) {
@@ -254,7 +254,7 @@ export function FlowCanvas() {
254254
/>
255255
<MiniMap
256256
nodeColor={(node) => {
257-
const status = (node.data as any).status;
257+
const status = (node.data as Record<string, unknown>).status;
258258
if (status === 'active') return '#238636';
259259
if (status === 'completed') return '#58a6ff';
260260
return '#30363d';

src/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export const useVisualizerStore = create<VisualizerState>((set, get) => ({
282282
// Update node status based on step
283283
const nodeUpdate: AlgorithmNode = {
284284
id: step.nodeId,
285-
type: step.nodeId.split('-')[0] as any,
285+
type: step.nodeId.split('-')[0] as AlgorithmNode['type'],
286286
label: step.description,
287287
description: step.description,
288288
status: 'active',

0 commit comments

Comments
 (0)