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

๐Ÿ› ๏ธ Refactor: no casting Vue instances as any #80

Open
1 of 2 tasks
dlqqq opened this issue Oct 28, 2020 · 1 comment
Open
1 of 2 tasks

๐Ÿ› ๏ธ Refactor: no casting Vue instances as any #80

dlqqq opened this issue Oct 28, 2020 · 1 comment
Assignees
Labels
Domain: Dev Experience This issue pertains to a developer's emotions and attitudes when building Grey Software. Role: Software Engineer Uses technology to design, develop, test, and maintain creative software solutions.

Comments

@dlqqq
Copy link
Contributor

dlqqq commented Oct 28, 2020

Motivation ๐Ÿ

It's bad practice to cast types as any just to circumvent TS compiler errors; that kind of defeats the purpose of type-checking if we disable its functionality every time we run into a problem. i read this article here:

https://v3.vuejs.org/guide/typescript-support.html#using-with-options-api

which talks about how the TS compiler has difficulty inferring types in the Vue framework. Explicitly specifying them with an interface is the preferred method of resolution.

Originally posted by @diracs-delta in #79 (comment)

Describe your refactoring solution ๐Ÿ› ๏ธ

  • identify all instances of Vue instances being cast as any to circumvent TS compiler errors
  • add strict checks to tsconfig.json that disable casts to any
@dlqqq dlqqq added Domain: Dev Experience This issue pertains to a developer's emotions and attitudes when building Grey Software. Role: Software Engineer Uses technology to design, develop, test, and maintain creative software solutions. labels Oct 28, 2020
@dlqqq
Copy link
Contributor Author

dlqqq commented Oct 28, 2020

TS doesn't actually having a compiler option disabling explicit casts to any. we'll just have to wait until we implement ESlint

https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-explicit-any.md

@dlqqq dlqqq self-assigned this Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Dev Experience This issue pertains to a developer's emotions and attitudes when building Grey Software. Role: Software Engineer Uses technology to design, develop, test, and maintain creative software solutions.
Projects
None yet
Development

No branches or pull requests

1 participant