sillsdev / languageforge-lexbox

Language Forge / Language Depot unification project
MIT License
7 stars 2 forks source link

IDE inconsistency: braces around imports in Typescript #989

Open rmunn opened 1 month ago

rmunn commented 1 month ago

It seems like there's an inconsistency between our IDE configurations regarding Typescript imports: JetBrains Rider appears to rewrite imports using no spaces inside the brances, while VS Code appears to use spaces. This results in whitespace-only changes like the following:

diff --git a/frontend/src/lib/gql/gql-client.ts b/frontend/src/lib/gql/gql-client.ts
index 5601795a..5f28a733 100644
--- a/frontend/src/lib/gql/gql-client.ts
+++ b/frontend/src/lib/gql/gql-client.ts
@@ -32,8 +32,8 @@ import {
 import {derived} from 'svelte/store';
 import {cacheExchange} from '@urql/exchange-graphcache';
 import {devtoolsExchange} from '@urql/devtools';
-import type { LexAuthUser } from '$lib/user';
-import { isRedirect } from '@sveltejs/kit';
+import type {LexAuthUser} from '$lib/user';
+import {isRedirect} from '@sveltejs/kit';

 let globalClient: GqlClient | null = null;

This is a minor issue, but it can get slightly annoying trying to do code review when the PR has larger Git diffs than strictly necessary. It would be nice to figure out what settings in Rider or VS Code deal with this issue, and make them consistent.

rmunn commented 1 month ago

Related: Rider also appears to alphabetize imports where VS Code doesn't, which results in changes like this one:

diff --git a/frontend/src/lib/gql/gql-client.ts b/frontend/src/lib/gql/gql-client.ts
index 5601795a..5f28a733 100644
--- a/frontend/src/lib/gql/gql-client.ts
+++ b/frontend/src/lib/gql/gql-client.ts
@@ -16,7 +16,15 @@ import {isObject} from '../util/types';
 import {tracingExchange} from '$lib/otel';
 import {
   type $OpResult,
+  type AddOrgMemberMutationVariables,
+  type BulkAddOrgMembersMutationVariables,
+  type BulkAddProjectMembersMutationVariables,
+  type ChangeOrgMemberRoleMutationVariables,
   type ChangeUserAccountBySelfMutationVariables,
+  type CreateProjectMutation,
+  type CreateProjectMutationVariables,
+  CreateProjectResult,
+  type DeleteDraftProjectMutationVariables,
   type DeleteUserByAdminOrSelfMutationVariables,
   type ExtractErrorTypename,
   type GenericData,
@@ -24,22 +32,16 @@ import {
   isErrorResult,
   type LeaveProjectMutationVariables,
   LexGqlError,
-  type SoftDeleteProjectMutationVariables,
-  type BulkAddProjectMembersMutationVariables,
-  type DeleteDraftProjectMutationVariables,
   type MutationAddProjectToOrgArgs,
   type MutationRemoveProjectFromOrgArgs,
-  type BulkAddOrgMembersMutationVariables,
-  type ChangeOrgMemberRoleMutationVariables,
-  type AddOrgMemberMutationVariables,
-  type CreateProjectMutationVariables,
+  type SoftDeleteProjectMutationVariables,
 } from './types';
 import type {Readable, Unsubscriber} from 'svelte/store';
 import {derived} from 'svelte/store';
 import {cacheExchange} from '@urql/exchange-graphcache';

Again, same issue: more lines than needed to review. Not a big deal, but consistency would be nice.