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

style(eslint): enable @typescript-eslint/consistent-type-imports #9082

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
98e93c1
chore(eslint): enable `@typescript-eslint/consistent-type-imports`
virtuoushub Aug 29, 2023
417d5b5
chore(eslint): run `yarn lint:fix`
virtuoushub Aug 29, 2023
500dec7
fix(eslint): fix `@typescript-eslint/consistent-type-imports` errors
virtuoushub Aug 29, 2023
e9ae247
Merge branch 'main' into virtuoushub/esm/eslint/@typescript-eslint/co…
virtuoushub Aug 29, 2023
44f8dd2
chore: 🤷🏼
virtuoushub Aug 29, 2023
aa72a98
chore: run `yarn lint:fix`
virtuoushub Aug 29, 2023
1ab00a6
Revert "chore: 🤷🏼"
virtuoushub Aug 29, 2023
0a80bfb
fix: move rule out of `shared.js`
virtuoushub Aug 29, 2023
ba7571b
chore: rebuild test fixture
virtuoushub Aug 29, 2023
9d65f10
revert: keep the stories in test fixture the way they are
virtuoushub Aug 30, 2023
c70f5b6
Merge remote-tracking branch 'upstream/main' into virtuoushub/esm/esl…
virtuoushub Aug 30, 2023
7799a8a
Merge remote-tracking branch 'upstream/main' into virtuoushub/esm/esl…
virtuoushub Aug 31, 2023
e1dea96
chore(eslint): run `yarn lint:fix`
virtuoushub Aug 31, 2023
a62a70a
Merge branch 'main' into virtuoushub/esm/eslint/@typescript-eslint/co…
virtuoushub Aug 31, 2023
b4b3ee0
Merge branch 'main' into virtuoushub/esm/eslint/@typescript-eslint/co…
virtuoushub Aug 31, 2023
9b7db0a
Merge branch 'main' into virtuoushub/esm/eslint/@typescript-eslint/co…
virtuoushub Sep 2, 2023
a3ad87d
chore(eslint): run `yarn lint:fix`
virtuoushub Sep 2, 2023
82b4e84
Merge branch 'main' into virtuoushub/esm/eslint/@typescript-eslint/co…
virtuoushub Sep 4, 2023
b71d82c
Merge branch 'main' into virtuoushub/esm/eslint/@typescript-eslint/co…
virtuoushub Sep 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/api-server/src/__tests__/withApiProxy.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path'

import { FastifyInstance } from 'fastify'
import type { FastifyInstance } from 'fastify'

import withApiProxy from '../plugins/withApiProxy'

Expand Down
2 changes: 1 addition & 1 deletion packages/api-server/src/__tests__/withFunctions.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path'

import { FastifyInstance, FastifyPluginCallback } from 'fastify'
import type { FastifyInstance, FastifyPluginCallback } from 'fastify'

import { loadFastifyConfig } from '../fastify'
import withFunctions from '../plugins/withFunctions'
Expand Down
2 changes: 1 addition & 1 deletion packages/api-server/src/__tests__/withWebServer.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path'

import { FastifyInstance, FastifyPluginCallback } from 'fastify'
import type { FastifyInstance, FastifyPluginCallback } from 'fastify'

import { loadFastifyConfig } from '../fastify'
import withWebServer from '../plugins/withWebServer'
Expand Down
2 changes: 1 addition & 1 deletion packages/api-server/src/cliHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import withApiProxy from './plugins/withApiProxy'
import withFunctions from './plugins/withFunctions'
import withWebServer from './plugins/withWebServer'
import { startServer as startFastifyServer } from './server'
import { BothServerArgs, WebServerArgs, ApiServerArgs } from './types'
import type { BothServerArgs, WebServerArgs, ApiServerArgs } from './types'

