@checkdigit/eslint-plugin 7.0.0-PR.88-a0ce → 7.0.0-PR.88-5b1b

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.
@@ -11603,8 +11603,13 @@
11603
11603
  "format": "esm"
11604
11604
  },
11605
11605
  "src/index.ts": {
11606
- "bytes": 3510,
11606
+ "bytes": 3899,
11607
11607
  "imports": [
11608
+ {
11609
+ "path": "node:fs",
11610
+ "kind": "import-statement",
11611
+ "external": true
11612
+ },
11608
11613
  {
11609
11614
  "path": "src/invalid-json-stringify.ts",
11610
11615
  "kind": "import-statement",
@@ -12071,6 +12076,11 @@
12071
12076
  "path": "node:assert",
12072
12077
  "kind": "require-call",
12073
12078
  "external": true
12079
+ },
12080
+ {
12081
+ "path": "node:fs",
12082
+ "kind": "require-call",
12083
+ "external": true
12074
12084
  }
12075
12085
  ],
12076
12086
  "exports": [],
@@ -12209,7 +12219,7 @@
12209
12219
  "bytesInOutput": 316
12210
12220
  },
12211
12221
  "node_modules/resolve-from/index.js": {
12212
- "bytesInOutput": 1431
12222
+ "bytesInOutput": 1433
12213
12223
  },
12214
12224
  "node_modules/callsites/index.js": {
12215
12225
  "bytesInOutput": 461
@@ -12377,7 +12387,7 @@
12377
12387
  "bytesInOutput": 157
12378
12388
  },
12379
12389
  "node_modules/@eslint/eslintrc/dist/eslintrc.cjs": {
12380
- "bytesInOutput": 104228
12390
+ "bytesInOutput": 104259
12381
12391
  },
12382
12392
  "node_modules/@eslint/js/src/configs/eslint-all.js": {
12383
12393
  "bytesInOutput": 7489
@@ -12389,7 +12399,7 @@
12389
12399
  "bytesInOutput": 260
12390
12400
  },
12391
12401
  "node_modules/eslint/lib/cli-engine/file-enumerator.js": {
12392
- "bytesInOutput": 13004
12402
+ "bytesInOutput": 13007
12393
12403
  },
12394
12404
  "node_modules/eslint/package.json": {
12395
12405
  "bytesInOutput": 7849
@@ -13538,7 +13548,7 @@
13538
13548
  "bytesInOutput": 4470
13539
13549
  },
13540
13550
  "node_modules/eslint/lib/config/config.js": {
13541
- "bytesInOutput": 5990
13551
+ "bytesInOutput": 5992
13542
13552
  },
13543
13553
  "node_modules/eslint/lib/config/flat-config-array.js": {
13544
13554
  "bytesInOutput": 4758
@@ -13559,7 +13569,7 @@
13559
13569
  "bytesInOutput": 2363
13560
13570
  },
13561
13571
  "node_modules/eslint/lib/linter/linter.js": {
13562
- "bytesInOutput": 63184
13572
+ "bytesInOutput": 63187
13563
13573
  },
13564
13574
  "node_modules/eslint/lib/linter/index.js": {
13565
13575
  "bytesInOutput": 308
@@ -13592,7 +13602,7 @@
13592
13602
  "bytesInOutput": 262
13593
13603
  },
13594
13604
  "node_modules/eslint/lib/eslint/eslint-helpers.js": {
13595
- "bytesInOutput": 20276
13605
+ "bytesInOutput": 20279
13596
13606
  },
13597
13607
  "node_modules/json-buffer/index.js": {
13598
13608
  "bytesInOutput": 1665
@@ -13604,22 +13614,22 @@
13604
13614
  "bytesInOutput": 3019
13605
13615
  },
13606
13616
  "node_modules/flat-cache/src/utils.js": {
13607
- "bytesInOutput": 794
13617
+ "bytesInOutput": 798
13608
13618
  },
