Skip to content

Commit 721c5cb

Browse files
authored
docs: use vitepress instead of vuepress (#57)
* chore: use vitepress instead of vuepress * revert * update color * doc: update class
1 parent 81fc6a2 commit 721c5cb

File tree

66 files changed

+1583
-321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1583
-321
lines changed

.eslintignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.nyc_output
2+
/coverage
3+
/docs/.vitepress/dist
4+
/docs/.vitepress/cache
5+
/node_modules
6+
/test.*
7+
8+
!docs/.vitepress

.github/workflows/GHPages.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Upload artifact
3737
uses: actions/upload-pages-artifact@v1
3838
with:
39-
path: ./docs/.vuepress/dist
39+
path: ./docs/.vitepress/dist/eslint-plugin-es-x
4040
- name: Deploy to GitHub Pages
4141
id: deployment
4242
uses: actions/deploy-pages@v1

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.nyc_output
22
/coverage
3-
/docs/.vuepress/dist
3+
/docs/.vitepress/dist
4+
/docs/.vitepress/cache
45
/node_modules
56
/test.*

docs/.vitepress/.eslintrc.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"use strict"
2+
3+
module.exports = {
4+
rules: {
5+
"node/no-missing-import": "off",
6+
"node/no-extraneous-import": "off",
7+
"node/file-extension-in-import": "off",
8+
"node/no-extraneous-require": "off",
9+
},
10+
globals: {
11+
window: "readonly",
12+
document: "readonly",
13+
},
14+
overrides: [
15+
{
16+
files: ["*.vue"],
17+
rules: {
18+
"vue/multiline-html-element-content-newline": "off",
19+
"vue/singleline-html-element-content-newline": "off",
20+
"vue/name-property-casing": "off",
21+
"vue/html-self-closing": "off",
22+
"vue/comma-dangle": "off",
23+
},
24+
},
25+
],
26+
}

docs/.vitepress/config.js

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
"use strict"
2+
3+
const { defineConfig } = require("vitepress")
4+
const path = require("path")
5+
6+
const { categories } = require("../../scripts/rules.js")
7+
const { viteCommonjs, vitePluginRequireResolve } = require("./vite-plugin")
8+
const { default: eslint4b } = require("vite-plugin-eslint4b")
9+
10+
module.exports = defineConfig({
11+
title: "eslint-plugin-es-x",
12+
base: "/eslint-plugin-es-x/",
13+
description: "ESLint plugin about ECMAScript syntax.",
14+
head: [["link", { rel: "icon", href: "/favicon.png" }]],
15+
16+
outDir: path.resolve(__dirname, "./dist/eslint-plugin-es-x"),
17+
vite: {
18+
publicDir: path.resolve(__dirname, "./public"),
19+
plugins: [eslint4b(), vitePluginRequireResolve(), viteCommonjs()],
20+
define: {
21+
MONACO_EDITOR_VERSION: JSON.stringify(
22+
require("monaco-editor/package.json").version,
23+
),
24+
},
25+
},
26+
27+
lastUpdated: true,
28+
themeConfig: {
29+
editLink: {
30+
pattern:
31+
"https://github.com/eslint-community/eslint-plugin-es-x/edit/master/docs/:path",
32+
},
33+
socialLinks: [
34+
{
35+
icon: "github",
36+
link: "https://github.com/eslint-community/eslint-plugin-es-x",
37+
},
38+
],
39+
40+
nav: [
41+
{ text: "Guide", link: "/" },
42+
{ text: "Rules", link: "/rules/" },
43+
],
44+
45+
sidebar: [
46+
{
47+
items: [
48+
{ text: "Guide", link: "/" },
49+
{ text: "Available Rules", link: "/rules/" },
50+
],
51+
},
52+
...Object.values(categories)
53+
.filter((menu) => menu.rules.length)
54+
.map((category) => ({
55+
text: category.title,
56+
items: category.rules.map(({ ruleId }) => ({
57+
text: `es-x/${ruleId}`,
58+
link: `/rules/${ruleId}`,
59+
})),
60+
})),
61+
],
62+
},
63+
})

docs/.vitepress/theme/Layout.vue

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<script setup>
2+
import { useData } from "vitepress"
3+
import DefaultTheme from "vitepress/theme"
4+
import { computed } from "vue"
5+
const BaseLayout = DefaultTheme.Layout
6+
const { frontmatter } = useData()
7+
const pageClass = computed(() => frontmatter.value.pageClass || "")
8+
</script>
9+
10+
<template>
11+
<div :class="pageClass">
12+
<base-layout />
13+
</div>
14+
</template>
15+
16+
<style scoped>
17+
/* Rule Page */
18+
.rule-details :deep(.main h1 + blockquote ::first-letter) {
19+
text-transform: uppercase;
20+
}
21+
</style>

0 commit comments

Comments
 (0)