Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,10 @@ repos:
language: script
files: ^(internal/scaffold/fullsend-repo/harness/|docs/agents/)
pass_filenames: false

- id: lint-staged
name: lint-staged (web)
entry: npx lint-staged --allow-empty
language: system
files: ^web/(admin|docs)/src/
pass_filenames: false
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dist/
node_modules/
cloudflare_site/
*.md
*.yaml
*.yml
*.go
*.py
hack/
internal/
docs/
web/public/
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
"singleQuote": false,
"trailingComma": "all",
"printWidth": 100,
"tabWidth": 2,
"semi": true,
"svelteSortOrder": "options-scripts-markup-styles",
"svelteIndentScriptAndStyle": true,
"svelteAllowShorthand": true
}
7 changes: 7 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-html/svelte"],
"rules": {
"custom-property-pattern": null,
"selector-class-pattern": null
}
}
103 changes: 103 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import { defineConfig } from "eslint/config";
import js from "@eslint/js";
import ts from "typescript-eslint";
import svelte from "eslint-plugin-svelte";
import globals from "globals";
import adminSvelteConfig from "./web/admin/svelte.config.js";
import docsSvelteConfig from "./web/docs/svelte.config.js";

export default defineConfig([
// Global ignores must be first entry
{
ignores: [
"dist/",
"node_modules/",
"cloudflare_site/",
"internal/",
"hack/",
"docs/",
"web/public/",
],
},

js.configs.recommended,
...ts.configs.recommended,
svelte.configs.recommended,
svelte.configs.prettier,

{
files: ["web/admin/src/**/*.{ts,js,svelte}", "web/docs/src/**/*.{ts,js,svelte}"],
languageOptions: {
globals: {
...globals.browser,
},
},
},

// Svelte file overrides: TypeScript parser with per-app svelte config
{
files: ["web/admin/**/*.svelte", "web/admin/**/*.svelte.ts", "web/admin/**/*.svelte.js"],
languageOptions: {
parserOptions: {
parser: ts.parser,
svelteConfig: adminSvelteConfig,
},
},
},
{
files: ["web/docs/**/*.svelte", "web/docs/**/*.svelte.ts", "web/docs/**/*.svelte.js"],
languageOptions: {
parserOptions: {
parser: ts.parser,
svelteConfig: docsSvelteConfig,
},
},
},

// Custom rules for all linted files
{
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"no-console": ["warn", { allow: ["warn", "error", "info"] }],
},
},

// Svelte-specific rules
{
files: ["**/*.svelte"],
rules: {
"svelte/no-at-html-tags": "error",
"svelte/require-each-key": "error",
"svelte/no-unused-class-name": "warn",
"svelte/no-inline-styles": ["warn", { allowTransitions: true }],
"svelte/block-lang": [
"error",
{ script: ["ts"], style: ["css", null] },
],
"svelte/max-lines-per-block": [
"warn",
{
script: 100,
template: 80,
style: 120,
},
],
},
},

// Svelte component file-length limit
{
files: ["web/admin/src/**/*.svelte", "web/docs/src/**/*.svelte"],
rules: {
"max-lines": ["warn", { max: 150, skipBlankLines: true, skipComments: true }],
},
},

]);
Loading
Loading