13609
13619
  "node_modules/flat-cache/src/del.js": {
13610
- "bytesInOutput": 824
13620
+ "bytesInOutput": 832
13611
13621
  },
13612
13622
  "node_modules/flat-cache/src/cache.js": {
13613
- "bytesInOutput": 6615
13623
+ "bytesInOutput": 6617
13614
13624
  },
13615
13625
  "node_modules/file-entry-cache/cache.js": {
13616
- "bytesInOutput": 8597
13626
+ "bytesInOutput": 8603
13617
13627
  },
13618
13628
  "node_modules/json-stable-stringify-without-jsonify/index.js": {
13619
13629
  "bytesInOutput": 2959
13620
13630
  },
13621
13631
  "node_modules/eslint/lib/cli-engine/lint-result-cache.js": {
13622
- "bytesInOutput": 5038
13632
+ "bytesInOutput": 5042
13623
13633
  },
13624
13634
  "node_modules/@humanwhocodes/retry/dist/retrier.cjs": {
13625
13635
  "bytesInOutput": 5857
@@ -13634,31 +13644,31 @@
13634
13644
  "bytesInOutput": 1193
13635
13645
  },
13636
13646
  "node_modules/locate-path/index.js": {
13637
- "bytesInOutput": 1703
13647
+ "bytesInOutput": 1708
13638
13648
  },
13639
13649
  "node_modules/path-exists/index.js": {
13640
- "bytesInOutput": 553
13650
+ "bytesInOutput": 556
13641
13651
  },
13642
13652
  "node_modules/find-up/index.js": {
13643
13653
  "bytesInOutput": 2238
13644
13654
  },
13645
13655
  "node_modules/eslint/lib/config/config-loader.js": {
13646
- "bytesInOutput": 19050
13656
+ "bytesInOutput": 19052
13647
13657
  },
13648
13658
  "node_modules/eslint/lib/eslint/eslint.js": {
13649
- "bytesInOutput": 26271
13659
+ "bytesInOutput": 26277
13650
13660
  },
13651
13661
  "node_modules/eslint/conf/default-cli-options.js": {
13652
13662
  "bytesInOutput": 783
13653
13663
  },
13654
13664
  "node_modules/eslint/lib/cli-engine/load-rules.js": {
13655
- "bytesInOutput": 759
13665
+ "bytesInOutput": 761
13656
13666
  },
13657
13667
  "node_modules/eslint/lib/cli-engine/cli-engine.js": {
13658
- "bytesInOutput": 24097
13668
+ "bytesInOutput": 24108
13659
13669
  },
13660
13670
  "node_modules/eslint/lib/eslint/legacy-eslint.js": {
13661
- "bytesInOutput": 20904
13671
+ "bytesInOutput": 20906
13662
13672
  },
13663
13673
  "node_modules/eslint/lib/unsupported-api.js": {
13664
13674
  "bytesInOutput": 494
@@ -14192,7 +14202,7 @@
14192
14202
  "bytesInOutput": 2060
14193
14203
  },
14194
14204
  "src/index.ts": {
14195
- "bytesInOutput": 2307
14205
+ "bytesInOutput": 2638
14196
14206
  },
14197
14207
  "package.json": {
14198
14208
  "bytesInOutput": 3085
@@ -14246,7 +14256,7 @@
14246
14256
  "bytesInOutput": 3362
14247
14257
  }
14248
14258
  },
14249
- "bytes": 3750711
14259
+ "bytes": 3751505
14250
14260
  }
14251
14261
  }
14252
14262
  }
@@ -1,4 +1,5 @@
1
1
  // src/index.ts
2
+ import fs from "node:fs";
2
3
  import invalidJsonStringify, { ruleId as invalidJsonStringifyRuleId } from "./invalid-json-stringify.mjs";
3
4
  import noFullResponse, { ruleId as noFullResponseRuleId } from "./agent/no-full-response.mjs";
