mirror of https://github.com/YunYouJun/valaxy
chore: fix prefer node protocol lint
This commit is contained in:
parent
4c25fb6c31
commit
5b5d6cc359
|
@ -77,7 +77,7 @@ Config Vite Vue-i18n plugin [@intlify/unplugin-vue-i18n](https://github.com/intl
|
|||
:::
|
||||
|
||||
```ts
|
||||
import path from 'path'
|
||||
import path from 'node:path'
|
||||
import { defineConfig } from 'vite'
|
||||
import VueI18n from '@intlify/unplugin-vue-i18n/vite'
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/env node
|
||||
/* eslint-disable no-console */
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const argv = require('minimist')(process.argv.slice(2))
|
||||
const prompts = require('prompts')
|
||||
const execa = require('execa')
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { resolve } from 'path'
|
||||
import { resolve } from 'node:path'
|
||||
import type { InlineConfig } from 'vite'
|
||||
import { mergeConfig as mergeViteConfig, build as viteBuild } from 'vite'
|
||||
import { build as viteSsgBuild } from 'vite-ssg/node'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import path from 'path'
|
||||
import { exec } from 'child_process'
|
||||
import path from 'node:path'
|
||||
import { exec } from 'node:child_process'
|
||||
import fs from 'fs-extra'
|
||||
import yargs from 'yargs'
|
||||
import type { InlineConfig, LogLevel } from 'vite'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { access } from 'fs/promises'
|
||||
import { type PathLike } from 'fs'
|
||||
import { access } from 'node:fs/promises'
|
||||
import { type PathLike } from 'node:fs'
|
||||
|
||||
export async function exists(path: PathLike) {
|
||||
try {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { writeFile } from 'fs/promises'
|
||||
import { join, resolve } from 'path'
|
||||
import { writeFile } from 'node:fs/promises'
|
||||
import { join, resolve } from 'node:path'
|
||||
import { render } from 'ejs'
|
||||
import dayjs from 'dayjs'
|
||||
import { ensureSuffix } from '@antfu/utils'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import path from 'path'
|
||||
import { readFile } from 'fs/promises'
|
||||
import path from 'node:path'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { resolveOptions } from '../../options'
|
||||
import { exists } from './fs'
|
||||
import { userRoot } from './constants'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { join, resolve } from 'path'
|
||||
import { join, resolve } from 'node:path'
|
||||
import fs from 'fs-extra'
|
||||
import type { ConfigEnv, InlineConfig } from 'vite'
|
||||
import { uniq } from '@antfu/utils'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// copy from vitepress
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import c from 'picocolors'
|
||||
import LRUCache from 'lru-cache'
|
||||
import _debug from 'debug'
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// 1. adding target="_blank" to external links
|
||||
// 2. normalize internal links to end with `.html`
|
||||
|
||||
import { URL } from 'url'
|
||||
import { URL } from 'node:url'
|
||||
import type MarkdownIt from 'markdown-it'
|
||||
import { EXTERNAL_URL_RE, PATHNAME_PROTOCOL_RE } from '../../constants'
|
||||
import type { MarkdownEnv } from '../env'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { dirname, resolve } from 'path'
|
||||
import { dirname, resolve } from 'node:path'
|
||||
import fs from 'fs-extra'
|
||||
import _debug from 'debug'
|
||||
import fg from 'fast-glob'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { dirname, join, resolve } from 'path'
|
||||
import { dirname, join, resolve } from 'node:path'
|
||||
import type { Alias, AliasOptions, InlineConfig, Plugin } from 'vite'
|
||||
import { mergeConfig, searchForWorkspaceRoot } from 'vite'
|
||||
import isInstalledGlobally from 'is-installed-globally'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { join, relative, resolve } from 'path'
|
||||
import { join, relative, resolve } from 'node:path'
|
||||
import fs from 'fs-extra'
|
||||
|
||||
import type { Plugin, ResolvedConfig } from 'vite'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import fs from 'fs'
|
||||
import fs from 'node:fs'
|
||||
import type { PluginOption } from 'vite'
|
||||
import { splitVendorChunkPlugin } from 'vite'
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { existsSync } from 'fs'
|
||||
import { join, resolve } from 'path'
|
||||
import { existsSync } from 'node:fs'
|
||||
import { join, resolve } from 'node:path'
|
||||
import { slash, uniq } from '@antfu/utils'
|
||||
import type { PluginOption } from 'vite'
|
||||
import type { ResolvedValaxyOptions } from '../options'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// ref slidev
|
||||
import { resolve } from 'path'
|
||||
import { resolve } from 'node:path'
|
||||
import fs from 'fs-extra'
|
||||
import { isObject } from '@antfu/utils'
|
||||
import jiti from 'jiti'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { resolve } from 'path'
|
||||
import { existsSync } from 'fs'
|
||||
import { resolve } from 'node:path'
|
||||
import { existsSync } from 'node:fs'
|
||||
import type { VitePluginConfig as UnoCSSConfig, VitePluginConfig } from 'unocss/vite'
|
||||
import jiti from 'jiti'
|
||||
import defu from 'defu'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { dirname } from 'path'
|
||||
import { dirname } from 'node:path'
|
||||
import { cyan, dim } from 'kolorist'
|
||||
|
||||
import fg from 'fast-glob'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { resolve } from 'path'
|
||||
import { resolve } from 'node:path'
|
||||
import fs from 'fs-extra'
|
||||
import defu from 'defu'
|
||||
import { cyan, yellow } from 'kolorist'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as readline from 'readline'
|
||||
import path from 'path'
|
||||
import os from 'os'
|
||||
import * as readline from 'node:readline'
|
||||
import path from 'node:path'
|
||||
import os from 'node:os'
|
||||
|
||||
import { blue, bold, cyan, dim, gray, green, underline, yellow } from 'kolorist'
|
||||
import consola from 'consola'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { join } from 'path'
|
||||
import { join } from 'node:path'
|
||||
import isInstalledGlobally from 'is-installed-globally'
|
||||
import globalDirs from 'global-dirs'
|
||||
import type resolve from 'resolve'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import net from 'net'
|
||||
import net from 'node:net'
|
||||
|
||||
export async function findFreePort(start: number): Promise<number> {
|
||||
if (await isPortFree(start))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { dirname, resolve } from 'path'
|
||||
import fs from 'fs'
|
||||
import { dirname, resolve } from 'node:path'
|
||||
import fs from 'node:fs'
|
||||
import { isPath, resolveImportPath } from '../utils'
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { readFileSync, writeFileSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { readFileSync, writeFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import type { ReleaseType } from 'semver'
|
||||
import semver from 'semver'
|
||||
import consola from 'consola'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { resolve } from 'path'
|
||||
import { resolve } from 'node:path'
|
||||
import fs from 'fs-extra'
|
||||
import type { DefaultThemeConfig } from 'valaxy/types'
|
||||
import type { ResolvedValaxyOptions, ValaxyNodeConfig } from 'valaxy/node'
|
||||
|
|
Loading…
Reference in New Issue