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

Docs: default config spreads tsslint but not eslint #8471

Closed
2 tasks done
Zamiell opened this issue Feb 14, 2024 · 2 comments
Closed
2 tasks done

Docs: default config spreads tsslint but not eslint #8471

Zamiell opened this issue Feb 14, 2024 · 2 comments
Labels
documentation Documentation ("docs") that needs adding/updating wontfix This will not be worked on

Comments

@Zamiell
Copy link
Contributor

Zamiell commented Feb 14, 2024

Before You File a Documentation Request Please Confirm You Have Done The Following...

Suggested Changes

in the getting started guide, it says to use:

export default tseslint.config(
  eslint.configs.recommended,
  ...tseslint.configs.recommended,
);

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/

@Zamiell Zamiell added documentation Documentation ("docs") that needs adding/updating triage Waiting for maintainers to take a look labels Feb 14, 2024
@Zamiell Zamiell changed the title Docs: default config spreads typescripteslint but not eslint Docs: default config spreads tsslint but not eslint Feb 14, 2024
@bradzacher
Copy link
Member

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).

@JoshuaKGoldberg
Copy link
Member

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.

Thanks for filing though!

@JoshuaKGoldberg JoshuaKGoldberg closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2024
@JoshuaKGoldberg JoshuaKGoldberg added wontfix This will not be worked on and removed triage Waiting for maintainers to take a look labels Feb 23, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Documentation ("docs") that needs adding/updating wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants