Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
dist
build
coverage
.next
.turbo
*.min.js
*.min.css
23 changes: 23 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"endOfLine": "lf",
"singleAttributePerLine": false,
"overrides": [
{
"files": "*.json",
"options": {
"singleQuote": false
}
}
]
}
69 changes: 69 additions & 0 deletions .zed/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"format_on_save": "on",
"formatter": "auto",
"tab_size": 2,
"languages": {
"JavaScript": {
"formatter": [
{
"external": {
"command": "npx",
"arguments": ["prettier", "--stdin-filepath", "{buffer_path}"]
}
},
{
"code_actions": {
"source.fixAll.eslint": true
}
}
],
"format_on_save": "on"
},
"TypeScript": {
"formatter": [
{
"external": {
"command": "npx",
"arguments": ["prettier", "--stdin-filepath", "{buffer_path}"]
}
},
{
"code_actions": {
"source.fixAll.eslint": true
}
}
],
"format_on_save": "on"
},
"TSX": {
"formatter": [
{
"external": {
"command": "npx",
"arguments": ["prettier", "--stdin-filepath", "{buffer_path}"]
}
},
{
"code_actions": {
"source.fixAll.eslint": true
}
}
],
"format_on_save": "on"
}
},
"file_scan_exclusions": [
"**/.git",
"**/.svn",
"**/.hg",
"**/CVS",
"**/.DS_Store",
"**/Thumbs.db",
"**/node_modules",
"**/dist",
"**/build",
"**/.next",
"**/coverage",
"**/.turbo"
]
}
292 changes: 247 additions & 45 deletions bun.lock

Large diffs are not rendered by default.

153 changes: 153 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import js from "@eslint/js";
import solid from "eslint-plugin-solid/configs/typescript";
import * as tsParser from "@typescript-eslint/parser";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import prettierConfig from "eslint-config-prettier";

export default [
js.configs.recommended,
{
files: ["**/*.{ts,tsx,js,jsx}"],
...solid,
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
"@typescript-eslint": tsPlugin,
solid: solid.plugins.solid,
},
rules: {
// TypeScript specific rules
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
},
],
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/prefer-interface": "off",

// Naming conventions matching your style guide
"@typescript-eslint/naming-convention": [
"error",
// Variables: camelCase, descriptive names
{
selector: "variable",
format: ["camelCase", "UPPER_CASE"],
leadingUnderscore: "allow",
},
// Booleans: isActive, hasPermission pattern
{
selector: "variable",
types: ["boolean"],
format: ["camelCase"],
prefix: ["is", "has", "contains", "should", "will", "did", "can"],
},
// Functions: camelCase with verb names
{
selector: "function",
format: ["camelCase", "PascalCase"], // PascalCase for components
},
// Classes and interfaces: PascalCase
{
selector: "class",
format: ["PascalCase"],
},
{
selector: "interface",
format: ["PascalCase"],
},
{
selector: "typeAlias",
format: ["PascalCase"],
},
// Type parameters
{
selector: "typeParameter",
format: ["PascalCase"],
},
// Enums: PascalCase
{
selector: "enum",
format: ["PascalCase"],
},
// Enum members: UPPER_CASE
{
selector: "enumMember",
format: ["UPPER_CASE"],
},
],

// General JavaScript/TypeScript rules
semi: "off", // Use @typescript-eslint/semi instead
indent: "off", // Let Prettier handle this
quotes: ["error", "single", { avoidEscape: true }],
"comma-dangle": ["error", "always-multiline"],
"no-trailing-spaces": "error",
"no-multiple-empty-lines": ["error", { max: 2, maxEOF: 1 }],
"eol-last": ["error", "always"],
"object-curly-spacing": ["error", "always"],
"array-bracket-spacing": ["error", "never"],
"arrow-parens": ["error", "always"],
"arrow-body-style": ["error", "as-needed"],
"prefer-const": "warn",
"no-var": "error",
"no-console": "warn",
"no-debugger": "error",
eqeqeq: ["error", "always"],

// Import rules
"no-restricted-imports": [
"error",
{
patterns: ["./", "../"],
},
],
"import/order": "off", // You can enable this if you add eslint-plugin-import

// SolidJS specific rules
"solid/components-return-once": "error",
"solid/event-handlers": "error",
"solid/imports": "error",
"solid/jsx-no-duplicate-props": "error",
"solid/jsx-no-script-url": "error",
"solid/jsx-no-undef": "error",
"solid/jsx-uses-vars": "error",
"solid/no-destructure": "error",
"solid/no-innerhtml": "warn",
"solid/no-react-deps": "error",
"solid/no-react-specific-props": "error",
"solid/no-unknown-namespaces": "error",
"solid/prefer-for": "warn", // Warns to use <For> instead of map for components
"solid/prefer-show": "warn", // Warns to use <Show> for conditionals
"solid/reactivity": "error",
"solid/self-closing-comp": "error",
"solid/style-prop": "warn",

// Disabled rules to avoid Prettier conflicts
"max-len": "off",
"no-mixed-spaces-and-tabs": "off",
"no-tabs": "off",
},
},
// Prettier config should be last to override formatting rules
prettierConfig,
];
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@
"start": "vinxi start"
},
"dependencies": {
"@eslint/js": "^9.29.0",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.15.0",
"@solidjs/start": "^1.1.0",
"@typescript-eslint/eslint-plugin": "^8.35.0",
"@typescript-eslint/parser": "^8.35.0",
"eslint": "^9.29.0",
"eslint-config-prettier": "^10.1.5",
"eslint-plugin-solid": "^0.14.5",
"prettier": "^3.6.1",
"solid-js": "^1.9.5",
"typescript": "^5.8.3",
"vinxi": "^0.5.3"
},
"devDependencies": {
Expand Down
13 changes: 10 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
{
"compilerOptions": {
"strict": true,
"target": "ESNext",
"module": "ESNext",
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "preserve",
"jsxImportSource": "solid-js",
"types": ["node", "vinxi/types/client"],
"allowJs": true,
"noEmit": true,
"strict": true,
"types": ["vinxi/types/client"],
"isolatedModules": true,
"sourceMap": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"paths": {
"~/*": ["./src/*"]
}
}
},
"include": ["src/**/*", "test/**/*"],
"exclude": ["node_modules", "dist", "build"]
}
Loading