Kirk Waiblinger

Results 103 comments of Kirk Waiblinger

Hmmm, the comments in this PR tell an interesting story for this case: #3009 This behavior seems to be intentional... a) autofix is not available when there is a (nonempty)...

Hmmmm, note also that ```diff -export const marker = "marker" as const; +export const marker = "marker"; export interface Data { marker: typeof marker; value: string; } function createData(): Data...

```diff -export const marker = "marker" as const; +export const marker = "marker"; export interface Data { marker: typeof marker; value: string; } function createData(): Data { - const base...

> > works... and makes a whole lot more sense anyway. > > In this case, yes, but that will affect all other attributes of the object. For example, if...

I also note that putting `const marker = 'marker' as 'marker'` also has the same impact in these examples as `const marker = 'marker' as const`. I guess it seems...

I've just learned that TS appears to have intentional behavior around the "freshness" of a `const` variable type (see https://github.com/microsoft/TypeScript/pull/52473#discussion_r1096104099), though it's not clear that it's a particularly external-facing concept....

> See also discussion in #9335. Coming from that issue, sounds like we have consensus to proceed with banning the `{ a: 0 } < { a: 0 }` case,...

Note that the original proposals for this type of rule use the verbage "no-useless-interpolation". See - https://github.com/typescript-eslint/typescript-eslint/issues/2846, - https://github.com/eslint/eslint/issues/10798

FWIW, the very first sentence on the MDN page uses the term "interpolation" https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals, so I'm skeptical that it's not a widely recognized term. That said, I do very much...