Skip to content

Commit

Permalink
style: update prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
StarHeartHunt committed Nov 8, 2023
1 parent 23afacf commit 44b595d
Show file tree
Hide file tree
Showing 21 changed files with 196 additions and 195 deletions.
68 changes: 34 additions & 34 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,75 @@ module.exports = {
es2022: true,
browser: true,
},
extends: ['eslint:recommended', 'plugin:astro/recommended'],
extends: ["eslint:recommended", "plugin:astro/recommended"],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaVersion: "latest",
sourceType: "module",
},
rules: { 'no-unused-vars': 'off' },
rules: { "no-unused-vars": "off" },
settings: {
react: {
pragma: 'h',
version: '16.0',
pragma: "h",
version: "16.0",
},
},
globals: { astroHTML: true },
overrides: [
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
files: ["*.astro"],
parser: "astro-eslint-parser",
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro'],
parser: "@typescript-eslint/parser",
extraFileExtensions: [".astro"],
},
rules: {},
},
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
extends: ['plugin:@typescript-eslint/recommended'],
files: ["*.ts"],
parser: "@typescript-eslint/parser",
extends: ["plugin:@typescript-eslint/recommended"],
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' },
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" },
],
'@typescript-eslint/no-non-null-assertion': 'off',
"@typescript-eslint/no-non-null-assertion": "off",
},
},
{
files: ['*.d.ts'],
files: ["*.d.ts"],
rules: {
'@typescript-eslint/triple-slash-reference': 'off',
"@typescript-eslint/triple-slash-reference": "off",
},
},
{
files: ['*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['react', '@typescript-eslint'],
files: ["*.tsx"],
parser: "@typescript-eslint/parser",
plugins: ["react", "@typescript-eslint"],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
project: ["./tsconfig.json"],
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
"eslint:recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' },
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" },
],
'@typescript-eslint/no-non-null-assertion': 'off',
"@typescript-eslint/no-non-null-assertion": "off",
},
},
{
// Define the configuration for `<script>` tag.
// Script in `<script>` is assigned a virtual file name with the `.js` extension.
files: ['**/*.astro/*.js', '*.astro/*.js'],
parser: '@typescript-eslint/parser',
files: ["**/*.astro/*.js", "*.astro/*.js"],
parser: "@typescript-eslint/parser",
},
],
};
2 changes: 1 addition & 1 deletion .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Setup Node
description: Setup Node

runs:
using: 'composite'
using: "composite"
steps:
- name: Install Node.js
uses: actions/setup-node@v3
Expand Down
11 changes: 6 additions & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"overrides": [
{
"files": ["**/*.astro"],
"options": {
"parser": "astro"
}
}
]
],
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
52 changes: 26 additions & 26 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import { rehypeHeadingIds } from '@astrojs/markdown-remark';
import mdx from '@astrojs/mdx';
import react from '@astrojs/react';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import compress from 'astro-compress';
import { defineConfig } from 'astro/config';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypePrettyCode from 'rehype-pretty-code';
import remarkCollapse from 'remark-collapse';
import remarkToc from 'remark-toc';
import Icons from 'unplugin-icons/vite';
import { remarkReadingTime } from './src/utils/frontmatter';
import { rehypeHeadingIds } from "@astrojs/markdown-remark";
import mdx from "@astrojs/mdx";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
import tailwind from "@astrojs/tailwind";
import compress from "astro-compress";
import { defineConfig } from "astro/config";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import remarkCollapse from "remark-collapse";
import remarkToc from "remark-toc";
import Icons from "unplugin-icons/vite";
import { remarkReadingTime } from "./src/utils/frontmatter";

// https://astro.build/config
export default defineConfig({
site: 'https://baka.icu',
site: "https://baka.icu",
markdown: {
syntaxHighlight: false,
shikiConfig: {
theme: 'one-dark-pro',
theme: "one-dark-pro",
},
remarkPlugins: [
remarkToc,
[
remarkCollapse,
{
test: 'Table of contents',
test: "Table of contents",
},
],
remarkReadingTime,
Expand All @@ -35,20 +35,20 @@ export default defineConfig({
[
rehypeAutolinkHeadings,
{
behavior: 'append',
behavior: "append",
properties: {
className: ['heading-anchor'],
className: ["heading-anchor"],
},
content: {
type: 'text',
value: '\u200B',
type: "text",
value: "\u200B",
},
},
],
[
rehypePrettyCode,
{
theme: 'one-dark-pro',
theme: "one-dark-pro",
keepBackground: true,
// Callback hooks to add custom logic to nodes when visiting
// them.
Expand All @@ -58,8 +58,8 @@ export default defineConfig({
if (node.children.length === 0) {
node.children = [
{
type: 'text',
value: ' ',
type: "text",
value: " ",
},
];
}
Expand All @@ -70,15 +70,15 @@ export default defineConfig({
};
}) {
// Each line node by default has `class="line"`.
node.properties.className.push('highlighted');
node.properties.className.push("highlighted");
},
onVisitHighlightedWord(node: {
properties: {
className: string[];
};
}) {
// Each word node has no className by default.
node.properties.className = ['word'];
node.properties.className = ["word"];
},
},
],
Expand All @@ -87,7 +87,7 @@ export default defineConfig({
vite: {
plugins: [
Icons({
compiler: 'astro',
compiler: "astro",
}),
],
},
Expand Down
10 changes: 5 additions & 5 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
plugins: [
require('postcss-import'),
require('@tailwindcss/nesting'),
require('tailwindcss'),
require('autoprefixer'),
require('cssnano'),
require("postcss-import"),
require("@tailwindcss/nesting"),
require("tailwindcss"),
require("autoprefixer"),
require("cssnano"),
],
};
2 changes: 1 addition & 1 deletion src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import HeaderLink from './HeaderLink.astro';
<UilGithubAlt />
</HeaderLink>
<HeaderLink>
<ThemeSwitcher client:only>
<ThemeSwitcher client:load>
<RiSunLine slot="dayIcon" />
<RiMoonLine slot="nightIcon" />
</ThemeSwitcher>
Expand Down
2 changes: 1 addition & 1 deletion src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Place any global data in this file.
// You can import this data from anywhere in your site by using the `import` keyword.

export const SITE_TITLE = 'StarHeart';
export const SITE_TITLE = "StarHeart";
export const SITE_DESCRIPTION = "StarHeart's Blog";
28 changes: 14 additions & 14 deletions src/content/blog/about.mdx
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
---
title: 'StarHeart'
description: 'StarHeart'
pubDate: 'Oct 11 2023'
heroImage: '/placeholder-hero.jpg'
title: "StarHeart"
description: "StarHeart"
pubDate: "Oct 11 2023"
heroImage: "/placeholder-hero.jpg"
hidden: true
---

import IconLinkGroup from '../../components/IconLinkGroup.astro';
import SimpleIconsGithub from '~icons/simple-icons/github';
import SimpleIconsTwitter from '~icons/simple-icons/twitter';
import SimpleIconsBilibili from '~icons/simple-icons/bilibili';
import IconLinkGroup from "../../components/IconLinkGroup.astro";
import SimpleIconsGithub from "~icons/simple-icons/github";
import SimpleIconsTwitter from "~icons/simple-icons/twitter";
import SimpleIconsBilibili from "~icons/simple-icons/bilibili";

export const links = [
{
icon: SimpleIconsGithub,
link: 'https://github.com/StarHeartHunt',
name: 'GitHub',
link: "https://github.com/StarHeartHunt",
name: "GitHub",
},
{
icon: SimpleIconsTwitter,
link: 'https://twitter.com/StarHeartHunt',
name: 'Twitter',
link: "https://twitter.com/StarHeartHunt",
name: "Twitter",
},
{
icon: SimpleIconsBilibili,
link: 'https://space.bilibili.com/8499524',
name: '哔哩哔哩',
link: "https://space.bilibili.com/8499524",
name: "哔哩哔哩",
},
];

Expand Down
8 changes: 4 additions & 4 deletions src/content/blog/first-post.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 'First post'
description: 'Lorem ipsum dolor sit amet'
pubDate: 'Jul 08 2022'
heroImage: '/placeholder-hero.jpg'
title: "First post"
description: "Lorem ipsum dolor sit amet"
pubDate: "Jul 08 2022"
heroImage: "/placeholder-hero.jpg"
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
Expand Down
8 changes: 4 additions & 4 deletions src/content/blog/markdown-style-guide.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 'Markdown Style Guide'
description: 'Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.'
pubDate: 'Jul 01 2022'
heroImage: '/placeholder-hero.jpg'
title: "Markdown Style Guide"
description: "Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro."
pubDate: "Jul 01 2022"
heroImage: "/placeholder-hero.jpg"
---

Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.
Expand Down
8 changes: 4 additions & 4 deletions src/content/blog/second-post.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 'Second post'
description: 'Lorem ipsum dolor sit amet'
pubDate: 'Jul 22 2022'
heroImage: '/placeholder-hero.jpg'
title: "Second post"
description: "Lorem ipsum dolor sit amet"
pubDate: "Jul 22 2022"
heroImage: "/placeholder-hero.jpg"
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet.
Expand Down
8 changes: 4 additions & 4 deletions src/content/blog/third-post.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 'Third post'
description: 'Lorem ipsum dolor sit amet'
pubDate: 'Jul 15 2022'
heroImage: '/placeholder-hero.jpg'
title: "Third post"
description: "Lorem ipsum dolor sit amet"
pubDate: "Jul 15 2022"
heroImage: "/placeholder-hero.jpg"
---

## Table of contents
Expand Down
Loading

0 comments on commit 44b595d

Please sign in to comment.