Skip to content

Commit bb4f6a0

Browse files
authored
chore: use vitepress v1 (#713)
* chore: use vitepress v1 * fix
1 parent 8a24ef2 commit bb4f6a0

File tree

9 files changed

+1883
-871
lines changed

9 files changed

+1883
-871
lines changed

docs/.vitepress/build-system/build.ts

Lines changed: 0 additions & 65 deletions
This file was deleted.

docs/.vitepress/build-system/shim/path.mjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/.vitepress/build-system/src/eslint.mjs

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/.vitepress/build-system/src/process-shim.mjs

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/.vitepress/config.mts

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1-
import type { DefaultTheme } from "vitepress"
2-
import { defineConfig } from "vitepress"
3-
import { BUNDLED_LANGUAGES } from "shiki"
41
import path from "path"
52
import { fileURLToPath } from "url"
3+
import eslint4b from "vite-plugin-eslint4b"
4+
import type { DefaultTheme } from "vitepress"
5+
import { defineConfig } from "vitepress"
6+
// eslint-disable-next-line import/no-unresolved -- OK
67
import { rules } from "../../lib/all-rules.js"
78
import type { RuleModule } from "../../lib/types.js"
89

9-
// Pre-build cjs packages that cannot be bundled well.
10-
import "./build-system/build"
11-
1210
const dirname = path.dirname(fileURLToPath(import.meta.url))
1311

14-
// Include `json5` as alias for jsonc
15-
const jsonc = BUNDLED_LANGUAGES.find((lang) => lang.id === "jsonc")
16-
if (jsonc) jsonc.aliases = [...(jsonc?.aliases ?? []), "json5"]
17-
1812
function ruleToSidebarItem({
1913
meta: {
2014
docs: { ruleId, ruleName },
@@ -49,14 +43,11 @@ export default defineConfig({
4943
"ESLint plugin for finding RegExp mistakes and RegExp style guide violations.",
5044

5145
vite: {
52-
resolve: {
53-
alias: {
54-
eslint: path.join(dirname, "./build-system/shim/eslint.mjs"),
55-
path: path.join(dirname, "./build-system/shim/path.mjs"),
56-
},
57-
},
46+
plugins: [eslint4b()],
5847
define: {
5948
"process.env.NODE_DEBUG": "false",
49+
"process.platform": JSON.stringify(process.platform),
50+
"process.version": JSON.stringify(process.version),
6051
},
6152
},
6253

docs/.vitepress/theme/components/playground-block.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default {
104104
serializedString !== window.location.hash.slice(1) &&
105105
!this._initializing
106106
) {
107-
window.location.replace(`#${serializedString}`)
107+
history.replaceState(null, "", `#${serializedString}`)
108108
}
109109
},
110110
},

lib/utils/type-tracker/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { TypeTracker, createTypeTracker } from "./tracker"
1+
export { type TypeTracker, createTypeTracker } from "./tracker"

0 commit comments

Comments
 (0)