-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
101 lines (100 loc) · 4.14 KB
/
Copy patheslint.config.js
File metadata and controls
101 lines (100 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import js from '@eslint/js';
import ts from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import prettier from 'eslint-config-prettier';
import globals from 'globals';
export default [
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
// Vite-injected build-time constants — see vite.config.ts `define`.
__APP_VERSION__: 'readonly',
__BUILD_DATE__: 'readonly',
__MOBILE__: 'readonly',
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
// eslint-plugin-svelte v3 flags every `new Map()` / `new Set()` in
// .svelte / .svelte.ts files. Orrery uses Map/Set overwhelmingly as
// plain data structures — hit-test caches in the Three.js render loop,
// local temporaries, pure-function accumulators — none of which are
// reactive UI state. Swapping them to SvelteMap/SvelteSet would add
// reactivity machinery to hot paths for no benefit. Genuine reactive
// collections opt into SvelteMap/SvelteSet explicitly where needed.
'svelte/prefer-svelte-reactivity': 'off',
// SvelteKit's resolve() is built for route IDs + params and is typed to
// accept only static route literals. Orrery navigates overwhelmingly by
// query string (/missions?id=X, modals on the index route — there is no
// /missions/[id] route by design) and by paths computed at runtime
// (localizeHref for i18n, routes stored in data). resolve() cannot
// type-check those, so this rule only fits a route-ID navigation style
// that isn't ours. Base-correctness — the real requirement across the
// /orrery/ base path, capacitor:// and dev — is handled uniformly by
// `base` from $app/paths (still first-class SvelteKit). Revisit adopting
// resolve() if we ever move deep-links to real dynamic routes.
'svelte/no-navigation-without-resolve': 'off',
},
},
{
// eslint-plugin-svelte v3 routes .svelte, .svelte.ts and .svelte.js
// (Svelte 5 rune modules) through svelte-eslint-parser; give it the
// TypeScript sub-parser so the .svelte.ts modules parse as TS.
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
languageOptions: {
parserOptions: {
parser: ts.parser,
},
},
},
{
ignores: [
'build/',
'.svelte-kit/',
'dist/',
'node_modules/',
// Capacitor native project dirs — platform-generated + the synced web
// bundle copy (cap sync populates ios/App/App/public +
// android/.../assets/public with build/; Xcode writes ios/DerivedData).
// All gitignored where generated; never hand-authored source to lint.
'ios/',
'android/',
'src/lib/paraglide/',
'docs/.vitepress/dist/',
'docs/.vitepress/cache/',
'playwright-report/',
'test-results/',
// Generated coverage report (@vitest/coverage-v8 HTML/lcov, S1).
'coverage/',
// Local-only Python virtualenvs (gitignored) — used by Argos
// Translate scripts. Ship-time CI checkouts never see these.
'.venv-argos/',
'.xdg-data/',
'.xdg-config/',
'.xdg-cache/',
// Linux node_modules cache (gitignored) — populated by
// scripts/regenerate-visual-baselines-linux.sh inside the
// Playwright Docker image. Contains arch-specific binaries +
// bundled/minified vendor JS that ESLint shouldn't lint.
'.linux-node-modules/',
// Retired one-shot scripts (per-wave migrations, slice fetches,
// translation passes). Kept for historical reference only — never
// re-run, and their relative imports no longer resolve from the
// archive depth. Inventory: docs/reference/tooling/archive.md.
'scripts/_archive/',
// Scratch: POC scripts + validation composites/screenshots (gitignored).
'.moon-shots/',
],
},
];