forked from receptron/mulmoterminal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
124 lines (123 loc) · 5.22 KB
/
Copy patheslint.config.js
File metadata and controls
124 lines (123 loc) · 5.22 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import pluginVue from "eslint-plugin-vue";
import sonarjs from "eslint-plugin-sonarjs";
import security from "eslint-plugin-security";
import prettierRecommended from "eslint-plugin-prettier/recommended";
export default [
{ ignores: ["dist/", "node_modules/"] },
js.configs.recommended,
...tseslint.configs.strict,
...pluginVue.configs["flat/recommended"],
sonarjs.configs.recommended,
security.configs.recommended,
{
files: ["**/*.vue"],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
},
globals: {
...globals.browser,
},
},
rules: {
"vue/multi-word-component-names": "off",
"vue/max-attributes-per-line": "off",
// Components are styled with Tailwind utilities (docs/styling.md) so the styling
// travels with the markup. A <style> block is the exception, not the default —
// add the file to the allowlist below WITH a reason rather than disabling inline.
"vue/no-restricted-block": [
"error",
{
element: "style",
message:
"Use Tailwind utilities (see docs/styling.md). If this genuinely can't be a utility, add the file to the scoped-CSS allowlist in eslint.config.js with a reason.",
},
],
},
},
{
// Scoped-CSS allowlist. Each entry is something Tailwind utilities cannot express;
// keep the reason current, and delete the entry when the reason goes away.
files: [
"src/components/Sidebar.vue", // @keyframes — the "thinking" spinner ring
"src/components/SessionTabBar.vue", // @keyframes — the same spinner
"src/components/Terminal.vue", // @keyframes — the voice button's pulse / spin
"src/components/TerminalGrid.vue", // parent-state x descendant layout machine + FLIP @keyframes
"src/components/GuiPanel.vue", // `.frame + .frame` sibling-combinator spacing
"src/components/WikiPageView.vue", // :deep into v-html markdown
"src/components/WikiBrowseOverlay.vue", // :deep into v-html lint output
"src/components/FilesOverlay.vue", // :deep into CodeMirror's injected root
"src/components/ToolbarPopover.vue", // shared popover chrome import
],
rules: { "vue/no-restricted-block": "off" },
},
{
files: ["server/**/*.js", "bin/**/*.js", "scripts/**/*.{js,mjs}"],
languageOptions: {
globals: {
...globals.node,
},
},
},
{
// The launcher's job is to run the user's installed CLIs — claude, gh, tmux,
// codex, git — which have no portable absolute path and are found on PATH by
// design. no-os-command-from-path fights that premise on every spawn, so it
// is off here rather than suppressed inline at each call.
files: ["bin/**/*.js"],
rules: {
"sonarjs/no-os-command-from-path": "off",
},
},
{
// Complexity / size guards. Cognitive complexity is already covered by sonarjs
// (error@15). All ERRORS (enforced going forward) except max-params, which stays WARN
// for its one intentional offender: spawnClaudePty's 7 params (hot path, not worth
// churning 5 call sites into an options object) — flip it to error once resolved.
rules: {
"max-lines-per-function": ["error", { max: 60, skipBlankLines: true, skipComments: true, IIFEs: true }],
complexity: ["error", 20],
"max-depth": ["error", 4],
"max-params": ["warn", 6],
"max-nested-callbacks": ["error", 4],
},
},
{
// `const { secret, ...rest } = obj` is how you drop a field by construction —
// the named siblings are the point, not dead code. Scoped to where the
// typescript-eslint rule owns unused-vars; plain .js keeps the plugin default.
files: ["**/*.{ts,tsx,mts,cts}", "**/*.vue"],
rules: {
"@typescript-eslint/no-unused-vars": ["error", { ignoreRestSiblings: true }],
},
},
{
// Test files: a describe/it suite is one big (nested) callback by design, so the
// length + callback-nesting guards are noise here. Keep the logic-complexity guards on.
files: ["**/*.spec.{ts,js}", "**/*.test.{ts,js}"],
rules: {
"max-lines-per-function": "off",
"max-nested-callbacks": "off",
// Same reasoning for components: a spec defines throwaway stubs next to the case that
// uses them (useCaptureKeydown, useNewTerminal). Splitting one-line stubs into their own
// files would put the fixture further from the assertion, which is the opposite of what
// the rule is for — it exists to keep SHIPPED components findable.
"vue/one-component-per-file": "off",
},
},
{
// eslint-plugin-security tuning (mirrors mulmoclaude): these three rules fire
// on safe, intentional patterns here — workspace-relative fs paths (session
// files keyed by validated UUIDs), dynamic `obj[key]` lookups, and regexps —
// so they're high-noise, low-signal. The rest of `recommended` stays on.
rules: {
"security/detect-non-literal-fs-filename": "off",
"security/detect-object-injection": "off",
"security/detect-non-literal-regexp": "off",
},
},
prettierRecommended,
];