/*
* This file has defines CLI handlers used by the redwood cli, for `rw serve`
Expand Down
2 changes: 1 addition & 1 deletion packages/api-server/src/fastify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Fastify from 'fastify'

import { getPaths, getConfig } from '@redwoodjs/project-config'

import { FastifySideConfigFn } from './types'
import type { FastifySideConfigFn } from './types'

const DEFAULT_OPTIONS = {
logger: {
Expand Down
6 changes: 5 additions & 1 deletion packages/api-server/src/plugins/lambdaLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import path from 'path'
import c from 'ansi-colors'
import type { Handler } from 'aws-lambda'
import fg from 'fast-glob'
import { FastifyReply, FastifyRequest, RequestGenericInterface } from 'fastify'
import type {
FastifyReply,
FastifyRequest,
RequestGenericInterface,
} from 'fastify'
import { escape } from 'lodash'

import { getPaths } from '@redwoodjs/project-config'
Expand Down
5 changes: 3 additions & 2 deletions packages/api-server/src/plugins/withApiProxy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import httpProxy, { FastifyHttpProxyOptions } from '@fastify/http-proxy'
import { FastifyInstance } from 'fastify'
import type { FastifyHttpProxyOptions } from '@fastify/http-proxy'
import httpProxy from '@fastify/http-proxy'
import type { FastifyInstance } from 'fastify'

export interface ApiProxyOptions {
apiUrl: string
Expand Down
2 changes: 1 addition & 1 deletion packages/api-server/src/plugins/withFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fastifyUrlData from '@fastify/url-data'
import { FastifyInstance } from 'fastify'
import type { FastifyInstance } from 'fastify'
import fastifyRawBody from 'fastify-raw-body'

import { loadFastifyConfig } from '../fastify'
Expand Down
4 changes: 2 additions & 2 deletions packages/api-server/src/plugins/withWebServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import fs from 'fs'
import path from 'path'

import fastifyStatic from '@fastify/static'
import { FastifyInstance, FastifyReply } from 'fastify'
import type { FastifyInstance, FastifyReply } from 'fastify'

import { getPaths } from '@redwoodjs/project-config'

import { loadFastifyConfig } from '../fastify'
import { WebServerArgs } from '../types'
import type { WebServerArgs } from '../types'

import { findPrerenderedHtml } from './findPrerenderedHtml'

Expand Down
2 changes: 1 addition & 1 deletion packages/api-server/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FastifyInstance } from 'fastify'
import type { FastifyInstance } from 'fastify'

export interface HttpServerParams {
port: number
Expand Down
4 changes: 2 additions & 2 deletions packages/api-server/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FastifyInstance } from 'fastify'
import type { FastifyInstance } from 'fastify'

import { HttpServerParams } from './server'
import type { HttpServerParams } from './server'

export interface WebServerArgs extends Omit<HttpServerParams, 'fastify'> {
apiHost?: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APIGatewayProxyEvent, Context } from 'aws-lambda'
import type { APIGatewayProxyEvent, Context } from 'aws-lambda'

import { getAuthenticationContext } from '../index'

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/cache/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Logger } from '../logger'

import BaseClient from './clients/BaseClient'
import type BaseClient from './clients/BaseClient'
import { CacheTimeoutError } from './errors'

export { default as MemcachedClient } from './clients/MemcachedClient'
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Houses utility types commonly used on the api side
*/

import { O, A } from 'ts-toolbelt'
import type { O, A } from 'ts-toolbelt'

