Impl prettier to project
- Add prettier json config - Format project with prettier config - Enable prettier in zed project settings Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
21
.prettierrc.json
Normal file
21
.prettierrc.json
Normal file
@@ -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
|
||||||
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
nodeLinker: node-modules
|
nodeLinker: node - modules;
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
|
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
|
||||||
|
|
||||||
{
|
{
|
||||||
|
"format_on_save": "on",
|
||||||
|
"formatter": "prettier",
|
||||||
"languages": {
|
"languages": {
|
||||||
"TypeScript": {
|
"TypeScript": {
|
||||||
"language_servers": [
|
"language_servers": [
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
import { defineConfig } from "astro/config";
|
import { defineConfig } from 'astro/config';
|
||||||
import starlight from "@astrojs/starlight";
|
import starlight from '@astrojs/starlight';
|
||||||
import starlightThemeGalaxy from "starlight-theme-galaxy";
|
import starlightThemeGalaxy from 'starlight-theme-galaxy';
|
||||||
|
|
||||||
import mdx from "@astrojs/mdx";
|
import mdx from '@astrojs/mdx';
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [
|
integrations: [
|
||||||
starlight({
|
starlight({
|
||||||
title: "NixCN",
|
title: 'NixCN',
|
||||||
defaultLocale: "root",
|
defaultLocale: 'root',
|
||||||
locales: {
|
locales: {
|
||||||
root: {
|
root: {
|
||||||
label: "简体中文",
|
label: '简体中文',
|
||||||
lang: "zh-CN",
|
lang: 'zh-CN',
|
||||||
},
|
},
|
||||||
en: {
|
en: {
|
||||||
label: "English",
|
label: 'English',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
social: [
|
social: [
|
||||||
{
|
{
|
||||||
icon: "github",
|
icon: 'github',
|
||||||
label: "GitHub",
|
label: 'GitHub',
|
||||||
href: "https://github.com/withastro/starlight",
|
href: 'https://github.com/withastro/starlight',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sidebar: [],
|
sidebar: [],
|
||||||
plugins: [starlightThemeGalaxy()],
|
plugins: [starlightThemeGalaxy()],
|
||||||
}),
|
}),
|
||||||
mdx(),
|
mdx(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
36
package.json
36
package.json
@@ -1,20 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "nixcn-web",
|
"name": "nixcn-web",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
"start": "astro dev",
|
"start": "astro dev",
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/mdx": "^4.3.12",
|
"@astrojs/mdx": "^4.3.12",
|
||||||
"@astrojs/starlight": "^0.37.0",
|
"@astrojs/starlight": "^0.37.0",
|
||||||
"astro": "^5.6.1",
|
"astro": "^5.6.1",
|
||||||
"sharp": "^0.34.2",
|
"sharp": "^0.34.2",
|
||||||
"starlight-theme-galaxy": "^0.5.2"
|
"starlight-theme-galaxy": "^0.5.2"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@4.12.0"
|
"packageManager": "yarn@4.12.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ import { docsLoader } from '@astrojs/starlight/loaders';
|
|||||||
import { docsSchema } from '@astrojs/starlight/schema';
|
import { docsSchema } from '@astrojs/starlight/schema';
|
||||||
|
|
||||||
export const collections = {
|
export const collections = {
|
||||||
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
|
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "astro/tsconfigs/strict",
|
"extends": "astro/tsconfigs/strict",
|
||||||
"include": [".astro/types.d.ts", "**/*"],
|
"include": [".astro/types.d.ts", "**/*"],
|
||||||
"exclude": ["dist"]
|
"exclude": ["dist"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user