Browse Source

prettier-plugin-astro implement

Daniel 1 year ago
parent
commit
9929ea8738
3 changed files with 51 additions and 6 deletions
  1. 11 0
      .prettierrc.js
  2. 38 6
      package-lock.json
  3. 2 0
      package.json

+ 11 - 0
.prettierrc.js

@@ -0,0 +1,11 @@
+module.exports = {
+  plugins: [require.resolve('prettier-plugin-astro')],
+  overrides: [
+    {
+      files: '*.astro',
+      options: {
+        parser: 'astro',
+      },
+    },
+  ],
+};

+ 38 - 6
package-lock.json

@@ -33,6 +33,8 @@
         "npm-run-all": "^4.1.5",
         "postcss": "^8.4.23",
         "postcss-cli": "^10.1.0",
+        "prettier": "^2.8.8",
+        "prettier-plugin-astro": "^0.9.0",
         "rollup": "^3.23.0",
         "rtlcss": "^4.1.0",
         "sass": "^1.62.1",
@@ -87,6 +89,22 @@
         "astro-ls": "bin/nodeServer.js"
       }
     },
+    "node_modules/@astrojs/language-server/node_modules/prettier-plugin-astro": {
+      "version": "0.8.1",
+      "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.8.1.tgz",
+      "integrity": "sha512-lJ/mG/Lz/ccSwNtwqpFS126mtMVzFVyYv0ddTF9wqwrEG4seECjKDAyw/oGv915rAcJi8jr89990nqfpmG+qdg==",
+      "dev": true,
+      "dependencies": {
+        "@astrojs/compiler": "^1.0.1",
+        "prettier": "^2.8.3",
+        "sass-formatter": "^0.7.5",
+        "synckit": "^0.8.4"
+      },
+      "engines": {
+        "node": "^14.15.0 || >=16.0.0",
+        "pnpm": ">=7.14.0"
+      }
+    },
     "node_modules/@astrojs/markdown-remark": {
       "version": "2.2.1",
       "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-2.2.1.tgz",
@@ -8394,9 +8412,9 @@
       }
     },
     "node_modules/prettier-plugin-astro": {
-      "version": "0.8.0",
-      "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.8.0.tgz",
-      "integrity": "sha512-kt9wk33J7HvFGwFaHb8piwy4zbUmabC8Nu+qCw493jhe96YkpjscqGBPy4nJ9TPy9pd7+kEx1zM81rp+MIdrXg==",
+      "version": "0.9.0",
+      "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.9.0.tgz",
+      "integrity": "sha512-LZ47EzCz0RvJBzC2GhtP5MI4ygEci/N5z73MMWAZFIOfSrn53sWCz0pN2HDwDGI7tvGg5Q5dnaX4EBrzkdb2Hg==",
       "dev": true,
       "dependencies": {
         "@astrojs/compiler": "^1.0.1",
@@ -11192,6 +11210,20 @@
         "vscode-languageserver-textdocument": "^1.0.4",
         "vscode-languageserver-types": "^3.17.1",
         "vscode-uri": "^3.0.3"
+      },
+      "dependencies": {
+        "prettier-plugin-astro": {
+          "version": "0.8.1",
+          "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.8.1.tgz",
+          "integrity": "sha512-lJ/mG/Lz/ccSwNtwqpFS126mtMVzFVyYv0ddTF9wqwrEG4seECjKDAyw/oGv915rAcJi8jr89990nqfpmG+qdg==",
+          "dev": true,
+          "requires": {
+            "@astrojs/compiler": "^1.0.1",
+            "prettier": "^2.8.3",
+            "sass-formatter": "^0.7.5",
+            "synckit": "^0.8.4"
+          }
+        }
       }
     },
     "@astrojs/markdown-remark": {
@@ -17019,9 +17051,9 @@
       "dev": true
     },
     "prettier-plugin-astro": {
-      "version": "0.8.0",
-      "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.8.0.tgz",
-      "integrity": "sha512-kt9wk33J7HvFGwFaHb8piwy4zbUmabC8Nu+qCw493jhe96YkpjscqGBPy4nJ9TPy9pd7+kEx1zM81rp+MIdrXg==",
+      "version": "0.9.0",
+      "resolved": "https://registry.npmjs.org/prettier-plugin-astro/-/prettier-plugin-astro-0.9.0.tgz",
+      "integrity": "sha512-LZ47EzCz0RvJBzC2GhtP5MI4ygEci/N5z73MMWAZFIOfSrn53sWCz0pN2HDwDGI7tvGg5Q5dnaX4EBrzkdb2Hg==",
       "dev": true,
       "requires": {
         "@astrojs/compiler": "^1.0.1",

+ 2 - 0
package.json

@@ -81,6 +81,8 @@
     "npm-run-all": "^4.1.5",
     "postcss": "^8.4.23",
     "postcss-cli": "^10.1.0",
+    "prettier": "^2.8.8",
+    "prettier-plugin-astro": "^0.9.0",
     "rollup": "^3.23.0",
     "rtlcss": "^4.1.0",
     "sass": "^1.62.1",