eslint-plugin-package-jsonc 2.0.0 → 2.0.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 +9 -4
- package/dist/index.js +1 -1
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ An ESLint plugin that ensures `package.json` is consistent with `package.jsonc`.
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install --save-dev eslint-plugin-package-jsonc eslint-
|
|
8
|
+
npm install --save-dev eslint-plugin-package-jsonc jsonc-eslint-parser
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
@@ -15,12 +15,17 @@ Add the plugin to your ESLint configuration:
|
|
|
15
15
|
### Flat Config (eslint.config.js)
|
|
16
16
|
|
|
17
17
|
```javascript
|
|
18
|
-
import
|
|
18
|
+
import jsoncParser from "jsonc-eslint-parser";
|
|
19
19
|
import packageJsonc from "eslint-plugin-package-jsonc";
|
|
20
20
|
|
|
21
21
|
export default [
|
|
22
|
-
//
|
|
23
|
-
|
|
22
|
+
// Configure the parser for JSON/JSONC files (handles comments, trailing commas)
|
|
23
|
+
{
|
|
24
|
+
files: ["**/*.json", "**/*.jsonc"],
|
|
25
|
+
languageOptions: {
|
|
26
|
+
parser: jsoncParser,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
24
29
|
// Add package-jsonc/sync rule for package.jsonc files
|
|
25
30
|
{
|
|
26
31
|
// Use "**/package.jsonc" if you have packages in subdirectories (monorepo)
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import packageJsoncRule, { clearFixedFiles } from "./rules/package-jsonc.js";
|
|
|
2
2
|
// Plugin metadata - hardcoded to avoid dependency on package.json
|
|
3
3
|
// This ensures the plugin works even when the project's package.json is missing
|
|
4
4
|
const PLUGIN_NAME = "eslint-plugin-package-jsonc";
|
|
5
|
-
const PLUGIN_VERSION = "
|
|
5
|
+
const PLUGIN_VERSION = "2.0.1";
|
|
6
6
|
const plugin = {
|
|
7
7
|
meta: {
|
|
8
8
|
name: PLUGIN_NAME,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-package-jsonc",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "ESLint plugin to ensure package.json is consistent with package.jsonc",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"@types/node": "^25.2.1",
|
|
35
35
|
"@vitest/eslint-plugin": "^1.6.6",
|
|
36
36
|
"eslint": "^9.39.1",
|
|
37
|
-
"eslint-plugin-jsonc": "^2.21.0",
|
|
38
37
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
39
38
|
"espree": "^11.1.0",
|
|
40
39
|
"globals": "^17.3.0",
|