Add oxlint, oxfmt, typescript-go
- oxlint with react, react-hooks, typescript, import, unicorn plugins
- oxfmt (no trailing commas, single quotes, sorted imports)
- tsgo (typescript-go native preview) for fast typechecking
- Fix all lint warnings: non-null assertions, unused expressions, stale closures
- Scripts: lint, format, typecheck, check
2026-02-27 12:52:04 +00:00
|
|
|
{
|
|
|
|
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
2026-03-08 20:08:27 +00:00
|
|
|
"plugins": ["typescript", "import", "unicorn", "vue"],
|
2026-03-09 07:05:18 +00:00
|
|
|
"jsPlugins": ["./lint/plugin.js"],
|
Add oxlint, oxfmt, typescript-go
- oxlint with react, react-hooks, typescript, import, unicorn plugins
- oxfmt (no trailing commas, single quotes, sorted imports)
- tsgo (typescript-go native preview) for fast typechecking
- Fix all lint warnings: non-null assertions, unused expressions, stale closures
- Scripts: lint, format, typecheck, check
2026-02-27 12:52:04 +00:00
|
|
|
"env": {
|
|
|
|
|
"browser": true,
|
|
|
|
|
"es2024": true
|
|
|
|
|
},
|
|
|
|
|
"rules": {
|
|
|
|
|
"no-unused-vars": "warn",
|
|
|
|
|
"no-console": "off",
|
Harden oxlint: consistent-type-imports, no-duplicates, no-misused-promises, prefer-optional-chain
Add 6 new lint rules: typescript/consistent-type-imports,
typescript/no-unnecessary-type-assertion, typescript/prefer-optional-chain,
typescript/no-misused-promises, import/no-duplicates, import/no-mutable-exports.
Ban @/types shim via no-restricted-imports.
Fix all violations: replace inline import() annotations with proper
type imports, merge duplicate module imports, add void to fire-and-forget
promises, convert && chains to optional chaining.
2026-03-09 06:05:04 +00:00
|
|
|
"no-restricted-imports": ["error", {
|
|
|
|
|
"paths": [
|
|
|
|
|
{ "name": "@/types", "message": "Import types directly from @open-pencil/core." }
|
|
|
|
|
],
|
|
|
|
|
"patterns": [{
|
|
|
|
|
"group": ["@/engine/*"],
|
|
|
|
|
"message": "Import from @open-pencil/core unless the module adds platform-specific logic.",
|
|
|
|
|
"allowImportNames": ["loadFont", "listFamilies", "preloadFonts"]
|
|
|
|
|
}]
|
|
|
|
|
}],
|
Add oxlint, oxfmt, typescript-go
- oxlint with react, react-hooks, typescript, import, unicorn plugins
- oxfmt (no trailing commas, single quotes, sorted imports)
- tsgo (typescript-go native preview) for fast typechecking
- Fix all lint warnings: non-null assertions, unused expressions, stale closures
- Scripts: lint, format, typecheck, check
2026-02-27 12:52:04 +00:00
|
|
|
|
2026-03-09 06:16:07 +00:00
|
|
|
"no-empty-function": "error",
|
2026-03-09 07:11:11 +00:00
|
|
|
"max-lines": ["warn", { "max": 600 }],
|
2026-03-09 08:31:36 +00:00
|
|
|
"complexity": ["error", { "max": 20 }],
|
2026-03-09 06:16:07 +00:00
|
|
|
|
Add oxlint, oxfmt, typescript-go
- oxlint with react, react-hooks, typescript, import, unicorn plugins
- oxfmt (no trailing commas, single quotes, sorted imports)
- tsgo (typescript-go native preview) for fast typechecking
- Fix all lint warnings: non-null assertions, unused expressions, stale closures
- Scripts: lint, format, typecheck, check
2026-02-27 12:52:04 +00:00
|
|
|
"typescript/no-explicit-any": "warn",
|
|
|
|
|
"typescript/no-non-null-assertion": "warn",
|
2026-03-08 20:04:44 +00:00
|
|
|
"typescript/no-floating-promises": "error",
|
Harden oxlint: consistent-type-imports, no-duplicates, no-misused-promises, prefer-optional-chain
Add 6 new lint rules: typescript/consistent-type-imports,
typescript/no-unnecessary-type-assertion, typescript/prefer-optional-chain,
typescript/no-misused-promises, import/no-duplicates, import/no-mutable-exports.
Ban @/types shim via no-restricted-imports.
Fix all violations: replace inline import() annotations with proper
type imports, merge duplicate module imports, add void to fire-and-forget
promises, convert && chains to optional chaining.
2026-03-09 06:05:04 +00:00
|
|
|
"typescript/no-misused-promises": "error",
|
|
|
|
|
"typescript/consistent-type-imports": "error",
|
2026-03-09 06:16:07 +00:00
|
|
|
"typescript/consistent-return": "error",
|
|
|
|
|
"typescript/no-unnecessary-condition": "error",
|
Harden oxlint: consistent-type-imports, no-duplicates, no-misused-promises, prefer-optional-chain
Add 6 new lint rules: typescript/consistent-type-imports,
typescript/no-unnecessary-type-assertion, typescript/prefer-optional-chain,
typescript/no-misused-promises, import/no-duplicates, import/no-mutable-exports.
Ban @/types shim via no-restricted-imports.
Fix all violations: replace inline import() annotations with proper
type imports, merge duplicate module imports, add void to fire-and-forget
promises, convert && chains to optional chaining.
2026-03-09 06:05:04 +00:00
|
|
|
"typescript/no-unnecessary-type-assertion": "error",
|
2026-03-09 06:16:07 +00:00
|
|
|
"typescript/no-unnecessary-type-parameters": "error",
|
2026-03-09 07:05:18 +00:00
|
|
|
"typescript/no-unnecessary-boolean-literal-compare": "error",
|
|
|
|
|
"typescript/no-unnecessary-template-expression": "error",
|
|
|
|
|
"typescript/no-unnecessary-type-arguments": "error",
|
Harden oxlint: consistent-type-imports, no-duplicates, no-misused-promises, prefer-optional-chain
Add 6 new lint rules: typescript/consistent-type-imports,
typescript/no-unnecessary-type-assertion, typescript/prefer-optional-chain,
typescript/no-misused-promises, import/no-duplicates, import/no-mutable-exports.
Ban @/types shim via no-restricted-imports.
Fix all violations: replace inline import() annotations with proper
type imports, merge duplicate module imports, add void to fire-and-forget
promises, convert && chains to optional chaining.
2026-03-09 06:05:04 +00:00
|
|
|
"typescript/prefer-optional-chain": "error",
|
2026-03-09 06:16:07 +00:00
|
|
|
"typescript/prefer-for-of": "error",
|
Add oxlint, oxfmt, typescript-go
- oxlint with react, react-hooks, typescript, import, unicorn plugins
- oxfmt (no trailing commas, single quotes, sorted imports)
- tsgo (typescript-go native preview) for fast typechecking
- Fix all lint warnings: non-null assertions, unused expressions, stale closures
- Scripts: lint, format, typecheck, check
2026-02-27 12:52:04 +00:00
|
|
|
|
|
|
|
|
"import/no-cycle": "error",
|
|
|
|
|
"import/no-self-import": "error",
|
Harden oxlint: consistent-type-imports, no-duplicates, no-misused-promises, prefer-optional-chain
Add 6 new lint rules: typescript/consistent-type-imports,
typescript/no-unnecessary-type-assertion, typescript/prefer-optional-chain,
typescript/no-misused-promises, import/no-duplicates, import/no-mutable-exports.
Ban @/types shim via no-restricted-imports.
Fix all violations: replace inline import() annotations with proper
type imports, merge duplicate module imports, add void to fire-and-forget
promises, convert && chains to optional chaining.
2026-03-09 06:05:04 +00:00
|
|
|
"import/no-duplicates": "error",
|
|
|
|
|
"import/no-mutable-exports": "error",
|
Add oxlint, oxfmt, typescript-go
- oxlint with react, react-hooks, typescript, import, unicorn plugins
- oxfmt (no trailing commas, single quotes, sorted imports)
- tsgo (typescript-go native preview) for fast typechecking
- Fix all lint warnings: non-null assertions, unused expressions, stale closures
- Scripts: lint, format, typecheck, check
2026-02-27 12:52:04 +00:00
|
|
|
|
|
|
|
|
"unicorn/no-instanceof-array": "error",
|
2026-03-08 20:08:27 +00:00
|
|
|
"unicorn/no-typeof-undefined": "error",
|
2026-03-09 06:16:07 +00:00
|
|
|
"unicorn/no-nested-ternary": "error",
|
2026-03-09 07:05:18 +00:00
|
|
|
|
|
|
|
|
"unicorn/no-useless-fallback-in-spread": "error",
|
|
|
|
|
"unicorn/no-length-as-slice-end": "error",
|
|
|
|
|
"unicorn/no-unnecessary-await": "error",
|
|
|
|
|
"unicorn/prefer-string-starts-ends-with": "error",
|
2026-03-09 06:16:07 +00:00
|
|
|
"unicorn/consistent-existence-index-check": "error",
|
2026-03-08 20:08:27 +00:00
|
|
|
|
|
|
|
|
"vue/no-arrow-functions-in-watch": "error",
|
|
|
|
|
"vue/no-deprecated-destroyed-lifecycle": "error",
|
|
|
|
|
"vue/no-export-in-script-setup": "error",
|
|
|
|
|
"vue/no-lifecycle-after-await": "error",
|
|
|
|
|
"vue/no-import-compiler-macros": "error",
|
|
|
|
|
"vue/prefer-import-from-vue": "error",
|
|
|
|
|
"vue/valid-define-emits": "error",
|
|
|
|
|
"vue/valid-define-props": "error",
|
|
|
|
|
"vue/no-required-prop-with-default": "error",
|
2026-03-09 06:20:01 +00:00
|
|
|
"vue/no-multiple-slot-args": "error",
|
2026-03-08 20:08:27 +00:00
|
|
|
"vue/define-emits-declaration": "error",
|
|
|
|
|
"vue/define-props-destructuring": "error",
|
2026-03-09 06:41:28 +00:00
|
|
|
"vue/require-typed-ref": "error",
|
|
|
|
|
|
|
|
|
|
"open-pencil/no-inline-named-types": ["error", {
|
|
|
|
|
"Vector": "x:number,y:number",
|
|
|
|
|
"Color": "a:number,b:number,g:number,r:number",
|
|
|
|
|
"GUID": "localID:number,sessionID:number",
|
|
|
|
|
"Rect": "height:number,width:number,x:number,y:number",
|
|
|
|
|
"Matrix": "m00:number,m01:number,m02:number,m10:number,m11:number,m12:number"
|
|
|
|
|
}],
|
|
|
|
|
"open-pencil/no-structuredclone-scene-arrays": "error",
|
2026-03-09 07:05:18 +00:00
|
|
|
"open-pencil/no-math-random": "error",
|
Lint CLI code: no-raw-console-format rule, fix all violations
Add no-raw-console-format lint rule for CLI commands — bans template
literals and string concatenation in console.log, forcing use of
agentfmt helpers (bold, dim, kv, entity, fmtTree, fmtList, etc.).
Extend lint target to include packages/cli/src/.
Fix all 22 lint errors in CLI code:
- Replace string concatenation with agentfmt (clusters, typography, variables)
- Mark optional CLI args as required: false (citty type accuracy)
- Remove unnecessary type assertions and optional chains
- Merge duplicate @open-pencil/core imports in headless.ts
- Extract exportViaApp/exportFromFile to reduce export.ts complexity
- Remove unused imports (formatType, printError)
- void runMain() for floating promise
2026-03-09 09:54:53 +00:00
|
|
|
"open-pencil/no-hand-rolled-color": "error",
|
2026-03-13 07:03:12 +00:00
|
|
|
"open-pencil/no-raw-console-format": "off",
|
|
|
|
|
"open-pencil/no-silent-catch": "error"
|
Add oxlint, oxfmt, typescript-go
- oxlint with react, react-hooks, typescript, import, unicorn plugins
- oxfmt (no trailing commas, single quotes, sorted imports)
- tsgo (typescript-go native preview) for fast typechecking
- Fix all lint warnings: non-null assertions, unused expressions, stale closures
- Scripts: lint, format, typecheck, check
2026-02-27 12:52:04 +00:00
|
|
|
},
|
|
|
|
|
"overrides": [
|
|
|
|
|
{
|
|
|
|
|
"files": ["**/*.test.ts", "**/*.test.tsx"],
|
|
|
|
|
"rules": {
|
|
|
|
|
"typescript/no-explicit-any": "off",
|
2026-03-13 07:03:12 +00:00
|
|
|
"typescript/no-non-null-assertion": "off",
|
|
|
|
|
"open-pencil/no-silent-catch": "off"
|
Add oxlint, oxfmt, typescript-go
- oxlint with react, react-hooks, typescript, import, unicorn plugins
- oxfmt (no trailing commas, single quotes, sorted imports)
- tsgo (typescript-go native preview) for fast typechecking
- Fix all lint warnings: non-null assertions, unused expressions, stale closures
- Scripts: lint, format, typecheck, check
2026-02-27 12:52:04 +00:00
|
|
|
}
|
Fix all lint, typecheck, and formatting issues
- 0 lint warnings (was 66), 0 type errors (was 30+)
- Add typed interfaces for Paint.stops/transform, Effect.blendMode,
NodeChange.strokeCap/strokeJoin/dashPattern in kiwi codec
- Add CompiledSchema.encodePaint/encodeNodeChange methods
- Remove all no-explicit-any: use Window declaration merging for
queryLocalFonts, showOpenFilePicker, showSaveFilePicker
- Remove all non-null assertions: add guards, use ?. operator,
?? fallbacks throughout
- Add SceneGraph.copyProp typed helper for instance sync
- Suppress kiwi-schema lint warnings via oxlint override
- Remove unused imports, variables, parameters
- Use proper CanvasKit StrokeCap/StrokeJoin enums in renderer
- Run oxfmt with import sorting
2026-02-28 19:57:33 +00:00
|
|
|
},
|
Reduce cyclomatic complexity below 20 in all core functions
Refactor 24 complex functions across 14 files by extracting
dispatch branches and property-group handlers into focused helpers.
kiwi/kiwi-convert.ts (4 functions, was 22-81):
- nodeChangeToProps → 6 property-group converters
- convertOverrideToProps → 5 override applicators
- importStyleRuns → 3 style-run helpers
- mapNodeType → NODE_TYPE_MAP lookup table
kiwi/instance-overrides.ts (3 functions, was 28-44):
- applyDerivedSymbolData → resolveDsd* helpers
- applyComponentProperties → assignment/override applicators
- propagateOverridesTransitively → clone/sync helpers
kiwi/fig-import.ts (2 functions, was 34-40):
- importNodeChanges → buildChangeMaps, importPages, etc.
- importVariables → importCollections, resolveVariableType, etc.
render/export-jsx.ts (2 functions, was 70-85):
- collectProps → property-category extractors
- collectTailwindClasses → Tailwind class-group extractors
render/renderer.ts: propsToOverrides (78) → style-category helpers
renderer/scene.ts: renderNode (46), renderShapeUncached (30) →
phase extractors (transforms, content, children, strokes)
renderer/renderer.ts: buildParagraph (34) → buildTruncateOpts,
addStyledRuns
svg-export.ts: split into svg-export.ts + svg-export-defs.ts +
svg-export-paths.ts; renderNode/renderTextNode/nodeShapeElements
all reduced via helper extraction
kiwi-serialize.ts: sceneNodeToKiwi (44) → 6 property serializers
clipboard.ts: importClipboardNodes (36) → 5 focused helpers
scene-graph.ts: hitTestChildren (31) → containsPoint,
hitTestOpaqueContainer, hitTestTransparentContainer
tools/analyze.ts: serializeNodeProps (23) → 4 prop serializers
2026-03-09 10:40:57 +00:00
|
|
|
|
Fix all lint, typecheck, and formatting issues
- 0 lint warnings (was 66), 0 type errors (was 30+)
- Add typed interfaces for Paint.stops/transform, Effect.blendMode,
NodeChange.strokeCap/strokeJoin/dashPattern in kiwi codec
- Add CompiledSchema.encodePaint/encodeNodeChange methods
- Remove all no-explicit-any: use Window declaration merging for
queryLocalFonts, showOpenFilePicker, showSaveFilePicker
- Remove all non-null assertions: add guards, use ?. operator,
?? fallbacks throughout
- Add SceneGraph.copyProp typed helper for instance sync
- Suppress kiwi-schema lint warnings via oxlint override
- Remove unused imports, variables, parameters
- Use proper CanvasKit StrokeCap/StrokeJoin enums in renderer
- Run oxfmt with import sorting
2026-02-28 19:57:33 +00:00
|
|
|
{
|
|
|
|
|
"files": ["**/kiwi/kiwi-schema/**"],
|
|
|
|
|
"rules": {
|
|
|
|
|
"typescript/no-explicit-any": "off",
|
2026-03-09 10:18:08 +00:00
|
|
|
"typescript/no-non-null-assertion": "off",
|
|
|
|
|
"typescript/prefer-for-of": "off",
|
|
|
|
|
"typescript/prefer-optional-chain": "off",
|
|
|
|
|
"typescript/consistent-type-imports": "off",
|
|
|
|
|
"typescript/no-unnecessary-condition": "off",
|
|
|
|
|
"import/no-mutable-exports": "off",
|
|
|
|
|
"complexity": "off"
|
Fix all lint, typecheck, and formatting issues
- 0 lint warnings (was 66), 0 type errors (was 30+)
- Add typed interfaces for Paint.stops/transform, Effect.blendMode,
NodeChange.strokeCap/strokeJoin/dashPattern in kiwi codec
- Add CompiledSchema.encodePaint/encodeNodeChange methods
- Remove all no-explicit-any: use Window declaration merging for
queryLocalFonts, showOpenFilePicker, showSaveFilePicker
- Remove all non-null assertions: add guards, use ?. operator,
?? fallbacks throughout
- Add SceneGraph.copyProp typed helper for instance sync
- Suppress kiwi-schema lint warnings via oxlint override
- Remove unused imports, variables, parameters
- Use proper CanvasKit StrokeCap/StrokeJoin enums in renderer
- Run oxfmt with import sorting
2026-02-28 19:57:33 +00:00
|
|
|
}
|
2026-03-09 07:11:11 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"files": [
|
|
|
|
|
"src/stores/editor.ts",
|
|
|
|
|
"src/composables/use-canvas-input.ts",
|
|
|
|
|
"src/demo.ts"
|
|
|
|
|
],
|
|
|
|
|
"rules": {
|
|
|
|
|
"max-lines": "off"
|
|
|
|
|
}
|
Lint CLI code: no-raw-console-format rule, fix all violations
Add no-raw-console-format lint rule for CLI commands — bans template
literals and string concatenation in console.log, forcing use of
agentfmt helpers (bold, dim, kv, entity, fmtTree, fmtList, etc.).
Extend lint target to include packages/cli/src/.
Fix all 22 lint errors in CLI code:
- Replace string concatenation with agentfmt (clusters, typography, variables)
- Mark optional CLI args as required: false (citty type accuracy)
- Remove unnecessary type assertions and optional chains
- Merge duplicate @open-pencil/core imports in headless.ts
- Extract exportViaApp/exportFromFile to reduce export.ts complexity
- Remove unused imports (formatType, printError)
- void runMain() for floating promise
2026-03-09 09:54:53 +00:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"files": ["packages/cli/src/commands/**"],
|
|
|
|
|
"rules": {
|
|
|
|
|
"open-pencil/no-raw-console-format": "error"
|
|
|
|
|
}
|
Add oxlint, oxfmt, typescript-go
- oxlint with react, react-hooks, typescript, import, unicorn plugins
- oxfmt (no trailing commas, single quotes, sorted imports)
- tsgo (typescript-go native preview) for fast typechecking
- Fix all lint warnings: non-null assertions, unused expressions, stale closures
- Scripts: lint, format, typecheck, check
2026-02-27 12:52:04 +00:00
|
|
|
}
|
|
|
|
|
],
|
2026-02-28 05:10:09 +00:00
|
|
|
"ignorePatterns": ["node_modules", "dist", "desktop", "*.config.*"]
|
Add oxlint, oxfmt, typescript-go
- oxlint with react, react-hooks, typescript, import, unicorn plugins
- oxfmt (no trailing commas, single quotes, sorted imports)
- tsgo (typescript-go native preview) for fast typechecking
- Fix all lint warnings: non-null assertions, unused expressions, stale closures
- Scripts: lint, format, typecheck, check
2026-02-27 12:52:04 +00:00
|
|
|
}
|