You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at first glance, this is confusing because it spreads the tseslint config but does not spread the eslint config.
the inconsistency makes it looks suspiciously like a bug.
shouldn't they both be spread? or does tseslint explicitly export a different kind of config object?
either way i think this should be documented in the getting started guide (and elsewhere where this spread mismatch is present)
Zamiell
changed the title
Docs: default config spreads typescripteslint but not eslint
Docs: default config spreads tsslint but not eslint
Feb 14, 2024
This is one of the reasons that type-aware configs are really useful -- because we don't need to explain this to anyone when there are types.
We present the code and the new user can try the code. If they remove the spread thinking it's a typo - BAM!! TS will error saying that Array<T> is not assignable to T. Bam clear and explicit documentation and the user self-learned something!
I've asked for the ability to nest arrays to avoid this issue but so far the answer has been no (read more here eslint/eslint#18040).
Yeah, I can see why this is an issue - but given that the answer to eslint/eslint#18040 was 'no' it's just how things are. The docs are "right". And +1 that type-aware configs help with this.
Before You File a Documentation Request Please Confirm You Have Done The Following...
Suggested Changes
in the getting started guide, it says to use:
at first glance, this is confusing because it spreads the tseslint config but does not spread the eslint config.
the inconsistency makes it looks suspiciously like a bug.
shouldn't they both be spread? or does tseslint explicitly export a different kind of config object?
either way i think this should be documented in the getting started guide (and elsewhere where this spread mismatch is present)
Affected URL(s)
https://typescript-eslint.io/getting-started/
The text was updated successfully, but these errors were encountered: