diff --git a/content/posts/hooks/React_hooks--useContext.md b/content/posts/react/hooks/React_hooks--useContext.md similarity index 100% rename from content/posts/hooks/React_hooks--useContext.md rename to content/posts/react/hooks/React_hooks--useContext.md diff --git a/content/posts/hooks/React_hooks--useEffect&useLayoutEffect.md b/content/posts/react/hooks/React_hooks--useEffect&useLayoutEffect.md similarity index 100% rename from content/posts/hooks/React_hooks--useEffect&useLayoutEffect.md rename to content/posts/react/hooks/React_hooks--useEffect&useLayoutEffect.md diff --git a/content/posts/hooks/React_hooks--useMemo&useCallback.md b/content/posts/react/hooks/React_hooks--useMemo&useCallback.md similarity index 100% rename from content/posts/hooks/React_hooks--useMemo&useCallback.md rename to content/posts/react/hooks/React_hooks--useMemo&useCallback.md diff --git a/content/posts/hooks/React_hooks--useRef.md b/content/posts/react/hooks/React_hooks--useRef.md similarity index 100% rename from content/posts/hooks/React_hooks--useRef.md rename to content/posts/react/hooks/React_hooks--useRef.md diff --git a/content/posts/hooks/React_hooks--useState&useReducer.md b/content/posts/react/hooks/React_hooks--useState&useReducer.md similarity index 100% rename from content/posts/hooks/React_hooks--useState&useReducer.md rename to content/posts/react/hooks/React_hooks--useState&useReducer.md diff --git "a/content/posts/tool/VsCode\346\240\274\345\274\217\345\214\226\345\273\272\350\256\256.md" "b/content/posts/z-drafts/VsCode\346\240\274\345\274\217\345\214\226\345\273\272\350\256\256.md" similarity index 67% rename from "content/posts/tool/VsCode\346\240\274\345\274\217\345\214\226\345\273\272\350\256\256.md" rename to "content/posts/z-drafts/VsCode\346\240\274\345\274\217\345\214\226\345\273\272\350\256\256.md" index a0cd9c4..90d07f2 100644 --- "a/content/posts/tool/VsCode\346\240\274\345\274\217\345\214\226\345\273\272\350\256\256.md" +++ "b/content/posts/z-drafts/VsCode\346\240\274\345\274\217\345\214\226\345\273\272\350\256\256.md" @@ -1,9 +1,11 @@ ······················--- -title: 'VsCode格式化建议' +title: 'VsCode 格式化建议' date: 2022-09-18T20:37:14+08:00 tags: [tool, vscode] series: [format] categories: [tool] +draft: true + --- ## 前言 @@ -14,8 +16,8 @@ categories: [tool] 进行配置前,确保安装了以下两个插件: -- ESLint -- Prettier - Code formatter +- ESLint +- Prettier - Code formatter ## 配置 @@ -23,10 +25,10 @@ categories: [tool] ```json { - "editor.formatOnSave": true, // 保存时自动格式化 - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true // 保存时自动修复 - } + "editor.formatOnSave": true, // 保存时自动格式化 + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true // 保存时自动修复 + } } ``` @@ -34,16 +36,16 @@ categories: [tool] ```json { - "printWidth": 80, - "tabWidth": 2, - "useTabs": false, - "semi": false, - "singleQuote": true, - "trailingComma": "none", - "bracketSpacing": true, - "arrowParens": "always", - "htmlWhitespaceSensitivity": "ignore", - "endOfLine": "auto" + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "semi": false, + "singleQuote": true, + "trailingComma": "none", + "bracketSpacing": true, + "arrowParens": "always", + "htmlWhitespaceSensitivity": "ignore", + "endOfLine": "auto" } ``` @@ -54,8 +56,8 @@ categories: [tool] 好在社区有了比较好的解决方案: - - `eslint-config-prettier` 让 eslint 忽略与 prettier 产生的冲突 - - `eslint-plugin-prettier` 让 eslint 具有 prettier 格式化的能力 + - `eslint-config-prettier` 让 eslint 忽略与 prettier 产生的冲突 + - `eslint-plugin-prettier` 让 eslint 具有 prettier 格式化的能力 ```sh npm i eslint-config-prettier eslint-plugin-prettier -D @@ -72,21 +74,21 @@ categories: [tool] ```js // node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js module.exports = { - configs: { - recommended: { - extends: ['prettier'], - plugins: ['prettier'], - rules: { - // 让代码文件中不符合prettier格式化规则的都标记为错误, - // 结合vscode-eslint插件便可以看到这些错误被标记为红色, - // 当运行eslint --fix 命令时,将自动修复这些错误。 - 'prettier/prettier': 'error', - 'arrow-body-style': 'off', - 'prefer-arrow-callback': 'off' - } + configs: { + recommended: { + extends: ['prettier'], + plugins: ['prettier'], + rules: { + // 让代码文件中不符合prettier格式化规则的都标记为错误, + // 结合vscode-eslint插件便可以看到这些错误被标记为红色, + // 当运行eslint --fix 命令时,将自动修复这些错误。 + 'prettier/prettier': 'error', + 'arrow-body-style': 'off', + 'prefer-arrow-callback': 'off' + } + } } - } - // ... + // ... } ``` diff --git a/content/posts/study/java/base/java_1.md b/content/posts/z-study/java/base/java_1.md similarity index 100% rename from content/posts/study/java/base/java_1.md rename to content/posts/z-study/java/base/java_1.md diff --git a/content/posts/study/java/base/java_10.md b/content/posts/z-study/java/base/java_10.md similarity index 100% rename from content/posts/study/java/base/java_10.md rename to content/posts/z-study/java/base/java_10.md diff --git a/content/posts/study/java/base/java_11.md b/content/posts/z-study/java/base/java_11.md similarity index 100% rename from content/posts/study/java/base/java_11.md rename to content/posts/z-study/java/base/java_11.md diff --git a/content/posts/study/java/base/java_12.md b/content/posts/z-study/java/base/java_12.md similarity index 100% rename from content/posts/study/java/base/java_12.md rename to content/posts/z-study/java/base/java_12.md diff --git a/content/posts/study/java/base/java_13.md b/content/posts/z-study/java/base/java_13.md similarity index 100% rename from content/posts/study/java/base/java_13.md rename to content/posts/z-study/java/base/java_13.md diff --git a/content/posts/study/java/base/java_14.md b/content/posts/z-study/java/base/java_14.md similarity index 100% rename from content/posts/study/java/base/java_14.md rename to content/posts/z-study/java/base/java_14.md diff --git a/content/posts/study/java/base/java_2.md b/content/posts/z-study/java/base/java_2.md similarity index 100% rename from content/posts/study/java/base/java_2.md rename to content/posts/z-study/java/base/java_2.md diff --git a/content/posts/study/java/base/java_3.md b/content/posts/z-study/java/base/java_3.md similarity index 100% rename from content/posts/study/java/base/java_3.md rename to content/posts/z-study/java/base/java_3.md diff --git a/content/posts/study/java/base/java_4.md b/content/posts/z-study/java/base/java_4.md similarity index 100% rename from content/posts/study/java/base/java_4.md rename to content/posts/z-study/java/base/java_4.md diff --git a/content/posts/study/java/base/java_5.md b/content/posts/z-study/java/base/java_5.md similarity index 100% rename from content/posts/study/java/base/java_5.md rename to content/posts/z-study/java/base/java_5.md diff --git a/content/posts/study/java/base/java_6.md b/content/posts/z-study/java/base/java_6.md similarity index 100% rename from content/posts/study/java/base/java_6.md rename to content/posts/z-study/java/base/java_6.md diff --git a/content/posts/study/java/base/java_7.md b/content/posts/z-study/java/base/java_7.md similarity index 100% rename from content/posts/study/java/base/java_7.md rename to content/posts/z-study/java/base/java_7.md diff --git a/content/posts/study/java/base/java_8.md b/content/posts/z-study/java/base/java_8.md similarity index 100% rename from content/posts/study/java/base/java_8.md rename to content/posts/z-study/java/base/java_8.md diff --git a/content/posts/study/java/base/java_9.md b/content/posts/z-study/java/base/java_9.md similarity index 100% rename from content/posts/study/java/base/java_9.md rename to content/posts/z-study/java/base/java_9.md diff --git a/content/posts/study/java/mybatis/image-1.png b/content/posts/z-study/java/mybatis/image-1.png similarity index 100% rename from content/posts/study/java/mybatis/image-1.png rename to content/posts/z-study/java/mybatis/image-1.png diff --git a/content/posts/study/java/mybatis/image-2.png b/content/posts/z-study/java/mybatis/image-2.png similarity index 100% rename from content/posts/study/java/mybatis/image-2.png rename to content/posts/z-study/java/mybatis/image-2.png diff --git a/content/posts/study/java/mybatis/image.png b/content/posts/z-study/java/mybatis/image.png similarity index 100% rename from content/posts/study/java/mybatis/image.png rename to content/posts/z-study/java/mybatis/image.png diff --git a/content/posts/study/java/mybatis/mybatis.md b/content/posts/z-study/java/mybatis/mybatis.md similarity index 100% rename from content/posts/study/java/mybatis/mybatis.md rename to content/posts/z-study/java/mybatis/mybatis.md diff --git a/content/posts/study/java/mybatis/mybatis_plus.md b/content/posts/z-study/java/mybatis/mybatis_plus.md similarity index 100% rename from content/posts/study/java/mybatis/mybatis_plus.md rename to content/posts/z-study/java/mybatis/mybatis_plus.md diff --git a/content/posts/study/java/spring/spring_1.md b/content/posts/z-study/java/spring/spring_1.md similarity index 100% rename from content/posts/study/java/spring/spring_1.md rename to content/posts/z-study/java/spring/spring_1.md diff --git a/content/posts/study/lerna.md b/content/posts/z-study/lerna.md similarity index 100% rename from content/posts/study/lerna.md rename to content/posts/z-study/lerna.md diff --git "a/content/posts/study/linux\345\237\272\347\241\200.md" "b/content/posts/z-study/linux\345\237\272\347\241\200.md" similarity index 100% rename from "content/posts/study/linux\345\237\272\347\241\200.md" rename to "content/posts/z-study/linux\345\237\272\347\241\200.md" diff --git a/content/posts/study/mysql/JDBC.md b/content/posts/z-study/mysql/JDBC.md similarity index 100% rename from content/posts/study/mysql/JDBC.md rename to content/posts/z-study/mysql/JDBC.md diff --git a/content/posts/study/mysql/mysql_1.md b/content/posts/z-study/mysql/mysql_1.md similarity index 100% rename from content/posts/study/mysql/mysql_1.md rename to content/posts/z-study/mysql/mysql_1.md diff --git a/content/posts/study/mysql/mysql_2.md b/content/posts/z-study/mysql/mysql_2.md similarity index 100% rename from content/posts/study/mysql/mysql_2.md rename to content/posts/z-study/mysql/mysql_2.md diff --git a/content/posts/study/mysql/mysql_3.md b/content/posts/z-study/mysql/mysql_3.md similarity index 100% rename from content/posts/study/mysql/mysql_3.md rename to content/posts/z-study/mysql/mysql_3.md diff --git "a/content/posts/study/node/koa\346\264\213\350\221\261\346\250\241\345\236\213.md" "b/content/posts/z-study/node/koa\346\264\213\350\221\261\346\250\241\345\236\213.md" similarity index 100% rename from "content/posts/study/node/koa\346\264\213\350\221\261\346\250\241\345\236\213.md" rename to "content/posts/z-study/node/koa\346\264\213\350\221\261\346\250\241\345\236\213.md" diff --git "a/content/posts/study/node/node\345\237\272\347\241\200.md" "b/content/posts/z-study/node/node\345\237\272\347\241\200.md" similarity index 100% rename from "content/posts/study/node/node\345\237\272\347\241\200.md" rename to "content/posts/z-study/node/node\345\237\272\347\241\200.md" diff --git "a/content/posts/study/node/node\347\232\204\347\211\271\347\202\271.md" "b/content/posts/z-study/node/node\347\232\204\347\211\271\347\202\271.md" similarity index 100% rename from "content/posts/study/node/node\347\232\204\347\211\271\347\202\271.md" rename to "content/posts/z-study/node/node\347\232\204\347\211\271\347\202\271.md" diff --git a/content/posts/study/node/small_node/index.js b/content/posts/z-study/node/small_node/index.js similarity index 100% rename from content/posts/study/node/small_node/index.js rename to content/posts/z-study/node/small_node/index.js diff --git a/content/posts/study/node/small_node/requestHandler.js b/content/posts/z-study/node/small_node/requestHandler.js similarity index 100% rename from content/posts/study/node/small_node/requestHandler.js rename to content/posts/z-study/node/small_node/requestHandler.js diff --git a/content/posts/study/node/small_node/route.js b/content/posts/z-study/node/small_node/route.js similarity index 100% rename from content/posts/study/node/small_node/route.js rename to content/posts/z-study/node/small_node/route.js diff --git a/content/posts/study/node/small_node/server.js b/content/posts/z-study/node/small_node/server.js similarity index 100% rename from content/posts/study/node/small_node/server.js rename to content/posts/z-study/node/small_node/server.js diff --git a/content/posts/study/rollup.md b/content/posts/z-study/rollup.md similarity index 100% rename from content/posts/study/rollup.md rename to content/posts/z-study/rollup.md diff --git "a/content/posts/study/shell\345\237\272\347\241\200.md" "b/content/posts/z-study/shell\345\237\272\347\241\200.md" similarity index 100% rename from "content/posts/study/shell\345\237\272\347\241\200.md" rename to "content/posts/z-study/shell\345\237\272\347\241\200.md" diff --git "a/content/posts/study/\345\274\200\345\217\221\344\270\200\344\270\252\345\221\275\344\273\244\350\241\214\345\267\245\345\205\267.md" "b/content/posts/z-study/\345\274\200\345\217\221\344\270\200\344\270\252\345\221\275\344\273\244\350\241\214\345\267\245\345\205\267.md" similarity index 100% rename from "content/posts/study/\345\274\200\345\217\221\344\270\200\344\270\252\345\221\275\344\273\244\350\241\214\345\267\245\345\205\267.md" rename to "content/posts/z-study/\345\274\200\345\217\221\344\270\200\344\270\252\345\221\275\344\273\244\350\241\214\345\267\245\345\205\267.md" diff --git a/public/babel/index.html b/public/babel/index.html index bcf1cfa..c0a18df 100644 --- a/public/babel/index.html +++ b/public/babel/index.html @@ -39,7 +39,7 @@ - +