prettier-plugin-insert-comma 1.1.3 → 1.1.4
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 → README.md} +10 -6
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/{readme.md → README.md}
RENAMED
|
@@ -4,6 +4,10 @@ A [Prettier](https://prettier.io/) plugin that automatically inserts missing com
|
|
|
4
4
|
|
|
5
5
|
Prettier cannot format code with syntax errors like missing commas in objects. This plugin runs as a preprocessor to insert commas between properties, allowing Prettier to format your code successfully.
|
|
6
6
|
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Prettier 3.7.0 or higher
|
|
10
|
+
|
|
7
11
|
## Example
|
|
8
12
|
|
|
9
13
|
**Before** — Prettier would throw a parse error:
|
|
@@ -68,10 +72,10 @@ For JSON files, you need to specify the parser explicitly with `overrides`:
|
|
|
68
72
|
}
|
|
69
73
|
```
|
|
70
74
|
|
|
71
|
-
## Supported
|
|
75
|
+
## Supported Languages
|
|
72
76
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
77
|
+
| Language |
|
|
78
|
+
| --------------- |
|
|
79
|
+
| TypeScript, TSX |
|
|
80
|
+
| JavaScript, JSX |
|
|
81
|
+
| JSON |
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import typescriptParser from 'prettier/
|
|
2
|
-
import babelParser from 'prettier/
|
|
1
|
+
import typescriptParser from 'prettier/plugins/typescript';
|
|
2
|
+
import babelParser from 'prettier/plugins/babel';
|
|
3
3
|
function fixMissingCommas(code) {
|
|
4
4
|
let depth = 0;
|
|
5
5
|
let inString = false;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "prettier-plugin-insert-comma",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.4",
|
|
5
5
|
"description": "A Prettier plugin for inserting missing commas in multi-line objects.",
|
|
6
6
|
"funding": "https://github.com/sponsors/refirst11",
|
|
7
7
|
"author": "Refirst11",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"build": "pnpm tsc"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"prettier": "^3.0"
|
|
36
|
+
"prettier": "^3.7.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"typescript": "^5.9.3"
|