eslint-plugin-package-jsonc 1.0.3 → 1.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAYpB,CAAC;AAOF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAarC,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAgBpB,CAAC;AAOF,eAAe,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,15 @@
1
+ import { createRequire } from "node:module";
1
2
  import packageJsoncRule, { clearFixedFiles } from "./rules/package-jsonc.js";
3
+ // Create require function for ESM to read our own package.json
4
+ // This ensures the plugin has its own metadata, avoiding the chicken-and-egg
5
+ // problem where the plugin can't run if the project's package.json is missing.
6
+ const require = createRequire(import.meta.url);
7
+ const { name, version } = require("../package.json");
2
8
  const plugin = {
9
+ meta: {
10
+ name,
11
+ version,
12
+ },
3
13
  rules: {
4
14
  sync: packageJsoncRule,
5
15
  },
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,EAAE,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE7E,MAAM,MAAM,GAAkB;IAC1B,KAAK,EAAE;QACH,IAAI,EAAE,gBAAgB;KACzB;IACD,OAAO,EAAE;QACL,WAAW,EAAE;YACT,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,KAAK,EAAE;gBACH,oBAAoB,EAAE,OAAO;aAChC;SACJ;KACJ;CACJ,CAAC;AAEF,kDAAkD;AAE9C,MACH,CAAC,eAAe,GAAG,eAAe,CAAC;AAEpC,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,gBAAgB,EAAE,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE7E,+DAA+D;AAC/D,6EAA6E;AAC7E,+EAA+E;AAC/E,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAGlD,CAAC;AAEF,MAAM,MAAM,GAAkB;IAC1B,IAAI,EAAE;QACF,IAAI;QACJ,OAAO;KACV;IACD,KAAK,EAAE;QACH,IAAI,EAAE,gBAAgB;KACzB;IACD,OAAO,EAAE;QACL,WAAW,EAAE;YACT,OAAO,EAAE,CAAC,eAAe,CAAC;YAC1B,KAAK,EAAE;gBACH,oBAAoB,EAAE,OAAO;aAChC;SACJ;KACJ;CACJ,CAAC;AAEF,kDAAkD;AAE9C,MACH,CAAC,eAAe,GAAG,eAAe,CAAC;AAEpC,eAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,55 +1,54 @@
1
1
  {
2
- "name": "eslint-plugin-package-jsonc",
3
- "version": "1.0.3",
4
- "description": "ESLint plugin to ensure package.json is consistent with package.jsonc",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "type": "module",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "default": "./dist/index.js"
12
- }
13
- },
14
- "files": [
15
- "dist",
16
- "README.md",
17
- "LICENSE"
18
- ],
19
- "scripts": {
20
- "build": "tsc",
21
- "lint": "tsc --noEmit && eslint",
22
- "format": "prettier --write . --log-level warn",
23
- "test": "vitest run",
24
- "prepublishOnly": "npm run build"
25
- },
26
- "keywords": [
27
- "eslint",
28
- "eslintplugin",
29
- "eslint-plugin",
30
- "package.json",
31
- "package.jsonc",
32
- "jsonc"
33
- ],
34
- "peerDependencies": {
35
- "eslint": ">=8.0.0"
36
- },
37
- "devDependencies": {
38
- "@eslint/compat": "^1.4.0",
39
- "@eslint/js": "^9.36.0",
40
- "@types/eslint": "^9.6.1",
41
- "@types/node": "^25.2.1",
42
- "@vitest/eslint-plugin": "^1.6.6",
43
- "eslint": "^9.39.1",
44
- "eslint-plugin-unicorn": "^62.0.0",
45
- "espree": "^11.1.0",
46
- "globals": "^17.3.0",
47
- "jiti": "^2.6.1",
48
- "prettier": "^3.6.2",
49
- "prettier-plugin-organize-imports": "^4.2.0",
50
- "typescript": "^5",
51
- "typescript-eslint": "^8.48.0",
52
- "vitest": "^4.0.18"
53
- },
54
- "license": "MIT"
55
- }
2
+ "name": "eslint-plugin-package-jsonc",
3
+ "version": "1.0.4",
4
+ "description": "ESLint plugin to ensure package.json is consistent with package.jsonc",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
19
+ "keywords": [
20
+ "eslint",
21
+ "eslintplugin",
22
+ "eslint-plugin",
23
+ "package.json",
24
+ "package.jsonc",
25
+ "jsonc"
26
+ ],
27
+ "peerDependencies": {
28
+ "eslint": ">=8.0.0"
29
+ },
30
+ "devDependencies": {
31
+ "@eslint/compat": "^1.4.0",
32
+ "@eslint/js": "^9.36.0",
33
+ "@types/eslint": "^9.6.1",
34
+ "@types/node": "^25.2.1",
35
+ "@vitest/eslint-plugin": "^1.6.6",
36
+ "eslint": "^9.39.1",
37
+ "eslint-plugin-unicorn": "^62.0.0",
38
+ "espree": "^11.1.0",
39
+ "globals": "^17.3.0",
40
+ "jiti": "^2.6.1",
41
+ "prettier": "^3.6.2",
42
+ "prettier-plugin-organize-imports": "^4.2.0",
43
+ "typescript": "^5",
44
+ "typescript-eslint": "^8.48.0",
45
+ "vitest": "^4.0.18"
46
+ },
47
+ "license": "MIT",
48
+ "scripts": {
49
+ "build": "tsc",
50
+ "lint": "tsc --noEmit && eslint",
51
+ "format": "prettier --write . --log-level warn",
52
+ "test": "vitest run"
53
+ }
54
+ }