mirror of https://github.com/mitchell/mjfs-us.git
Add prettier and eslint tooling
This commit is contained in:
parent
c792476340
commit
106421c3e5
|
@ -1,4 +1,4 @@
|
||||||
import { defineConfig } from 'vitepress'
|
import { defineConfig } from "vitepress";
|
||||||
|
|
||||||
// https://vitepress.dev/reference/site-config
|
// https://vitepress.dev/reference/site-config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
@ -7,22 +7,22 @@ export default defineConfig({
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
// https://vitepress.dev/reference/default-theme-config
|
// https://vitepress.dev/reference/default-theme-config
|
||||||
nav: [
|
nav: [
|
||||||
{ text: 'Home', link: '/' },
|
{ text: "Home", link: "/" },
|
||||||
{ text: 'Examples', link: '/markdown-examples' }
|
{ text: "Examples", link: "/markdown-examples" },
|
||||||
],
|
],
|
||||||
|
|
||||||
sidebar: [
|
sidebar: [
|
||||||
{
|
{
|
||||||
text: 'Examples',
|
text: "Examples",
|
||||||
items: [
|
items: [
|
||||||
{ text: 'Markdown Examples', link: '/markdown-examples' },
|
{ text: "Markdown Examples", link: "/markdown-examples" },
|
||||||
{ text: 'Runtime API Examples', link: '/api-examples' }
|
{ text: "Runtime API Examples", link: "/api-examples" },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
socialLinks: [
|
socialLinks: [
|
||||||
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
|
{ icon: "github", link: "https://github.com/vuejs/vitepress" },
|
||||||
]
|
],
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
// https://vitepress.dev/guide/custom-theme
|
// https://vitepress.dev/guide/custom-theme
|
||||||
import { h } from 'vue'
|
import { h } from "vue";
|
||||||
import type { Theme } from 'vitepress'
|
import type { Theme } from "vitepress";
|
||||||
import DefaultTheme from 'vitepress/theme'
|
import DefaultTheme from "vitepress/theme";
|
||||||
import './style.css'
|
import "./style.css";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
extends: DefaultTheme,
|
extends: DefaultTheme,
|
||||||
Layout: () => {
|
Layout: () => {
|
||||||
return h(DefaultTheme.Layout, null, {
|
return h(DefaultTheme.Layout, null, {
|
||||||
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
enhanceApp({ app, router, siteData }) {
|
enhanceApp(/*{ app, router, siteData }*/) {
|
||||||
// ...
|
// ...
|
||||||
}
|
},
|
||||||
} satisfies Theme
|
} satisfies Theme;
|
||||||
|
|
|
@ -136,4 +136,3 @@
|
||||||
.DocSearch {
|
.DocSearch {
|
||||||
--docsearch-primary-color: var(--vp-c-brand-1) !important;
|
--docsearch-primary-color: var(--vp-c-brand-1) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,15 @@ const { theme, page, frontmatter } = useData()
|
||||||
## Results
|
## Results
|
||||||
|
|
||||||
### Theme Data
|
### Theme Data
|
||||||
|
|
||||||
<pre>{{ theme }}</pre>
|
<pre>{{ theme }}</pre>
|
||||||
|
|
||||||
### Page Data
|
### Page Data
|
||||||
|
|
||||||
<pre>{{ page }}</pre>
|
<pre>{{ page }}</pre>
|
||||||
|
|
||||||
### Page Frontmatter
|
### Page Frontmatter
|
||||||
|
|
||||||
<pre>{{ frontmatter }}</pre>
|
<pre>{{ frontmatter }}</pre>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -36,12 +39,15 @@ const { site, theme, page, frontmatter } = useData()
|
||||||
## Results
|
## Results
|
||||||
|
|
||||||
### Theme Data
|
### Theme Data
|
||||||
|
|
||||||
<pre>{{ theme }}</pre>
|
<pre>{{ theme }}</pre>
|
||||||
|
|
||||||
### Page Data
|
### Page Data
|
||||||
|
|
||||||
<pre>{{ page }}</pre>
|
<pre>{{ page }}</pre>
|
||||||
|
|
||||||
### Page Frontmatter
|
### Page Frontmatter
|
||||||
|
|
||||||
<pre>{{ frontmatter }}</pre>
|
<pre>{{ frontmatter }}</pre>
|
||||||
|
|
||||||
## More
|
## More
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
import globals from "globals";
|
||||||
|
import pluginJs from "@eslint/js";
|
||||||
|
import tseslint from "typescript-eslint";
|
||||||
|
import pluginVue from "eslint-plugin-vue";
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{ files: ["**/*.{js,mjs,cjs,ts,vue}"] },
|
||||||
|
{ ignores: [".vitepress/dist", ".vitepress/cache"] },
|
||||||
|
{ languageOptions: { globals: globals.browser } },
|
||||||
|
pluginJs.configs.recommended,
|
||||||
|
...tseslint.configs.recommended,
|
||||||
|
...pluginVue.configs["flat/essential"],
|
||||||
|
];
|
1
index.md
1
index.md
|
@ -22,4 +22,3 @@ features:
|
||||||
- title: Feature C
|
- title: Feature C
|
||||||
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
10
package.json
10
package.json
|
@ -3,7 +3,13 @@
|
||||||
"module": "index.md",
|
"module": "index.md",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^9.5.0",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
|
"eslint": "9.x",
|
||||||
|
"eslint-plugin-vue": "^9.26.0",
|
||||||
|
"globals": "^15.6.0",
|
||||||
|
"prettier": "^3.3.2",
|
||||||
|
"typescript-eslint": "^7.13.1",
|
||||||
"vitepress": "^1.2.3",
|
"vitepress": "^1.2.3",
|
||||||
"vue": "^3.4.29"
|
"vue": "^3.4.29"
|
||||||
},
|
},
|
||||||
|
@ -13,6 +19,8 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vitepress dev",
|
"dev": "vitepress dev",
|
||||||
"build": "vitepress build",
|
"build": "vitepress build",
|
||||||
"preview": "vitepress preview"
|
"preview": "vitepress preview",
|
||||||
|
"format": "prettier -w .",
|
||||||
|
"lint": "eslint ."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue