summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.prettierrc.json21
-rw-r--r--.yarnrc.yml2
-rw-r--r--.zed/settings.json2
-rw-r--r--astro.config.mjs58
-rw-r--r--package.json36
-rw-r--r--src/content.config.ts2
-rw-r--r--tsconfig.json6
7 files changed, 75 insertions, 52 deletions
diff --git a/.prettierrc.json b/.prettierrc.json
new file mode 100644
index 0000000..1daf706
--- /dev/null
+++ b/.prettierrc.json
@@ -0,0 +1,21 @@
+{
+ "printWidth": 120,
+ "tabWidth": 4,
+ "useTabs": false,
+ "semi": true,
+ "singleQuote": true,
+ "quoteProps": "as-needed",
+ "jsxSingleQuote": true,
+ "trailingComma": "all",
+ "bracketSpacing": true,
+ "objectWarp": "preserve",
+ "bracketSameLine": false,
+ "arrowParens": "always",
+ "parser": "typescript",
+ "poseWrap": "preserve",
+ "htmlWhitespaceSensitivity": "ignore",
+ "vueIndentScriptAndStyle": false,
+ "endOfLine": "lf",
+ "embeddedLanguageFormatting": "auto",
+ "singleAttributePerLine": false
+}
diff --git a/.yarnrc.yml b/.yarnrc.yml
index 3186f3f..77ebf70 100644
--- a/.yarnrc.yml
+++ b/.yarnrc.yml
@@ -1 +1 @@
-nodeLinker: node-modules
+nodeLinker: node - modules;
diff --git a/.zed/settings.json b/.zed/settings.json
index 777a496..33e8b7a 100644
--- a/.zed/settings.json
+++ b/.zed/settings.json
@@ -4,6 +4,8 @@
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
+ "format_on_save": "on",
+ "formatter": "prettier",
"languages": {
"TypeScript": {
"language_servers": [
diff --git a/astro.config.mjs b/astro.config.mjs
index 9897629..edfe500 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -1,35 +1,35 @@
// @ts-check
-import { defineConfig } from "astro/config";
-import starlight from "@astrojs/starlight";
-import starlightThemeGalaxy from "starlight-theme-galaxy";
+import { defineConfig } from 'astro/config';
+import starlight from '@astrojs/starlight';
+import starlightThemeGalaxy from 'starlight-theme-galaxy';
-import mdx from "@astrojs/mdx";
+import mdx from '@astrojs/mdx';
// https://astro.build/config
export default defineConfig({
- integrations: [
- starlight({
- title: "NixCN",
- defaultLocale: "root",
- locales: {
- root: {
- label: "简体中文",
- lang: "zh-CN",
- },
- en: {
- label: "English",
- },
- },
- social: [
- {
- icon: "github",
- label: "GitHub",
- href: "https://github.com/withastro/starlight",
- },
- ],
- sidebar: [],
- plugins: [starlightThemeGalaxy()],
- }),
- mdx(),
- ],
+ integrations: [
+ starlight({
+ title: 'NixCN',
+ defaultLocale: 'root',
+ locales: {
+ root: {
+ label: '简体中文',
+ lang: 'zh-CN',
+ },
+ en: {
+ label: 'English',
+ },
+ },
+ social: [
+ {
+ icon: 'github',
+ label: 'GitHub',
+ href: 'https://github.com/withastro/starlight',
+ },
+ ],
+ sidebar: [],
+ plugins: [starlightThemeGalaxy()],
+ }),
+ mdx(),
+ ],
});
diff --git a/package.json b/package.json
index 6d4ae15..63e0c3f 100644
--- a/package.json
+++ b/package.json
@@ -1,20 +1,20 @@
{
- "name": "nixcn-web",
- "type": "module",
- "version": "0.0.1",
- "scripts": {
- "dev": "astro dev",
- "start": "astro dev",
- "build": "astro build",
- "preview": "astro preview",
- "astro": "astro"
- },
- "dependencies": {
- "@astrojs/mdx": "^4.3.12",
- "@astrojs/starlight": "^0.37.0",
- "astro": "^5.6.1",
- "sharp": "^0.34.2",
- "starlight-theme-galaxy": "^0.5.2"
- },
- "packageManager": "yarn@4.12.0"
+ "name": "nixcn-web",
+ "type": "module",
+ "version": "0.0.1",
+ "scripts": {
+ "dev": "astro dev",
+ "start": "astro dev",
+ "build": "astro build",
+ "preview": "astro preview",
+ "astro": "astro"
+ },
+ "dependencies": {
+ "@astrojs/mdx": "^4.3.12",
+ "@astrojs/starlight": "^0.37.0",
+ "astro": "^5.6.1",
+ "sharp": "^0.34.2",
+ "starlight-theme-galaxy": "^0.5.2"
+ },
+ "packageManager": "yarn@4.12.0"
}
diff --git a/src/content.config.ts b/src/content.config.ts
index d9ee8c9..d68e795 100644
--- a/src/content.config.ts
+++ b/src/content.config.ts
@@ -3,5 +3,5 @@ import { docsLoader } from '@astrojs/starlight/loaders';
import { docsSchema } from '@astrojs/starlight/schema';
export const collections = {
- docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
+ docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
};
diff --git a/tsconfig.json b/tsconfig.json
index 8bf91d3..1e72ac4 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,5 +1,5 @@
{
- "extends": "astro/tsconfigs/strict",
- "include": [".astro/types.d.ts", "**/*"],
- "exclude": ["dist"]
+ "extends": "astro/tsconfigs/strict",
+ "include": [".astro/types.d.ts", "**/*"],
+ "exclude": ["dist"]
}