Skip to content

ESLint: Allow react hook function naming and allow type only imports from index. #16823

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

Merged

Conversation

ryantrem
Copy link
Member

@ryantrem ryantrem commented Jun 27, 2025

  1. Type only imports from index files. We already do this a lot, but always have to suppress the eslint rule. This change allows type only imports from index, but not runtime imports from index (since those would cause unwanted side effects).
  2. Functions that start with use are allowed, even though they are not PascalCase. This is for react hooks. We already have a similar rule that allows react hooks defined as lambdas, this just extends it to regular functions as well.

And update a load of files to remove now unnecessary eslint supressions.

Update eslint rules to allow type only imports from index

Update the eslint rules to allow functions that start with 'use' (react hooks)
@ryantrem ryantrem requested a review from georginahalpern June 27, 2025 16:54
@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

ryantrem added 2 commits June 27, 2025 10:26
Remove now unnecessary eslint suppressions
@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

@ryantrem ryantrem marked this pull request as draft June 27, 2025 17:36
@ryantrem ryantrem changed the title Inspector v2: Allow target to be null or undefined in useProperty (and related functions) ESLint: Allow react hook function naming and allow type only imports from index. Jun 27, 2025
@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/16823/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16823/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16823/merge/?snapshot=refs/pull/16823/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

@ryantrem ryantrem requested a review from VicenteCartas June 27, 2025 19:45
Copy link
Contributor

@VicenteCartas VicenteCartas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

You have changed file(s) that made possible changes to the sandbox.
You can test the sandbox snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/16823/merge/

@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

You have made possible changes to the playground.
You can test the snapshot here:

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16823/merge/

The snapshot playground with the CDN snapshot (only when available):

https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/16823/merge/?snapshot=refs/pull/16823/merge

Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly.

@ryantrem ryantrem marked this pull request as ready for review June 27, 2025 20:11
@ryantrem ryantrem enabled auto-merge (squash) June 27, 2025 20:12
@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

@ryantrem ryantrem merged commit 4397450 into BabylonJS:master Jun 27, 2025
18 of 20 checks passed
@bjsplat
Copy link
Collaborator

bjsplat commented Jun 27, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants