Skip to content

Commit

Permalink
chore(eslint): autofix unicorn/prefer-node-protocol linter rule
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuoushub committed Aug 22, 2023
1 parent 16a0921 commit b309047
Show file tree
Hide file tree
Showing 339 changed files with 504 additions and 504 deletions.
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,4 +1,4 @@
import path from 'path'
import path from 'node:path'

import { FastifyInstance } from 'fastify'

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,4 +1,4 @@
import path from 'path'
import path from 'node:path'

import { FastifyInstance, FastifyPluginCallback } from 'fastify'

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,4 +1,4 @@
import path from 'path'
import path from 'node:path'

import { FastifyInstance, FastifyPluginCallback } from 'fastify'

Expand Down
4 changes: 2 additions & 2 deletions packages/api-server/src/fastify.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

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

import c from 'ansi-colors'
import type { Handler } from 'aws-lambda'
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
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import fastifyStatic from '@fastify/static'
import { FastifyInstance, FastifyReply } from 'fastify'
Expand Down
8 changes: 4 additions & 4 deletions packages/api-server/src/watch.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env node

import { fork } from 'child_process'
import type { ChildProcess } from 'child_process'
import fs from 'fs'
import path from 'path'
import { fork } from 'node:child_process'
import type { ChildProcess } from 'node:child_process'
import fs from 'node:fs'
import path from 'node:path'

import c from 'ansi-colors'
import chalk from 'chalk'
Expand Down
2 changes: 1 addition & 1 deletion packages/api/__mocks__/@redwoodjs/path.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path'
import path from 'node:path'

const BASE_PATH = path.resolve(__dirname, '../../src/__tests__/fixtures')

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/auth/verifiers/base64Sha1Verifier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHmac, timingSafeEqual } from 'crypto'
import { createHmac, timingSafeEqual } from 'node:crypto'

import {
WebhookVerificationError,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/auth/verifiers/base64Sha256Verifier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHmac, timingSafeEqual } from 'crypto'
import { createHmac, timingSafeEqual } from 'node:crypto'

import {
WebhookVerificationError,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/auth/verifiers/sha1Verifier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHmac, timingSafeEqual } from 'crypto'
import { createHmac, timingSafeEqual } from 'node:crypto'

import {
WebhookVerificationError,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/auth/verifiers/sha256Verifier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHmac, timingSafeEqual } from 'crypto'
import { createHmac, timingSafeEqual } from 'node:crypto'

import {
WebhookVerificationError,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/auth/verifiers/timestampSchemeVerifier.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHmac } from 'crypto'
import { createHmac } from 'node:crypto'

import {
WebhookVerificationError,
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/bins/redwood.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import { createRequire } from 'module'
import { createRequire } from 'node:module'

const requireFromCli = createRequire(
require.resolve('@redwoodjs/cli/package.json')
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/bins/rwfw.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import { createRequire } from 'module'
import { createRequire } from 'node:module'

const requireFromCli = createRequire(
require.resolve('@redwoodjs/cli/package.json')
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/bins/tsc.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
import { createRequire } from 'module'
import { createRequire } from 'node:module'

const requireFromTypeScript = createRequire(
require.resolve('typescript/package.json')
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/logger/logger.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, readFileSync, statSync } from 'fs'
import os from 'os'
import { join } from 'path'
import { existsSync, readFileSync, statSync } from 'node:fs'
import os from 'node:os'
import { join } from 'node:path'

import split from 'split2'

Expand Down
4 changes: 2 additions & 2 deletions packages/auth-providers/auth0/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

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

Expand Down
4 changes: 2 additions & 2 deletions packages/auth-providers/clerk/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

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

Expand Down
4 changes: 2 additions & 2 deletions packages/auth-providers/custom/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import {
isTypeScriptProject,
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/dbAuth/setup/src/setupData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path'
import path from 'node:path'

import password from 'secure-random-password'

Expand Down
4 changes: 2 additions & 2 deletions packages/auth-providers/dbAuth/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import prompts from 'prompts'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path'
import path from 'node:path'

import { getPaths, colors } from '@redwoodjs/cli-helpers'

Expand Down
4 changes: 2 additions & 2 deletions packages/auth-providers/firebase/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

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

Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/firebase/web/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require('path')
const path = require('node:path')

/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
Expand Down
4 changes: 2 additions & 2 deletions packages/auth-providers/netlify/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

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

Expand Down
4 changes: 2 additions & 2 deletions packages/auth-providers/supabase/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

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

Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/supertokens/setup/__mocks__/fs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path'
import path from 'node:path'

const fs = {
...jest.requireActual('fs'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const mockFS = fs as unknown as Omit<jest.Mocked<typeof fs>, 'readdirSync'> & {
__setMockFiles: (files: Record<string, string>) => void
}

import fs from 'fs'
import fs from 'node:fs'

import { extraTask } from '../setupHandler'

Expand Down
4 changes: 2 additions & 2 deletions packages/auth-providers/supertokens/setup/src/setupHandler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

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

Expand Down
2 changes: 1 addition & 1 deletion packages/cli-helpers/__mocks__/fs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path'
import path from 'node:path'

const fs = {
...jest.requireActual('fs'),
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-helpers/src/auth/__tests__/authFiles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ let mockIsTypeScriptProject = true
globalThis.__dirname = __dirname

jest.mock('../../lib/paths', () => {
const path = require('path')
const path = require('node:path')

return {
...jest.requireActual('../../lib/paths'),
Expand All @@ -26,7 +26,7 @@ jest.mock('../../lib/project', () => ({
isTypeScriptProject: () => mockIsTypeScriptProject,
}))

import path from 'path'
import path from 'node:path'

import { getPaths } from '../../lib/paths'
import { apiSideFiles, generateUniqueFileNames } from '../authFiles'
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-helpers/src/auth/__tests__/authTasks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jest.mock('@redwoodjs/telemetry', () => {
})

jest.mock('../../lib/paths', () => {
const path = require('path')
const path = require('node:path')
const actualPaths = jest.requireActual('../../lib/paths')
const basedir = '/mock/setup/path'
const app = mockIsTypeScriptProject ? 'App.tsx' : 'App.jsx'
Expand Down Expand Up @@ -63,8 +63,8 @@ const mockFS = fs as unknown as Omit<jest.Mocked<typeof fs>, 'readdirSync'> & {
readdirSync: () => string[]
}

import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import { getPaths } from '../../lib/paths'
import {
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-helpers/src/auth/__tests__/setupHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jest.mock('@redwoodjs/telemetry', () => {
})

jest.mock('../../lib/paths', () => {
const path = require('path')
const path = require('node:path')
const __dirname = path.resolve()

return {
Expand All @@ -36,8 +36,8 @@ jest.mock('execa', () => {})
jest.mock('listr2')
jest.mock('prompts', () => jest.fn(() => ({ answer: true })))

import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import { Listr } from 'listr2'
import prompts from 'prompts'
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-helpers/src/auth/authFiles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import pascalcase from 'pascalcase'

Expand Down
4 changes: 2 additions & 2 deletions packages/cli-helpers/src/auth/authTasks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import { ListrRenderer, ListrTask, ListrTaskWrapper } from 'listr2'

Expand Down
4 changes: 2 additions & 2 deletions packages/cli-helpers/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import * as babel from '@babel/core'
import {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-helpers/src/lib/project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

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

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/__mocks__/fs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path'
import path from 'node:path'

const fs = {
...jest.requireActual('fs'),
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/__tests__/cwd.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { spawnSync } from 'child_process'
import path from 'path'
import { spawnSync } from 'node:child_process'
import path from 'node:path'

describe('The CLI sets `cwd` correctly', () => {
describe('--cwd', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/__tests__/fs.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
jest.mock('fs')

import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

const INITIAL_FS = {
file_a: 'content_a',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/__tests__/type-check.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jest.mock('../../commands/upgrade', () => {
}
})

import path from 'path'
import path from 'node:path'

import concurrently from 'concurrently'
import execa from 'execa'
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/buildHandler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import execa from 'execa'
import { Listr } from 'listr2'
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/consoleHandler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs'
import path from 'path'
import repl from 'repl'
import fs from 'node:fs'
import path from 'node:path'
import repl from 'node:repl'

import { recordTelemetryAttributes } from '@redwoodjs/cli-helpers'
import { registerApiSideBabelHook } from '@redwoodjs/internal/dist/build/babel/api'
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/dataMigrate/installHandler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path'
import path from 'node:path'

import execa from 'execa'
import fs from 'fs-extra'
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/dataMigrate/upHandler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import { Listr } from 'listr2'

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/deploy/__tests__/nftPack.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import path from 'path'
import fs from 'node:fs'
import path from 'node:path'

import { buildApi } from '@redwoodjs/internal/dist/build/api'
import { findApiDistFunctions } from '@redwoodjs/internal/dist/files'
Expand Down

0 comments on commit b309047

Please sign in to comment.