8000 Enhancement: Need different style of project service determination for react-native mixed package · Issue #9901 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content

Enhancement: Need different style of project service determination for react-native mixed package #9901

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

Closed
4 tasks done
ToyboxZach opened this issue Aug 28, 2024 · 4 comments
Labels
awaiting response Issues waiting for a reply from the OP or another party enhancement New feature or request locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.

Comments

@ToyboxZach
Copy link
ToyboxZach commented Aug 28, 2024

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

typescript-estree

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

This link suggested I open an issue explaining my use case:
https://typescript-eslint.io/troubleshooting/typed-linting/#allowdefaultproject-glob-too-wide

I have a problem enabling the project service in my eslint.

I have a mixed directory of both react-native-web and native files ie:

lib/datePicker.tsx
lib/datePicker.ios.tsx

And have setup my React native and my web to correctly read only the correct files, which is the standard way suggested by react-native (or at least it was when I did it)

The problem with the typescript is I may have packages that are available on web, but not on a react-native or vice versa so I end up with two different typescript "packages" that I am building, my website and my app. The app lives under /app/tsconfig.json which prefers .ios files if it exists

and the web lives under /tsconfig.json which ignores .ios files

But for lint I am able to just have one eslint config that covers all of my files.

My problem with the project service is that it wants to use the closest tsconfig to my file, but my .ios files are scattered throughout my whole project so the closest tsconfig.json ends up being wrong one, and the includes don't map correctly.

So, my request is just to let me assign a glob of files to a specific project even though its not the closest, or even just have a default package that can include all of my .ios files that are scattered through my project.

I think this helpful for anyone who uses a system other than "closest file is the best tsconfig" so it could likely help out some monorepo cases too.

Additional Info

No response

@ToyboxZach ToyboxZach added enhancement New feature or request triage Waiting for team members to take a look labels Aug 28, 2024
@bradzacher
Copy link
Member

Quick drive by comment:
If you're looking for complex and customisable setup - could you use project: string[]?

@ToyboxZach
Copy link
Author

That is what we are currently doing, but reading through issues, switching to the project service is in theory supposed to fix the OOM crash I am seeing, only on circleci. I wanted to take a stab at the project service to see if it does actually help, but this is blocking me from doing that.

@JoshuaKGoldberg
Copy link
Member

Hmm, I'm wondering if this is matches the FAQ added in #9871 -> https://main--typescript-eslint.netlify.app/troubleshooting/typed-linting#id-like-to-use-tsconfigs-other-than-tsconfigjsons-for-project-service-type-information? (on our canary branch now, will be published as stable on Monday)

Could you please post a reproduction we can see? I think I get what you're saying but we can't be certain without code to play with.

@JoshuaKGoldberg JoshuaKGoldberg added awaiting response Issues waiting for a reply from the OP or another party and removed triage Waiting for team members to take a look labels Aug 30, 2024
@JoshuaKGoldberg
Copy link
Member

So, following up a couple weeks later:

I think this helpful for anyone who uses a system other than "closest file is the best tsconfig" so it could likely help out some monorepo cases too.

I think this is resolved as "you're holding it wrong". Which might seem kind of hostile at first 😅 but that's really the right direction for TSConfigs. tsconfig.json is your source of type information for editing and linting; any other TSConfigs are ancillary.

Closing this out as a previously-resolved docs issue, but someone let me know if we're going down a wrong path please. Cheers!

@JoshuaKGoldberg JoshuaKGoldberg closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2024
@github-actions github-actions bot added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label Sep 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
awaiting response Issues waiting for a reply from the OP or another party enhancement New feature or request locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
Projects
None yet
Development

No branches or pull requests

3 participants
0