Skip to content

Commit 4accd9a

Browse files
author
Coinnich
committed
chore: migrate to Biome for lint and format via Ultracite, remove ESLint Prettier and Stylelint, trim overrides and lockfile, reformat app and server code, update VS Code Cursor hooks and AGENTS
1 parent aa95a7f commit 4accd9a

138 files changed

Lines changed: 792 additions & 2036 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/hooks.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"afterFileEdit": [
55
{
66
"command": "bun fix"
7+
},
8+
{
9+
"command": "bun fix --skip=correctness/noUnusedImports"
710
}
811
]
912
}

.fallowrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
3-
"ignoreDependencies": ["@varlock/bitwarden-plugin"],
3+
"ignoreDependencies": ["@varlock/bitwarden-plugin", "@sveltejs/mcp"],
44
"rules": {
55
"boundary-violation": "warn"
66
},

.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
11
{
2-
"editor.defaultFormatter": "esbenp.prettier-vscode",
2+
"editor.defaultFormatter": "biomejs.biome",
33
"editor.formatOnSave": true,
44
"editor.codeActionsOnSave": {
5-
"source.fixAll.eslint": "explicit",
6-
"source.organizeImports": "explicit"
5+
"source.fixAll.biome": "explicit"
76
},
87
"editor.tabSize": 2,
98
"editor.insertSpaces": true,
109
"editor.detectIndentation": false,
1110
"editor.autoIndent": "full",
12-
"eslint.validate": [
13-
"javascript",
14-
"javascriptreact",
15-
"typescript",
16-
"typescriptreact",
17-
"svelte"
18-
],
19-
"eslint.workingDirectories": ["."],
20-
"eslint.format.enable": true,
21-
"prettier.documentSelectors": [
22-
"**/*.{js,jsx,ts,tsx,svelte,css,html,json,md}"
23-
],
2411
"css.validate": false,
2512
"less.validate": false,
2613
"scss.validate": false,
@@ -37,27 +24,55 @@
3724
},
3825
"typescript.preferences.autoImportSpecifierExcludeRegexes": ["^(node:)?os$"],
3926
"[typescript]": {
40-
"editor.defaultFormatter": "esbenp.prettier-vscode"
27+
"editor.defaultFormatter": "biomejs.biome"
4128
},
4229
"[jsonc]": {
43-
"editor.defaultFormatter": "esbenp.prettier-vscode"
30+
"editor.defaultFormatter": "biomejs.biome"
4431
},
4532
"typescript.tsdk": "node_modules/typescript/lib",
4633
"[json]": {
47-
"editor.defaultFormatter": "esbenp.prettier-vscode"
34+
"editor.defaultFormatter": "biomejs.biome"
4835
},
4936
"[tailwindcss]": {
50-
"editor.defaultFormatter": "esbenp.prettier-vscode"
37+
"editor.defaultFormatter": "biomejs.biome"
5138
},
5239
"files.associations": {
5340
"*.css": "tailwindcss"
5441
},
5542
"editor.formatOnPaste": true,
5643
"emmet.showExpandedAbbreviation": "never",
5744
"markdown.validate.enabled": true,
58-
"js/ts.tsdk.path": "node_modules/typescript/lib",
59-
"js/ts.tsdk.promptToUseWorkspaceVersion": true,
6045
"[svelte]": {
61-
"editor.defaultFormatter": "esbenp.prettier-vscode"
46+
"editor.defaultFormatter": "svelte.svelte-vscode"
47+
},
48+
"[css]": {
49+
"editor.defaultFormatter": "biomejs.biome"
50+
},
51+
"[graphql]": {
52+
"editor.defaultFormatter": "biomejs.biome"
53+
},
54+
"[html]": {
55+
"editor.defaultFormatter": "biomejs.biome"
56+
},
57+
"[javascript]": {
58+
"editor.defaultFormatter": "biomejs.biome"
59+
},
60+
"[javascriptreact]": {
61+
"editor.defaultFormatter": "biomejs.biome"
62+
},
63+
"[markdown]": {
64+
"editor.defaultFormatter": "biomejs.biome"
65+
},
66+
"[mdx]": {
67+
"editor.defaultFormatter": "biomejs.biome"
68+
},
69+
"[typescriptreact]": {
70+
"editor.defaultFormatter": "biomejs.biome"
71+
},
72+
"[vue]": {
73+
"editor.defaultFormatter": "biomejs.biome"
74+
},
75+
"[yaml]": {
76+
"editor.defaultFormatter": "biomejs.biome"
6277
}
6378
}