/**
* ---- Prisma SDL Type Merge ----
Expand Down
3 changes: 1 addition & 2 deletions packages/api/src/webhooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { APIGatewayProxyEvent } from 'aws-lambda'

import type { VerifyOptions, SupportedVerifierTypes } from '../auth/verifiers'
import {
createVerifier,
VerifyOptions,
WebhookVerificationError,
DEFAULT_WEBHOOK_SECRET,
SupportedVerifierTypes,
DEFAULT_TOLERANCE,
} from '../auth/verifiers'

Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/auth0/api/src/decoder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import jwt from 'jsonwebtoken'
import jwksClient from 'jwks-rsa'

import { Decoder } from '@redwoodjs/api'
import type { Decoder } from '@redwoodjs/api'

/**
* This takes an auth0 jwt and verifies it. It returns something like this:
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/auth0/setup/src/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as yargs from 'yargs'
import type * as yargs from 'yargs'

import { standardAuthBuilder } from '@redwoodjs/cli-helpers'

Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/auth0/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path'

import { standardAuthHandler } from '@redwoodjs/cli-helpers'

import { Args } from './setup'
import type { Args } from './setup'

const { version } = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '../package.json'), 'utf-8')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
} from '@auth0/auth0-spa-js'
import { renderHook, act } from '@testing-library/react'

import { CurrentUser } from '@redwoodjs/auth'
import type { CurrentUser } from '@redwoodjs/auth'

import { createAuth } from '../auth0'

Expand Down
3 changes: 2 additions & 1 deletion packages/auth-providers/auth0/web/src/auth0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import type {
RedirectLoginOptions,
} from '@auth0/auth0-spa-js'

import { CurrentUser, createAuthentication } from '@redwoodjs/auth'
import type { CurrentUser } from '@redwoodjs/auth'
import { createAuthentication } from '@redwoodjs/auth'

// TODO: Map out this user properly.
export interface Auth0User {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import jwt from 'jsonwebtoken'
import jwksClient from 'jwks-rsa'

import { Decoder } from '@redwoodjs/api'
import type { Decoder } from '@redwoodjs/api'

export const authDecoder: Decoder = async (token: string, type: string) => {
if (type !== 'azureActiveDirectory') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import yargs from 'yargs'
import type yargs from 'yargs'

import { standardAuthBuilder } from '@redwoodjs/cli-helpers'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path'

import { standardAuthHandler } from '@redwoodjs/cli-helpers'

import { Args } from './setup'
import type { Args } from './setup'

const { version } = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '../package.json'), 'utf-8')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
} from '@azure/msal-browser'
import { renderHook, act } from '@testing-library/react'

import { CurrentUser } from '@redwoodjs/auth'
import type { CurrentUser } from '@redwoodjs/auth'

import { createAuth } from '../azureActiveDirectory'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {
import type {
EndSessionRequest,
PublicClientApplication as AzureActiveDirectoryClient,
RedirectRequest,
SilentRequest,
InteractionRequiredAuthError,
} from '@azure/msal-browser'
import { InteractionRequiredAuthError } from '@azure/msal-browser'

import { CurrentUser, createAuthentication } from '@redwoodjs/auth'
import type { CurrentUser } from '@redwoodjs/auth'
import { createAuthentication } from '@redwoodjs/auth'

export function createAuth(
azureActiveDirectoryClient: AzureActiveDirectoryClient,
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/clerk/api/src/decoder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Decoder } from '@redwoodjs/api'
import type { Decoder } from '@redwoodjs/api'

/**
* @deprecated This function will be removed; it uses a rate-limited API. Use `clerkAuthDecoder` instead.
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/clerk/setup/src/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import yargs from 'yargs'
import type yargs from 'yargs'

import { standardAuthBuilder } from '@redwoodjs/cli-helpers'

Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/clerk/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path'

import { standardAuthHandler } from '@redwoodjs/cli-helpers'

import { Args } from './setup'
import type { Args } from './setup'

const { version } = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '../package.json'), 'utf-8')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
import type {
Clerk as ClerkClient,
UserResource,
EmailAddressResource,
ActiveSessionResource,
} from '@clerk/types'
import { renderHook, act } from '@testing-library/react'

import { CurrentUser } from '@redwoodjs/auth'
import type { CurrentUser } from '@redwoodjs/auth'

import { createAuth } from '../clerk'

Expand Down
5 changes: 3 additions & 2 deletions packages/auth-providers/clerk/web/src/clerk.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
SignInProps,
SignUpProps,
SignOutCallback,
Expand All @@ -7,7 +7,8 @@ import {
SignOutOptions,
} from '@clerk/types'

import { CurrentUser, createAuthentication } from '@redwoodjs/auth'
import type { CurrentUser } from '@redwoodjs/auth'
import { createAuthentication } from '@redwoodjs/auth'

type Clerk = ClerkClient | undefined | null

Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/custom/setup/src/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import yargs from 'yargs'
import type yargs from 'yargs'

import { standardAuthBuilder } from '@redwoodjs/cli-helpers'

Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/custom/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
standardAuthHandler,
} from '@redwoodjs/cli-helpers'

import { Args } from './setup'
import type { Args } from './setup'

const { version } = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '../package.json'), 'utf-8')
Expand Down
9 changes: 2 additions & 7 deletions packages/auth-providers/dbAuth/api/src/DbAuthHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@ import CryptoJS from 'crypto-js'
import md5 from 'md5'
import { v4 as uuidv4 } from 'uuid'

import {
CorsConfig,
CorsContext,
CorsHeaders,
createCorsContext,
normalizeRequest,
} from '@redwoodjs/api'
import type { CorsConfig, CorsContext, CorsHeaders } from '@redwoodjs/api'
import { createCorsContext, normalizeRequest } from '@redwoodjs/api'

import * as DbAuthError from './errors'
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/dbAuth/api/src/decoder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { APIGatewayProxyEvent } from 'aws-lambda'

import { Decoder } from '@redwoodjs/api'
import type { Decoder } from '@redwoodjs/api'

import { dbAuthSession } from './shared'

Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/dbAuth/setup/src/setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import terminalLink from 'terminal-link'
import yargs from 'yargs'
import type yargs from 'yargs'

export const command = 'dbAuth'
export const description = 'Set up auth for for dbAuth'
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/dbAuth/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import prompts from 'prompts'

import { standardAuthHandler } from '@redwoodjs/cli-helpers'

import { Args } from './setup'
import type { Args } from './setup'
import { notes, extraTask } from './setupData'
import {
notes as webAuthnNotes,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { renderHook, act } from '@testing-library/react'

import { CurrentUser } from '@redwoodjs/auth'
import type { CurrentUser } from '@redwoodjs/auth'

import { createDbAuthClient, DbAuthClientArgs, createAuth } from '../dbAuth'
import type { DbAuthClientArgs } from '../dbAuth'
import { createDbAuthClient, createAuth } from '../dbAuth'

globalThis.RWJS_API_URL = '/.redwood/functions'
globalThis.RWJS_API_GRAPHQL_URL = '/.redwood/functions/graphql'
Expand Down
5 changes: 3 additions & 2 deletions packages/auth-providers/dbAuth/web/src/dbAuth.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createAuthentication, CurrentUser } from '@redwoodjs/auth'
import type { CurrentUser } from '@redwoodjs/auth'
import { createAuthentication } from '@redwoodjs/auth'

import { WebAuthnClientType } from './webAuthn'
import type { WebAuthnClientType } from './webAuthn'

export interface LoginAttributes {
username: string
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/firebase/api/src/decoder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import admin from 'firebase-admin'
import type { FirebaseError } from 'firebase-admin'

import { Decoder } from '@redwoodjs/api'
import type { Decoder } from '@redwoodjs/api'

// Alternative third-party JWT verification process described here:
// https://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_a_third-party_jwt_library
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/firebase/setup/src/setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import yargs from 'yargs'
import type yargs from 'yargs'

import { standardAuthBuilder } from '@redwoodjs/cli-helpers'

Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/firebase/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path'

import { standardAuthHandler } from '@redwoodjs/cli-helpers'

import { Args } from './setup'
import type { Args } from './setup'

const { version } = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '../package.json'), 'utf-8')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { renderHook, act } from '@testing-library/react'
import type FirebaseAuthNamespace from 'firebase/auth'
import { User, OperationType, OAuthProvider, Auth } from 'firebase/auth'
import type { User, OAuthProvider, Auth } from 'firebase/auth'
import { OperationType } from 'firebase/auth'

import { CurrentUser } from '@redwoodjs/auth'
import type { CurrentUser } from '@redwoodjs/auth'

import { createAuth, FirebaseClient } from '../firebase'
import type { FirebaseClient } from '../firebase'
import { createAuth } from '../firebase'

const user: User = {
uid: 'unique_user_id',
Expand Down
Loading
Loading