4
5
  import noPromiseInstanceMethod, { ruleId as noPromiseInstanceMethodRuleId } from "./no-promise-instance-method.mjs";
@@ -17,7 +18,13 @@ import objectLiteralResponse from "./object-literal-response.mjs";
17
18
  import regexComment from "./regular-expression-comment.mjs";
18
19
  import requireAssertPredicateRejectsThrows from "./require-assert-predicate-rejects-throws.mjs";
19
20
  import requireStrictAssert from "./require-strict-assert.mjs";
20
- var src_default = {
21
+ var pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"));
22
+ var plugin = {
23
+ // preferred location of name and version
24
+ meta: {
25
+ name: pkg.name,
26
+ version: pkg.version
27
+ },
21
28
  rules: {
22
29
  "file-path-comment": filePathComment,
23
30
  "no-card-numbers": noCardNumbers,
@@ -34,43 +41,51 @@ var src_default = {
34
41
  [requireResolveFullResponseRuleId]: requireResolveFullResponse,
35
42
  [requireTypeOutOfTypeOnlyImportsRuleId]: requireTypeOutOfTypeOnlyImports
36
43
  },
37
- configs: {
38
- all: {
39
- rules: {
40
- "@checkdigit/no-card-numbers": "error",
41
- "@checkdigit/file-path-comment": "error",
42
- "@checkdigit/no-uuid": "error",
43
- "@checkdigit/require-strict-assert": "error",
44
- "@checkdigit/no-wallaby-comment": "error",
45
- "@checkdigit/regular-expression-comment": "error",
46
- "@checkdigit/require-assert-predicate-rejects-throws": "error",
47
- "@checkdigit/object-literal-response": "error",
48
- "@checkdigit/no-test-import": "error",
49
- [`@checkdigit/${invalidJsonStringifyRuleId}`]: "error",
50
- [`@checkdigit/${noPromiseInstanceMethodRuleId}`]: "error",
51
- [`@checkdigit/${noFullResponseRuleId}`]: "error",
52
- [`@checkdigit/${requireResolveFullResponseRuleId}`]: "error",
53
- [`@checkdigit/${requireTypeOutOfTypeOnlyImportsRuleId}`]: "error"
54
- }
44
+ configs: {}
45
+ };
46
+ Object.assign(plugin.configs, {
47
+ all: {
48
+ plugins: {
49
+ "@checkdigit": plugin
50
+ },
51
+ rules: {
52
+ "@checkdigit/no-card-numbers": "error",
53
+ "@checkdigit/file-path-comment": "error",
54
+ "@checkdigit/no-uuid": "error",
55
+ "@checkdigit/require-strict-assert": "error",
56
+ "@checkdigit/no-wallaby-comment": "error",
57
+ "@checkdigit/regular-expression-comment": "error",
58
+ "@checkdigit/require-assert-predicate-rejects-throws": "error",
59
+ "@checkdigit/object-literal-response": "error",
60
+ "@checkdigit/no-test-import": "error",
61
+ [`@checkdigit/${invalidJsonStringifyRuleId}`]: "error",
62
+ [`@checkdigit/${noPromiseInstanceMethodRuleId}`]: "error",
63
+ [`@checkdigit/${noFullResponseRuleId}`]: "error",
64
+ [`@checkdigit/${requireResolveFullResponseRuleId}`]: "error",
65
+ [`@checkdigit/${requireTypeOutOfTypeOnlyImportsRuleId}`]: "error"
66
+ }
67
+ },
68
+ recommended: {
69
+ plugins: {
70
+ "@checkdigit": plugin
55
71
  },
56
- recommended: {
57
- rules: {
58
- "@checkdigit/no-card-numbers": "error",
59
- "@checkdigit/file-path-comment": "off",
60
- "@checkdigit/no-uuid": "error",
61
- "@checkdigit/require-strict-assert": "error",
62
- "@checkdigit/no-wallaby-comment": "off",
63
- "@checkdigit/regular-expression-comment": "error",
64
- "@checkdigit/require-assert-predicate-rejects-throws": "error",
65
- "@checkdigit/object-literal-response": "error",
66
- "@checkdigit/no-test-import": "error",
67
- [`@checkdigit/${invalidJsonStringifyRuleId}`]: "error",
68
- [`@checkdigit/${noPromiseInstanceMethodRuleId}`]: "error"
69
- }
72
+ rules: {
73
+ "@checkdigit/no-card-numbers": "error",
74
+ "@checkdigit/file-path-comment": "off",
75
+ "@checkdigit/no-uuid": "error",
76
+ "@checkdigit/require-strict-assert": "error",
77
+ "@checkdigit/no-wallaby-comment": "off",
78
+ "@checkdigit/regular-expression-comment": "error",
79
+ "@checkdigit/require-assert-predicate-rejects-throws": "error",
80
+ "@checkdigit/object-literal-response": "error",
81
+ "@checkdigit/no-test-import": "error",
82
+ [`@checkdigit/${invalidJsonStringifyRuleId}`]: "error",
83
+ [`@checkdigit/${noPromiseInstanceMethodRuleId}`]: "error"
70
84
  }
71
85
  }
72
- };
86
+ });
87
+ var src_default = plugin;
73
88
  export {
74
89
  src_default as default
75
90
  };
76
- //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIl0sCiAgIm1hcHBpbmdzIjogIjtBQVFBLE9BQU8sd0JBQXdCLFVBQVUsa0NBQWtDO0FBQzNFLE9BQU8sa0JBQWtCLFVBQVUsNEJBQTRCO0FBQy9ELE9BQU8sMkJBQTJCLFVBQVUscUNBQXFDO0FBQ2pGLE9BQU87QUFBQSxFQUNMLFVBQVU7QUFBQSxPQUNMO0FBQ1AsT0FBTztBQUFBLEVBQ0wsVUFBVTtBQUFBLE9BQ0w7QUFDUCxPQUFPLHFCQUFxQjtBQUM1QixPQUFPLG1CQUFtQjtBQUMxQixPQUFPLGtCQUFrQjtBQUN6QixPQUFPLFlBQVk7QUFDbkIsT0FBTyxzQkFBc0I7QUFDN0IsT0FBTywyQkFBMkI7QUFDbEMsT0FBTyxrQkFBa0I7QUFDekIsT0FBTyx5Q0FBeUM7QUFDaEQsT0FBTyx5QkFBeUI7QUFFaEMsSUFBTyxjQUFRO0FBQUEsRUFDYixPQUFPO0FBQUEsSUFDTCxxQkFBcUI7QUFBQSxJQUNyQixtQkFBbUI7QUFBQSxJQUNuQixXQUFXO0FBQUEsSUFDWCx5QkFBeUI7QUFBQSxJQUN6QixrQkFBa0I7QUFBQSxJQUNsQixzQkFBc0I7QUFBQSxJQUN0Qiw4QkFBOEI7QUFBQSxJQUM5QiwyQ0FBMkM7QUFBQSxJQUMzQywyQkFBMkI7QUFBQSxJQUMzQixDQUFDLDBCQUEwQixHQUFHO0FBQUEsSUFDOUIsQ0FBQyw2QkFBNkIsR0FBRztBQ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sTUFDakMsdUJBQXVCO0FBQUEsTUFDdkIscUNBQXFDO0FBQUEsTUFDckMsa0NBQWtDO0FBQUEsTUFDbEMsMENBQTBDO0FBQUEsTUFDMUMsdURBQXVEO0FBQUEsTUFDdkQsdUNBQXVDO0FBQUEsTUFDdkMsOEJBQThCO0FBQUEsTUFDOUIsQ0FBQyxlQUFlLDBCQUEwQixFQUFFLEdBQUc7QUFBQSxNQUMvQyxDQUFDLGVBQWUsNkJBQTZCLEVBQUUsR0FBRztBQUFBLElBQ3BEO0FBQUEsRUFDRjtBQUNGLENBQUM7QUFFRCxJQUFPLGNBQVE7IiwKICAibmFtZXMiOiBbXQp9Cg==
@@ -1,4 +1,8 @@
1
- declare const _default: {
1
+ declare const plugin: {
2
+ meta: {
3
+ name: string;
4
+ version: string;
5
+ };
2
6
  rules: {
3
7
  'file-path-comment': import("eslint").Rule.RuleModule;
4
8
  'no-card-numbers': import("eslint").Rule.RuleModule;
@@ -15,40 +19,6 @@ declare const _default: {
15
19
  "require-resolve-full-response": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unknownError" | "invalidOptions", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
16
20
  "require-type-out-of-type-only-imports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"moveTypeOutside", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
17
21
  };
18
- configs: {
19
- all: {
20
- rules: {
21
- '@checkdigit/no-card-numbers': string;
22
- '@checkdigit/file-path-comment': string;
23
- '@checkdigit/no-uuid': string;
24
- '@checkdigit/require-strict-assert': string;
25
- '@checkdigit/no-wallaby-comment': string;
26
- '@checkdigit/regular-expression-comment': string;
27
- '@checkdigit/require-assert-predicate-rejects-throws': string;
28
- '@checkdigit/object-literal-response': string;
29
- '@checkdigit/no-test-import': string;
30
- "@checkdigit/invalid-json-stringify": string;
31
- "@checkdigit/no-promise-instance-method": string;
32
- "@checkdigit/no-full-response": string;
33
- "@checkdigit/require-resolve-full-response": string;
34
- "@checkdigit/require-type-out-of-type-only-imports": string;
35
- };
36
- };
37
- recommended: {
38
- rules: {
39
- '@checkdigit/no-card-numbers': string;
40
- '@checkdigit/file-path-comment': string;
41
- '@checkdigit/no-uuid': string;
42
- '@checkdigit/require-strict-assert': string;
43
- '@checkdigit/no-wallaby-comment': string;
44
- '@checkdigit/regular-expression-comment': string;
45
- '@checkdigit/require-assert-predicate-rejects-throws': string;
46
- '@checkdigit/object-literal-response': string;
47
- '@checkdigit/no-test-import': string;
48
- "@checkdigit/invalid-json-stringify": string;
49
- "@checkdigit/no-promise-instance-method": string;
50
- };
51
- };
52
- };
22
+ configs: {};
53
23
  };
54
- export default _default;
24
+ export default plugin;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@checkdigit/eslint-plugin","version":"7.0.0-PR.88-a0ce","description":"Check Digit eslint plugins","keywords":["eslint","eslintplugin"],"homepage":"https://github.com/checkdigit/eslint-plugin#readme","bugs":{"url":"https://github.com/checkdigit/eslint-plugin/issues"},"repository":{"type":"git","url":"https://github.com/checkdigit/eslint-plugin"},"license":"MIT","author":"Check Digit, LLC","sideEffects":false,"type":"module","exports":{".":{"types":"./dist-types/index.d.ts","require":"./dist-cjs/index.cjs","import":"./dist-mjs/index.mjs","default":"./dist-mjs/index.mjs"}},"files":["src","dist-types","dist-cjs","dist-mjs","!src/**/*.test.ts","!src/**/*.spec.ts","!dist-types/**/*.test.d.ts","!dist-types/**/*.spec.d.ts","!dist-cjs/**/*.test.cjs","!dist-cjs/**/*.spec.cjs","!dist-mjs/**/*.test.mjs","!dist-mjs/**/*.spec.mjs","SECURITY.md"],"scripts":{"build:dist-cjs":"rimraf dist-cjs && npx builder --type=commonjs --sourceMap --entryPoint=index.ts --outDir=dist-cjs --outFile=index.cjs --external=espree && echo \"module.exports = module.exports.default;\" >> dist-cjs/index.cjs && node dist-cjs/index.cjs","build:dist-mjs":"rimraf dist-mjs && npx builder --type=module --sourceMap --outDir=dist-mjs && node dist-mjs/index.mjs","build:dist-types":"rimraf dist-types && npx builder --type=types --outDir=dist-types","ci:compile":"tsc --noEmit","ci:coverage":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=true","ci:lint":"npm run lint","ci:style":"npm run prettier","ci:test":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=false","lint":"eslint --max-warnings 0 .","lint:fix":"eslint . --fix","prepublishOnly":"npm run build:dist-types && npm run build:dist-cjs && npm run build:dist-mjs","prettier":"prettier --ignore-path .gitignore --list-different .","prettier:fix":"prettier --ignore-path .gitignore --write .","test":"npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style"},"prettier":"@checkdigit/prettier-config","jest":{"preset":"@checkdigit/jest-config"},"dependencies":{"@typescript-eslint/type-utils":"^8.8.1","@typescript-eslint/utils":"^8.8.1","ts-api-utils":"^1.3.0"},"devDependencies":{"@checkdigit/jest-config":"^6.0.2","@checkdigit/prettier-config":"^5.5.1","@checkdigit/typescript-config":"6.0.0","@eslint/js":"^9.12.0","@types/eslint":"^9.6.1","@types/eslint-config-prettier":"^6.11.3","@typescript-eslint/parser":"^8.8.1","@typescript-eslint/rule-tester":"^8.8.1","eslint":"^9.12.0","eslint-config-prettier":"^9.1.0","eslint-import-resolver-typescript":"^3.6.3","eslint-plugin-eslint-plugin":"^6.2.0","eslint-plugin-import":"^2.31.0","eslint-plugin-no-only-tests":"^3.3.0","eslint-plugin-no-secrets":"^1.0.2","eslint-plugin-node":"^11.1.0","eslint-plugin-sonarjs":"1.0.4","http-status-codes":"^2.3.0","rimraf":"^6.0.1","typescript-eslint":"^8.8.1"},"peerDependencies":{"eslint":">=9 <10"},"engines":{"node":">=20.14"}}
1
+ {"name":"@checkdigit/eslint-plugin","version":"7.0.0-PR.88-5b1b","description":"Check Digit eslint plugins","keywords":["eslint","eslintplugin"],"homepage":"https://github.com/checkdigit/eslint-plugin#readme","bugs":{"url":"https://github.com/checkdigit/eslint-plugin/issues"},"repository":{"type":"git","url":"https://github.com/checkdigit/eslint-plugin"},"license":"MIT","author":"Check Digit, LLC","sideEffects":false,"type":"module","exports":{".":{"types":"./dist-types/index.d.ts","require":"./dist-cjs/index.cjs","import":"./dist-mjs/index.mjs","default":"./dist-mjs/index.mjs"}},"files":["src","dist-types","dist-cjs","dist-mjs","!src/**/*.test.ts","!src/**/*.spec.ts","!dist-types/**/*.test.d.ts","!dist-types/**/*.spec.d.ts","!dist-cjs/**/*.test.cjs","!dist-cjs/**/*.spec.cjs","!dist-mjs/**/*.test.mjs","!dist-mjs/**/*.spec.mjs","SECURITY.md"],"scripts":{"build:dist-cjs":"rimraf dist-cjs && npx builder --type=commonjs --sourceMap --entryPoint=index.ts --outDir=dist-cjs --outFile=index.cjs --external=espree && echo \"module.exports = module.exports.default;\" >> dist-cjs/index.cjs && node dist-cjs/index.cjs","build:dist-mjs":"rimraf dist-mjs && npx builder --type=module --sourceMap --outDir=dist-mjs && node dist-mjs/index.mjs","build:dist-types":"rimraf dist-types && npx builder --type=types --outDir=dist-types","ci:compile":"tsc --noEmit","ci:coverage":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=true","ci:lint":"npm run lint","ci:style":"npm run prettier","ci:test":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=false","lint":"eslint --max-warnings 0 .","lint:fix":"eslint . --fix","prepublishOnly":"npm run build:dist-types && npm run build:dist-cjs && npm run build:dist-mjs","prettier":"prettier --ignore-path .gitignore --list-different .","prettier:fix":"prettier --ignore-path .gitignore --write .","test":"npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style"},"prettier":"@checkdigit/prettier-config","jest":{"preset":"@checkdigit/jest-config"},"dependencies":{"@typescript-eslint/type-utils":"^8.8.1","@typescript-eslint/utils":"^8.8.1","ts-api-utils":"^1.3.0"},"devDependencies":{"@checkdigit/jest-config":"^6.0.2","@checkdigit/prettier-config":"^5.5.1","@checkdigit/typescript-config":"6.0.0","@eslint/js":"^9.12.0","@types/eslint":"^9.6.1","@types/eslint-config-prettier":"^6.11.3","@typescript-eslint/parser":"^8.8.1","@typescript-eslint/rule-tester":"^8.8.1","eslint":"^9.12.0","eslint-config-prettier":"^9.1.0","eslint-import-resolver-typescript":"^3.6.3","eslint-plugin-eslint-plugin":"^6.2.0","eslint-plugin-import":"^2.31.0","eslint-plugin-no-only-tests":"^3.3.0","eslint-plugin-no-secrets":"^1.0.2","eslint-plugin-node":"^11.1.0","eslint-plugin-sonarjs":"1.0.4","http-status-codes":"^2.3.0","rimraf":"^6.0.1","typescript-eslint":"^8.8.1"},"peerDependencies":{"eslint":">=9 <10"},"engines":{"node":">=20.14"}}
package/src/index.ts CHANGED
@@ -6,6 +6,8 @@
6
6
  * This code is licensed under the MIT license (see LICENSE.txt for details).
7
7
  */
8
8
 
9
+ import fs from 'node:fs';
10
+
9
11
  import invalidJsonStringify, { ruleId as invalidJsonStringifyRuleId } from './invalid-json-stringify';
10
12
  import noFullResponse, { ruleId as noFullResponseRuleId } from './agent/no-full-response';
11
13
  import noPromiseInstanceMethod, { ruleId as noPromiseInstanceMethodRuleId } from './no-promise-instance-method';
@@ -25,7 +27,17 @@ import regexComment from './regular-expression-comment';
25
27
  import requireAssertPredicateRejectsThrows from './require-assert-predicate-rejects-throws';
26
28
  import requireStrictAssert from './require-strict-assert';
27
29
 
28
- export default {
30
+ const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')) as {
31
+ name: string;
32
+ version: string;
33
+ };
34
+
35
+ const plugin = {
36
+ // preferred location of name and version
37
+ meta: {
38
+ name: pkg.name,
39
+ version: pkg.version,
40
+ },
29
41
  rules: {
30
42
  'file-path-comment': filePathComment,
31
43
  'no-card-numbers': noCardNumbers,
@@ -42,39 +54,50 @@ export default {
42
54
  [requireResolveFullResponseRuleId]: requireResolveFullResponse,
43
55
  [requireTypeOutOfTypeOnlyImportsRuleId]: requireTypeOutOfTypeOnlyImports,
44
56
  },
45
- configs: {
46
- all: {
47
- rules: {
48
- '@checkdigit/no-card-numbers': 'error',
49
- '@checkdigit/file-path-comment': 'error',
50
- '@checkdigit/no-uuid': 'error',
51
- '@checkdigit/require-strict-assert': 'error',
52
- '@checkdigit/no-wallaby-comment': 'error',
53
- '@checkdigit/regular-expression-comment': 'error',
54
- '@checkdigit/require-assert-predicate-rejects-throws': 'error',
55
- '@checkdigit/object-literal-response': 'error',
56
- '@checkdigit/no-test-import': 'error',
57
- [`@checkdigit/${invalidJsonStringifyRuleId}`]: 'error',
58
- [`@checkdigit/${noPromiseInstanceMethodRuleId}`]: 'error',
59
- [`@checkdigit/${noFullResponseRuleId}`]: 'error',
60
- [`@checkdigit/${requireResolveFullResponseRuleId}`]: 'error',
61
- [`@checkdigit/${requireTypeOutOfTypeOnlyImportsRuleId}`]: 'error',
62
- },
57
+ configs: {},
58
+ };
59
+
60
+ // assign configs here so we can reference `plugin`
61
+ Object.assign(plugin.configs, {
62
+ all: {
63
+ plugins: {
64
+ '@checkdigit': plugin,
63
65
  },
64
- recommended: {
65
- rules: {
66
- '@checkdigit/no-card-numbers': 'error',
67
- '@checkdigit/file-path-comment': 'off',
68
- '@checkdigit/no-uuid': 'error',
69
- '@checkdigit/require-strict-assert': 'error',
70
- '@checkdigit/no-wallaby-comment': 'off',
71
- '@checkdigit/regular-expression-comment': 'error',
72
- '@checkdigit/require-assert-predicate-rejects-throws': 'error',
73
- '@checkdigit/object-literal-response': 'error',
74
- '@checkdigit/no-test-import': 'error',
75
- [`@checkdigit/${invalidJsonStringifyRuleId}`]: 'error',
76
- [`@checkdigit/${noPromiseInstanceMethodRuleId}`]: 'error',
77
- },
66
+ rules: {
67
+ '@checkdigit/no-card-numbers': 'error',
68
+ '@checkdigit/file-path-comment': 'error',
69
+ '@checkdigit/no-uuid': 'error',
70
+ '@checkdigit/require-strict-assert': 'error',
71
+ '@checkdigit/no-wallaby-comment': 'error',
72
+ '@checkdigit/regular-expression-comment': 'error',
73
+ '@checkdigit/require-assert-predicate-rejects-throws': 'error',
74
+ '@checkdigit/object-literal-response': 'error',
75
+ '@checkdigit/no-test-import': 'error',
76
+ [`@checkdigit/${invalidJsonStringifyRuleId}`]: 'error',
77
+ [`@checkdigit/${noPromiseInstanceMethodRuleId}`]: 'error',
78
+ [`@checkdigit/${noFullResponseRuleId}`]: 'error',
79
+ [`@checkdigit/${requireResolveFullResponseRuleId}`]: 'error',
80
+ [`@checkdigit/${requireTypeOutOfTypeOnlyImportsRuleId}`]: 'error',
78
81
  },
79
82
  },
80
- };
83
+ recommended: {
84
+ plugins: {
85
+ '@checkdigit': plugin,
86
+ },
87
+ rules: {
88
+ '@checkdigit/no-card-numbers': 'error',
89
+ '@checkdigit/file-path-comment': 'off',
90
+ '@checkdigit/no-uuid': 'error',
91
+ '@checkdigit/require-strict-assert': 'error',
92
+ '@checkdigit/no-wallaby-comment': 'off',
93
+ '@checkdigit/regular-expression-comment': 'error',
94
+ '@checkdigit/require-assert-predicate-rejects-throws': 'error',
95
+ '@checkdigit/object-literal-response': 'error',
96
+ '@checkdigit/no-test-import': 'error',
97
+ [`@checkdigit/${invalidJsonStringifyRuleId}`]: 'error',
98
+ [`@checkdigit/${noPromiseInstanceMethodRuleId}`]: 'error',
99
+ },
100
+ },
101
+ });
102
+
103
+ export default plugin;