AGENTS.md

Lines changed: 5 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This project uses **Ultracite**, a zero-config preset that enforces strict code
88
- **Check for issues**: `bun x ultracite check`
99
- **Diagnose setup**: `bun x ultracite doctor`
1010

11-
ESLint + Prettier + Stylelint (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
11+
Biome (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
1212

1313
---
1414

@@ -88,144 +88,14 @@ Write code that is **accessible, performant, type-safe, and maintainable**. Focu
8888
### Framework-Specific Guidance
8989

9090
**Next.js:**
91-
9291
- Use Next.js `<Image>` component for images
9392
- Use `next/head` or App Router metadata API for head elements
9493
- Use Server Components for async data fetching instead of async Client Components
9594

9695
**React 19+:**
97-
9896
- Use ref as a prop instead of `React.forwardRef`
9997

10098
**Solid/Svelte/Vue/Qwik:**
101-
102-
- Use `class` and `for` attributes (not `className` or `htmlFor`)
103-
104-
---
105-
106-
## Testing
107-
108-
- Write assertions inside `it()` or `test()` blocks
109-
- Avoid done callbacks in async tests - use async/await instead
110-
- Don't use `.only` or `.skip` in committed code
111-
- Keep test suites reasonably flat - avoid excessive `describe` nesting
112-
113-
## When ESLint + Prettier + Stylelint Can't Help
114-
115-
ESLint + Prettier + Stylelint's linter will catch most issues automatically. Focus your attention on:
116-
117-
1. **Business logic correctness** - ESLint + Prettier + Stylelint can't validate your algorithms
118-
2. **Meaningful naming** - Use descriptive names for functions, variables, and types
119-
3. **Architecture decisions** - Component structure, data flow, and API design
120-
4. **Edge cases** - Handle boundary conditions and error states
121-
5. **User experience** - Accessibility, performance, and usability considerations
122-
6. **Documentation** - Add comments for complex logic, but prefer self-documenting code
123-
124-
---
125-
126-
Most formatting and common issues are automatically fixed by ESLint + Prettier + Stylelint. Run `bun x ultracite fix` before committing to ensure compliance.
127-
128-
# Ultracite Code Standards
129-
130-
This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
131-
132-
## Quick Reference
133-
134-
- **Format code**: `bun x ultracite fix`
135-
- **Check for issues**: `bun x ultracite check`
136-
- **Diagnose setup**: `bun x ultracite doctor`
137-
138-
ESLint + Prettier + Stylelint (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
139-
140-
---
141-
142-
## Core Principles
143-
144-
Write code that is **accessible, performant, type-safe, and maintainable**. Focus on clarity and explicit intent over brevity.
145-
146-
### Type Safety & Explicitness
147-
148-
- Use explicit types for function parameters and return values when they enhance clarity
149-
- Prefer `unknown` over `any` when the type is genuinely unknown
150-
- Use const assertions (`as const`) for immutable values and literal types
151-
- Leverage TypeScript's type narrowing instead of type assertions
152-
- Use meaningful variable names instead of magic numbers - extract constants with descriptive names
153-
154-
### Modern JavaScript/TypeScript
155-
156-
- Use arrow functions for callbacks and short functions
157-
- Prefer `for...of` loops over `.forEach()` and indexed `for` loops
158-
- Use optional chaining (`?.`) and nullish coalescing (`??`) for safer property access
159-
- Prefer template literals over string concatenation
160-
- Use destructuring for object and array assignments
161-
- Use `const` by default, `let` only when reassignment is needed, never `var`
162-
163-
### Async & Promises
164-
165-
- Always `await` promises in async functions - don't forget to use the return value
166-
- Use `async/await` syntax instead of promise chains for better readability
167-
- Handle errors appropriately in async code with try-catch blocks
168-
- Don't use async functions as Promise executors
169-
170-
### React & JSX
171-
172-
- Use function components over class components
173-
- Call hooks at the top level only, never conditionally
174-
- Specify all dependencies in hook dependency arrays correctly
175-
- Use the `key` prop for elements in iterables (prefer unique IDs over array indices)
176-
- Nest children between opening and closing tags instead of passing as props
177-
- Don't define components inside other components
178-
- Use semantic HTML and ARIA attributes for accessibility:
179-
- Provide meaningful alt text for images
180-
- Use proper heading hierarchy
181-
- Add labels for form inputs
182-
- Include keyboard event handlers alongside mouse events
183-
- Use semantic elements (`<button>`, `<nav>`, etc.) instead of divs with roles
184-
185-
### Error Handling & Debugging
186-
187-
- Remove `console.log`, `debugger`, and `alert` statements from production code
188-
- Throw `Error` objects with descriptive messages, not strings or other values
189-
- Use `try-catch` blocks meaningfully - don't catch errors just to rethrow them
190-
- Prefer early returns over nested conditionals for error cases
191-
192-
### Code Organization
193-
194-
- Keep functions focused and under reasonable cognitive complexity limits
195-
- Extract complex conditions into well-named boolean variables
196-
- Use early returns to reduce nesting
197-
- Prefer simple conditionals over nested ternary operators
198-
- Group related code together and separate concerns
199-
200-
### Security
201-
202-
- Add `rel="noopener"` when using `target="_blank"` on links
203-
- Avoid `dangerouslySetInnerHTML` unless absolutely necessary
204-
- Don't use `eval()` or assign directly to `document.cookie`
205-
- Validate and sanitize user input
206-
207-
### Performance
208-
209-
- Avoid spread syntax in accumulators within loops
210-
- Use top-level regex literals instead of creating them in loops
211-
- Prefer specific imports over namespace imports
212-
- Avoid barrel files (index files that re-export everything)
213-
- Use proper image components (e.g., Next.js `<Image>`) over `<img>` tags
214-
215-
### Framework-Specific Guidance
216-
217-
**Next.js:**
218-
219-
- Use Next.js `<Image>` component for images
220-
- Use `next/head` or App Router metadata API for head elements
221-
- Use Server Components for async data fetching instead of async Client Components
222-
223-
**React 19+:**
224-
225-
- Use ref as a prop instead of `React.forwardRef`
226-
227-
**Solid/Svelte/Vue/Qwik:**
228-
22999
- Use `class` and `for` attributes (not `className` or `htmlFor`)
230100

231101
---
@@ -237,11 +107,11 @@ Write code that is **accessible, performant, type-safe, and maintainable**. Focu
237107
- Don't use `.only` or `.skip` in committed code
238108
- Keep test suites reasonably flat - avoid excessive `describe` nesting
239109

240-
## When ESLint + Prettier + Stylelint Can't Help
110+
## When Biome Can't Help
241111

242-
ESLint + Prettier + Stylelint's linter will catch most issues automatically. Focus your attention on:
112+
Biome's linter will catch most issues automatically. Focus your attention on:
243113

244-
1. **Business logic correctness** - ESLint + Prettier + Stylelint can't validate your algorithms
114+
1. **Business logic correctness** - Biome can't validate your algorithms
245115
2. **Meaningful naming** - Use descriptive names for functions, variables, and types
246116
3. **Architecture decisions** - Component structure, data flow, and API design
247117
4. **Edge cases** - Handle boundary conditions and error states
@@ -250,4 +120,4 @@ ESLint + Prettier + Stylelint's linter will catch most issues automatically. Foc
250120

251121
---
252122

253-
Most formatting and common issues are automatically fixed by ESLint + Prettier + Stylelint. Run `bun x ultracite fix` before committing to ensure compliance.
123+
Most formatting and common issues are automatically fixed by Biome. Run `bun x ultracite fix` before committing to ensure compliance.

biome.jsonc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"extends": ["ultracite/biome/core", "ultracite/biome/svelte"],
4+
"linter": {
5+
"rules": {
6+
"style": {
7+
"useFilenamingConvention": "off"
8+
},
9+
"suspicious": {
10+
"noAssignInExpressions": "info"
11+
}
12+
}
13+
},
14+
"files": {
15+
"includes": ["**", "!src/env-varlock.d.ts"]
16+
}
17+
}

0 commit comments

Comments
 (0)