Skip to content

Commit

Permalink
Merge pull request #2517 from specklesystems/alessandro/web-1340-add-…
Browse files Browse the repository at this point in the history
…no-relative-import-rule-to-eslint

chore(core): eslint rule to avoid relative imports
  • Loading branch information
alemagio authored Jul 19, 2024
2 parents 8e3520f + 447b48a commit 07f0ed2
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/server/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable camelcase */
/* eslint-disable no-restricted-imports */
/* istanbul ignore file */
import './bootstrap'
import http from 'http'
Expand Down
6 changes: 6 additions & 0 deletions packages/server/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ const configs = [
}
},
rules: {
'no-restricted-imports': [
'error',
{
patterns: ['.*']
}
],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/no-base-to-string': 'off',
Expand Down
2 changes: 1 addition & 1 deletion packages/server/logging/expressLogging.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger } from './logging'
import { logger } from '@/logging/logging'
import { randomUUID } from 'crypto'
import HttpLogger from 'pino-http'
import { IncomingMessage } from 'http'
Expand Down
2 changes: 1 addition & 1 deletion packages/server/modules/auth/tests/unit/logic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai'
import { describe, it } from 'mocha'
import { getNameFromUserInfo } from '../../domain/logic'
import { getNameFromUserInfo } from '@/modules/auth/domain/logic'

/* eslint-disable camelcase */
describe('getNameFromUserInfo', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/modules/core/graph/resolvers/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
createObjects,
getObjectChildren,
getObjectChildrenQuery
} from '../../services/objects'
} from '@/modules/core/services/objects'

import { Roles } from '@speckle/shared'
import { Resolvers } from '@/modules/core/graph/generated/graphql'
Expand Down
4 changes: 2 additions & 2 deletions packages/server/modules/core/services/streams/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { StreamRecord } from '@/modules/core/helpers/types'
import { logger } from '@/logging/logging'
import { createStreamReturnRecord } from '@/modules/core/services/streams/management'
import { getOnboardingBaseProject } from '@/modules/cross-server-sync/services/onboardingProject'
import { updateStream } from '../../repositories/streams'
import { getUser } from '../users'
import { updateStream } from '@/modules/core/repositories/streams'
import { getUser } from '@/modules/core/services/users'
import {
ContextResourceAccessRules,
isNewResourceAllowed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
createRandomPassword
} from '@/modules/core/helpers/testHelpers'
import { expectToThrow } from '@/test/assertionHelper'
import { PasswordTooShortError } from '../../errors/userinput'
import { findPrimaryEmailForUserFactory } from '../../repositories/userEmails'
import { PasswordTooShortError } from '@/modules/core/errors/userinput'
import { findPrimaryEmailForUserFactory } from '@/modules/core/repositories/userEmails'

describe('Users @core-users', () => {
beforeEach(async () => {
Expand Down
8 changes: 4 additions & 4 deletions packages/server/modules/core/tests/streams.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import {
deleteStream,
getStreamUsers,
grantPermissionsStream
} from '../services/streams'
} from '@/modules/core/services/streams'

import {
createBranch,
getBranchByNameAndStreamId,
deleteBranchById
} from '../services/branches'
import { createObject } from '../services/objects'
import { createCommitByBranchName } from '../services/commits'
} from '@/modules/core/services/branches'
import { createObject } from '@/modules/core/services/objects'
import { createCommitByBranchName } from '@/modules/core/services/commits'

import { beforeEachContext, truncateTables } from '@/test/hooks'
import {
Expand Down
6 changes: 5 additions & 1 deletion packages/server/modules/serverinvites/services/validation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { UserRecord } from '@/modules/core/helpers/types'
import { CreateInviteParams } from '@/modules/serverinvites/domain/operations'
import { InviteCreateValidationError } from '@/modules/serverinvites/errors'
import { ResourceTargets, isServerInvite, resolveTarget } from '../helpers/inviteHelper'
import {
ResourceTargets,
isServerInvite,
resolveTarget
} from '@/modules/serverinvites/helpers/inviteHelper'
import { UserWithOptionalRole } from '@/modules/core/repositories/users'
import { authorizeResolver } from '@/modules/shared'
import { Roles } from '@speckle/shared'
Expand Down

0 comments on commit 07f0ed2

Please sign in to comment.