prettier-plugin-astro 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -5
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -4,8 +4,19 @@ Official Prettier plugin adding support for formatting `.astro` files.
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
+
First install Prettier and the plugin:
|
|
8
|
+
|
|
7
9
|
```shell
|
|
8
|
-
npm i --save-dev prettier-plugin-astro
|
|
10
|
+
npm i --save-dev prettier prettier-plugin-astro
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Then add the plugin to your Prettier configuration:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
/** @type {import("prettier").Config} */
|
|
17
|
+
export default {
|
|
18
|
+
plugins: ['prettier-plugin-astro'],
|
|
19
|
+
};
|
|
9
20
|
```
|
|
10
21
|
|
|
11
22
|
### Recommended configuration
|
|
@@ -13,8 +24,9 @@ npm i --save-dev prettier-plugin-astro prettier
|
|
|
13
24
|
For optimal compatibility with the different package managers and Prettier plugins, we recommend manually specifying the parser to use for Astro files in your Prettier config as shown in the example below:
|
|
14
25
|
|
|
15
26
|
```js
|
|
16
|
-
|
|
17
|
-
|
|
27
|
+
/** @type {import("prettier").Config} */
|
|
28
|
+
export default {
|
|
29
|
+
plugins: ['prettier-plugin-astro'],
|
|
18
30
|
overrides: [
|
|
19
31
|
{
|
|
20
32
|
files: '*.astro',
|
|
@@ -26,8 +38,6 @@ module.exports = {
|
|
|
26
38
|
};
|
|
27
39
|
```
|
|
28
40
|
|
|
29
|
-
Alternatively, for use inside a non-JS config file, the `require.resolve` call can be changed to a direct path, such as `plugins: ["./node_modules/prettier-plugin-astro"]`.
|
|
30
|
-
|
|
31
41
|
To customize formatting behavior, see the [Configuration](#configuration) section below.
|
|
32
42
|
|
|
33
43
|
## Using in VS Code
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prettier-plugin-astro",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A Prettier Plugin for formatting Astro files",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
"workers/*"
|
|
10
10
|
],
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": "^14.15.0 || >=16.0.0"
|
|
13
|
-
"pnpm": ">=7.14.0"
|
|
12
|
+
"node": "^14.15.0 || >=16.0.0"
|
|
14
13
|
},
|
|
15
14
|
"packageManager": "pnpm@8.6.2",
|
|
16
15
|
"homepage": "https://github.com/withastro/prettier-plugin-astro/",
|