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

bug: eslint rule cactbot-output-strings doesn't detect spread properties #266

Open
valarnin opened this issue Jul 22, 2024 · 3 comments
Open
Labels
bug Something isn't working fix-me Bug report validated or feature request planned

Comments

@valarnin
Copy link
Collaborator

See commit f760614, which added an explicit unknown key to the const-defined output strings map, despite the key existing on the Directions.outputStringsCardinalDir constant.

@wexxlee
Copy link
Collaborator

wexxlee commented Jul 22, 2024

Ref: More info on issue in prior repo: quisquous#5538

@wexxlee wexxlee added bug Something isn't working fix-me Bug report validated or feature request planned labels Jul 22, 2024
@MaikoTan
Copy link
Collaborator

I think it CAN be done by reading the ImportDeclaration statement, then programmatically invoking TypeScript's parser to get the AST of that file, and then following the properties to get all its keys. But this is really painful to do such a thing.
I am digging typescript declarations files, hoping this checking can be done by typescript itself rather than eslint.

@valarnin
Copy link
Collaborator Author

Even with the latest build of typescript, we can't force inference for this automatically, unfortunately.

It may make more sense to extract the ID of the trigger, then just import the triggerset directly and pull the computed outputStrings value from that, if we're dealing with it as a property (as opposed to cactbot-builtin-response setting it within the trigger).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix-me Bug report validated or feature request planned
Projects
None yet
Development

No branches or pull requests

3 participants