HackerTrans
热门最新趋势评论往期问答秀出招聘

kipple

no profile record

评论

kipple
·7个月前·讨论
Similar article = https://distantprovince.by/posts/its-rude-to-show-ai-output-...

> My own take on AI etiquette is that AI output can only be relayed if it's either adopted as your own or there is explicit consent from the receiving party.
kipple
·5年前·讨论
Looks like eslint is working on a new set of rules that would help with these currently-unprotected any cases: https://github.com/typescript-eslint/typescript-eslint/issue...

> Create a rule which uses type information to determine when you're inadvertently breaking type safety by using an any, potentially without knowing.

> Often libraries (or even the typescript defs themselves) can have weak(/lazy) types which return any. If you're not careful, you can inadvertently introduce anys within your codebase, leading to bugs that aren't caught by the compiler.
kipple
·5年前·讨论
This particular example is close to my heart: the definition files for things like JSON.parse() were written before the "unknown" type was introduced as an alternative to "any"

And because this "any" is coming from an external definition file, it can't be caught by tsc's --noImplicitAny nor eslint's no-explicit-any

Those two rules allow us to protect us from our own code, but not external definitions/libraries. Relevant GitHub issue here — https://github.com/microsoft/TypeScript/issues/26188