Skip to content

Export graph type automatically with an autofixable ESLint rule #66

Open
@guyca

Description

@guyca

Obsidian exposes a convenience type for typing graphs - dependenciesOf.

We can create an ESLint plugin to ensure each graph has the type exported correctly.

  • The rule should be auto-fixable so the type is generated automatically on save
  • The rule must take subgraphs into account.
Graph Type
@graph()
export class AppGraph extends ObjectGraph {}
export type = dependenciesOf;
@graph({subgraphs: [Subgraph]})
export AppGraph extends ObjectGraph {}
export type = dependenciesOf<[AppGraph, Subgraph]>;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions