Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export graph type automatically with an autofixable ESLint rule #66

Open
guyca opened this issue Aug 1, 2022 · 0 comments
Open

Export graph type automatically with an autofixable ESLint rule #66

guyca opened this issue Aug 1, 2022 · 0 comments
Labels

Comments

@guyca
Copy link
Collaborator

guyca commented Aug 1, 2022

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]>;
@guyca guyca added enhancement New feature or request good first issue Good for newcomers dx looking for contributors labels Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant