@bigbinary/eslint-plugin-neeto 1.0.41 → 1.0.42

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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +958 -145
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -218,6 +218,7 @@
218
218
  "@bigbinary/neeto/api-connector-should-use-default-export": "error",
219
219
  "@bigbinary/neeto/combine-multiple-independent-awaits": "warn",
220
220
  "@bigbinary/neeto/consistent-button-link-anchor": "warn",
221
+ "@bigbinary/neeto/ensure-compact-objects": "error",
221
222
  "@bigbinary/neeto/ensure-zustand-stores-are-type-annotated": "error",
222
223
  "@bigbinary/neeto/files-inside-react-query-folder-should-end-with-api": "warn",
223
224
  "@bigbinary/neeto/file-name-and-export-name-standards": ["error", {
@@ -1888,7 +1889,7 @@
1888
1889
 
1889
1890
  function cov_2gzkxmjfjh() {
1890
1891
  var path = "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/utils/helpers.js";
1891
- var hash = "deb442a08f0ae83241fd248de1fbac09681e6984";
1892
+ var hash = "79afad8cb58f5560a516c50429ccb68875a7a543";
1892
1893
  var global = new Function("return this")();
1893
1894
  var gcv = "__coverage__";
1894
1895
  var coverageData = {
@@ -2457,11 +2458,11 @@
2457
2458
  "56": {
2458
2459
  start: {
2459
2460
  line: 153,
2460
- column: 29
2461
+ column: 30
2461
2462
  },
2462
2463
  end: {
2463
- line: 162,
2464
- column: 1
2464
+ line: 154,
2465
+ column: 71
2465
2466
  }
2466
2467
  },
2467
2468
  "57": {
@@ -2470,47 +2471,77 @@
2470
2471
  column: 2
2471
2472
  },
2472
2473
  end: {
2473
- line: 161,
2474
- column: 3
2474
+ line: 154,
2475
+ column: 71
2475
2476
  }
2476
2477
  },
2477
2478
  "58": {
2478
2479
  start: {
2479
- line: 155,
2480
- column: 21
2480
+ line: 154,
2481
+ column: 33
2481
2482
  },
2482
2483
  end: {
2483
- line: 155,
2484
- column: 57
2484
+ line: 154,
2485
+ column: 70
2485
2486
  }
2486
2487
  },
2487
2488
  "59": {
2488
2489
  start: {
2489
2490
  line: 156,
2490
- column: 27
2491
+ column: 29
2491
2492
  },
2492
2493
  end: {
2493
- line: 156,
2494
- column: 63
2494
+ line: 165,
2495
+ column: 1
2495
2496
  }
2496
2497
  },
2497
2498
  "60": {
2499
+ start: {
2500
+ line: 157,
2501
+ column: 2
2502
+ },
2503
+ end: {
2504
+ line: 164,
2505
+ column: 3
2506
+ }
2507
+ },
2508
+ "61": {
2498
2509
  start: {
2499
2510
  line: 158,
2500
- column: 4
2511
+ column: 21
2501
2512
  },
2502
2513
  end: {
2503
2514
  line: 158,
2515
+ column: 57
2516
+ }
2517
+ },
2518
+ "62": {
2519
+ start: {
2520
+ line: 159,
2521
+ column: 27
2522
+ },
2523
+ end: {
2524
+ line: 159,
2525
+ column: 63
2526
+ }
2527
+ },
2528
+ "63": {
2529
+ start: {
2530
+ line: 161,
2531
+ column: 4
2532
+ },
2533
+ end: {
2534
+ line: 161,
2504
2535
  column: 26
2505
2536
  }
2506
2537
  },
2507
- "61": {
2538
+ "64": {
2508
2539
  start: {
2509
- line: 160,
2540
+ line: 163,
2510
2541
  column: 4
2511
2542
  },
2512
2543
  end: {
2513
- line: 160,
2544
+ line: 163,
2514
2545
  column: 14
2515
2546
  }
2516
2547
  }
@@ -2977,24 +3008,72 @@
2977
3008
  decl: {
2978
3009
  start: {
2979
3010
  line: 153,
2980
- column: 29
3011
+ column: 30
2981
3012
  },
2982
3013
  end: {
2983
3014
  line: 153,
3015
+ column: 31
3016
+ }
3017
+ },
3018
+ loc: {
3019
+ start: {
3020
+ line: 154,
3021
+ column: 2
3022
+ },
3023
+ end: {
3024
+ line: 154,
3025
+ column: 71
3026
+ }
3027
+ },
3028
+ line: 154
3029
+ },
3030
+ "20": {
3031
+ name: "(anonymous_20)",
3032
+ decl: {
3033
+ start: {
3034
+ line: 154,
3035
+ column: 21
3036
+ },
3037
+ end: {
3038
+ line: 154,
3039
+ column: 22
3040
+ }
3041
+ },
3042
+ loc: {
3043
+ start: {
3044
+ line: 154,
3045
+ column: 33
3046
+ },
3047
+ end: {
3048
+ line: 154,
3049
+ column: 70
3050
+ }
3051
+ },
3052
+ line: 154
3053
+ },
3054
+ "21": {
3055
+ name: "(anonymous_21)",
3056
+ decl: {
3057
+ start: {
3058
+ line: 156,
3059
+ column: 29
3060
+ },
3061
+ end: {
3062
+ line: 156,
2984
3063
  column: 30
2985
3064
  }
2986
3065
  },
2987
3066
  loc: {
2988
3067
  start: {
2989
- line: 153,
3068
+ line: 156,
2990
3069
  column: 41
2991
3070
  },
2992
3071
  end: {
2993
- line: 162,
3072
+ line: 165,
2994
3073
  column: 1
2995
3074
  }
2996
3075
  },
2997
- line: 153
3076
+ line: 156
2998
3077
  }
2999
3078
  },
3000
3079
  branchMap: {
@@ -3481,7 +3560,10 @@
3481
3560
  "58": 0,
3482
3561
  "59": 0,
3483
3562
  "60": 0,
3484
- "61": 0
3563
+ "61": 0,
3564
+ "62": 0,
3565
+ "63": 0,
3566
+ "64": 0
3485
3567
  },
3486
3568
  f: {
3487
3569
  "0": 0,
@@ -3503,7 +3585,9 @@
3503
3585
  "16": 0,
3504
3586
  "17": 0,
3505
3587
  "18": 0,
3506
- "19": 0
3588
+ "19": 0,
3589
+ "20": 0,
3590
+ "21": 0
3507
3591
  },
3508
3592
  b: {
3509
3593
  "0": [0, 0],
@@ -3521,7 +3605,7 @@
3521
3605
  "12": [0, 0]
3522
3606
  },
3523
3607
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
3524
- hash: "deb442a08f0ae83241fd248de1fbac09681e6984"
3608
+ hash: "79afad8cb58f5560a516c50429ccb68875a7a543"
3525
3609
  };
3526
3610
  var coverage = global[gcv] || (global[gcv] = {});
3527
3611
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -3782,16 +3866,26 @@
3782
3866
  return isOptionalChainingPresent(node) ? (cov_2gzkxmjfjh().b[12][0]++, "_".concat(funcName)) : (cov_2gzkxmjfjh().b[12][1]++, funcName);
3783
3867
  };
3784
3868
  cov_2gzkxmjfjh().s[56]++;
3785
- var parseJsonData = function parseJsonData(filePath) {
3869
+ var isExcludedFile = function isExcludedFile(excludedFiles, filename) {
3786
3870
  cov_2gzkxmjfjh().f[19]++;
3787
3871
  cov_2gzkxmjfjh().s[57]++;
3872
+ return excludedFiles.some(function (filePath) {
3873
+ cov_2gzkxmjfjh().f[20]++;
3874
+ cov_2gzkxmjfjh().s[58]++;
3875
+ return filePath.test(path__default["default"].resolve(filename));
3876
+ });
3877
+ };
3878
+ cov_2gzkxmjfjh().s[59]++;
3879
+ var parseJsonData = function parseJsonData(filePath) {
3880
+ cov_2gzkxmjfjh().f[21]++;
3881
+ cov_2gzkxmjfjh().s[60]++;
3788
3882
  try {
3789
- var jsonData = (cov_2gzkxmjfjh().s[58]++, fs__default["default"].readFileSync(filePath).toString());
3790
- var parsedJsonData = (cov_2gzkxmjfjh().s[59]++, JSON.parse(removeComments(jsonData)));
3791
- cov_2gzkxmjfjh().s[60]++;
3883
+ var jsonData = (cov_2gzkxmjfjh().s[61]++, fs__default["default"].readFileSync(filePath).toString());
3884
+ var parsedJsonData = (cov_2gzkxmjfjh().s[62]++, JSON.parse(removeComments(jsonData)));
3885
+ cov_2gzkxmjfjh().s[63]++;
3792
3886
  return parsedJsonData;
3793
3887
  } catch (_unused) {
3794
- cov_2gzkxmjfjh().s[61]++;
3888
+ cov_2gzkxmjfjh().s[64]++;
3795
3889
  return {};
3796
3890
  }
3797
3891
  };
@@ -12604,7 +12698,7 @@
12604
12698
 
12605
12699
  function cov_6133n876n() {
12606
12700
  var path = "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/constants/constants.js";
12607
- var hash = "b8644545b447341a3f690aee6e72045bbcbdae5c";
12701
+ var hash = "15ea80414af64725a307fd12eb7614ae25e4d766";
12608
12702
  var global = new Function("return this")();
12609
12703
  var gcv = "__coverage__";
12610
12704
  var coverageData = {
@@ -12633,7 +12727,7 @@
12633
12727
  "2": {
12634
12728
  start: {
12635
12729
  line: 4,
12636
- column: 45
12730
+ column: 44
12637
12731
  },
12638
12732
  end: {
12639
12733
  line: 7,
@@ -12689,7 +12783,7 @@
12689
12783
  },
12690
12784
  b: {},
12691
12785
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
12692
- hash: "b8644545b447341a3f690aee6e72045bbcbdae5c"
12786
+ hash: "15ea80414af64725a307fd12eb7614ae25e4d766"
12693
12787
  };
12694
12788
  var coverage = global[gcv] || (global[gcv] = {});
12695
12789
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -12707,7 +12801,7 @@
12707
12801
  cov_6133n876n();
12708
12802
  var CONSTANT_CASE_PATTERN = (cov_6133n876n().s[0]++, /^[A-Z0-9_]*$/);
12709
12803
  var CONSTANTS_FILES = (cov_6133n876n().s[1]++, [/constants\//, /.*constants.(js|jsx)$/i]);
12710
- var CONSTANT_DECALARATION_PATTERN = (cov_6133n876n().s[2]++, {
12804
+ var CONSTANT_DECLARATION_PATTERN = (cov_6133n876n().s[2]++, {
12711
12805
  kind: "const",
12712
12806
  declarations: [{
12713
12807
  id: {
@@ -12720,42 +12814,52 @@
12720
12814
  }]
12721
12815
  });
12722
12816
 
12723
- function cov_1sexdwysae() {
12724
- var path = "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/constants/utils.js";
12725
- var hash = "99621e2419ab45f2ef3dd6dbba2f9546291d8eaf";
12817
+ function cov_1ppagvbu7n() {
12818
+ var path = "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/constants/no-dangling-constants.js";
12819
+ var hash = "67d76858a516be65391287557ec86bfe4065390a";
12726
12820
  var global = new Function("return this")();
12727
12821
  var gcv = "__coverage__";
12728
12822
  var coverageData = {
12729
- path: "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/constants/utils.js",
12823
+ path: "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/constants/no-dangling-constants.js",
12730
12824
  statementMap: {
12731
12825
  "0": {
12732
12826
  start: {
12733
- line: 5,
12734
- column: 31
12827
+ line: 16,
12828
+ column: 22
12735
12829
  },
12736
12830
  end: {
12737
- line: 8,
12831
+ line: 26,
12738
12832
  column: 3
12739
12833
  }
12740
12834
  },
12741
12835
  "1": {
12742
12836
  start: {
12743
- line: 6,
12744
- column: 2
12837
+ line: 18,
12838
+ column: 6
12745
12839
  },
12746
12840
  end: {
12747
- line: 8,
12748
- column: 3
12841
+ line: 24,
12842
+ column: 7
12749
12843
  }
12750
12844
  },
12751
12845
  "2": {
12752
12846
  start: {
12753
- line: 7,
12754
- column: 4
12847
+ line: 22,
12848
+ column: 29
12755
12849
  },
12756
12850
  end: {
12757
- line: 7,
12758
- column: 54
12851
+ line: 22,
12852
+ column: 57
12853
+ }
12854
+ },
12855
+ "3": {
12856
+ start: {
12857
+ line: 23,
12858
+ column: 8
12859
+ },
12860
+ end: {
12861
+ line: 23,
12862
+ column: 62
12759
12863
  }
12760
12864
  }
12761
12865
  },
@@ -12764,64 +12868,135 @@
12764
12868
  name: "(anonymous_0)",
12765
12869
  decl: {
12766
12870
  start: {
12767
- line: 5,
12768
- column: 31
12871
+ line: 16,
12872
+ column: 10
12769
12873
  },
12770
12874
  end: {
12771
- line: 5,
12772
- column: 32
12875
+ line: 16,
12876
+ column: 11
12773
12877
  }
12774
12878
  },
12775
12879
  loc: {
12776
12880
  start: {
12777
- line: 6,
12778
- column: 2
12881
+ line: 16,
12882
+ column: 22
12779
12883
  },
12780
12884
  end: {
12781
- line: 8,
12885
+ line: 26,
12782
12886
  column: 3
12783
12887
  }
12784
12888
  },
12785
- line: 6
12889
+ line: 16
12786
12890
  },
12787
12891
  "1": {
12788
12892
  name: "(anonymous_1)",
12789
12893
  decl: {
12790
12894
  start: {
12791
- line: 6,
12792
- column: 23
12895
+ line: 17,
12896
+ column: 4
12793
12897
  },
12794
12898
  end: {
12795
- line: 6,
12796
- column: 24
12899
+ line: 17,
12900
+ column: 5
12797
12901
  }
12798
12902
  },
12799
12903
  loc: {
12800
12904
  start: {
12801
- line: 7,
12802
- column: 4
12905
+ line: 17,
12906
+ column: 30
12803
12907
  },
12804
12908
  end: {
12805
- line: 7,
12806
- column: 54
12909
+ line: 25,
12910
+ column: 5
12807
12911
  }
12808
12912
  },
12809
- line: 7
12913
+ line: 17
12914
+ }
12915
+ },
12916
+ branchMap: {
12917
+ "0": {
12918
+ loc: {
12919
+ start: {
12920
+ line: 18,
12921
+ column: 6
12922
+ },
12923
+ end: {
12924
+ line: 24,
12925
+ column: 7
12926
+ }
12927
+ },
12928
+ type: "if",
12929
+ locations: [{
12930
+ start: {
12931
+ line: 18,
12932
+ column: 6
12933
+ },
12934
+ end: {
12935
+ line: 24,
12936
+ column: 7
12937
+ }
12938
+ }, {
12939
+ start: {
12940
+ line: undefined,
12941
+ column: undefined
12942
+ },
12943
+ end: {
12944
+ line: undefined,
12945
+ column: undefined
12946
+ }
12947
+ }],
12948
+ line: 18
12949
+ },
12950
+ "1": {
12951
+ loc: {
12952
+ start: {
12953
+ line: 19,
12954
+ column: 8
12955
+ },
12956
+ end: {
12957
+ line: 20,
12958
+ column: 51
12959
+ }
12960
+ },
12961
+ type: "binary-expr",
12962
+ locations: [{
12963
+ start: {
12964
+ line: 19,
12965
+ column: 8
12966
+ },
12967
+ end: {
12968
+ line: 19,
12969
+ column: 63
12970
+ }
12971
+ }, {
12972
+ start: {
12973
+ line: 20,
12974
+ column: 8
12975
+ },
12976
+ end: {
12977
+ line: 20,
12978
+ column: 51
12979
+ }
12980
+ }],
12981
+ line: 19
12810
12982
  }
12811
12983
  },
12812
- branchMap: {},
12813
12984
  s: {
12814
12985
  "0": 0,
12815
12986
  "1": 0,
12816
- "2": 0
12987
+ "2": 0,
12988
+ "3": 0
12817
12989
  },
12818
12990
  f: {
12819
12991
  "0": 0,
12820
12992
  "1": 0
12821
12993
  },
12822
- b: {},
12994
+ b: {
12995
+ "0": [0, 0],
12996
+ "1": [0, 0]
12997
+ },
12823
12998
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
12824
- hash: "99621e2419ab45f2ef3dd6dbba2f9546291d8eaf"
12999
+ hash: "67d76858a516be65391287557ec86bfe4065390a"
12825
13000
  };
12826
13001
  var coverage = global[gcv] || (global[gcv] = {});
12827
13002
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -12830,70 +13005,388 @@
12830
13005
  var actualCoverage = coverage[path];
12831
13006
  {
12832
13007
  // @ts-ignore
12833
- cov_1sexdwysae = function () {
13008
+ cov_1ppagvbu7n = function () {
12834
13009
  return actualCoverage;
12835
13010
  };
12836
13011
  }
12837
13012
  return actualCoverage;
12838
13013
  }
12839
- cov_1sexdwysae();
12840
- cov_1sexdwysae().s[0]++;
12841
- var isConstantsFile = function isConstantsFile(context) {
12842
- cov_1sexdwysae().f[0]++;
12843
- cov_1sexdwysae().s[1]++;
12844
- return CONSTANTS_FILES.some(function (filePath) {
12845
- cov_1sexdwysae().f[1]++;
12846
- cov_1sexdwysae().s[2]++;
12847
- return filePath.test(path__default["default"].resolve(context.getFilename()));
12848
- });
13014
+ cov_1ppagvbu7n();
13015
+ var noDanglingConstants = {
13016
+ meta: {
13017
+ type: "suggestion",
13018
+ docs: {
13019
+ description: "Indicates that any constant outside a constant.[js|jsx] file should be moved to a constant.[js|jsx] file."
13020
+ }
13021
+ },
13022
+ create: function create(context) {
13023
+ cov_1ppagvbu7n().f[0]++;
13024
+ cov_1ppagvbu7n().s[0]++;
13025
+ return {
13026
+ VariableDeclaration: function VariableDeclaration(node) {
13027
+ cov_1ppagvbu7n().f[1]++;
13028
+ cov_1ppagvbu7n().s[1]++;
13029
+ if ((cov_1ppagvbu7n().b[1][0]++, !isExcludedFile(CONSTANTS_FILES, context.getFilename())) && (cov_1ppagvbu7n().b[1][1]++, matches(CONSTANT_DECLARATION_PATTERN, node))) {
13030
+ cov_1ppagvbu7n().b[0][0]++;
13031
+ var constantName = (cov_1ppagvbu7n().s[2]++, node.declarations[0].id.name);
13032
+ cov_1ppagvbu7n().s[3]++;
13033
+ context.report(node, moveToConstantsJs(constantName));
13034
+ } else {
13035
+ cov_1ppagvbu7n().b[0][1]++;
13036
+ }
13037
+ }
13038
+ };
13039
+ }
12849
13040
  };
12850
13041
 
12851
- function cov_1ppagvbu7n() {
12852
- var path = "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/constants/no-dangling-constants.js";
12853
- var hash = "453af03f3dd7f85ab3bf4c8db8a9fd491e49a472";
13042
+ function cov_1hbt2gy24u() {
13043
+ var path = "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/ensure-compact-objects/constants.js";
13044
+ var hash = "efcf21ee2ae95b9913d326332d0e428ef1f30f58";
12854
13045
  var global = new Function("return this")();
12855
13046
  var gcv = "__coverage__";
12856
13047
  var coverageData = {
12857
- path: "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/constants/no-dangling-constants.js",
13048
+ path: "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/ensure-compact-objects/constants.js",
12858
13049
  statementMap: {
12859
13050
  "0": {
12860
13051
  start: {
12861
- line: 16,
13052
+ line: 6,
13053
+ column: 41
13054
+ },
13055
+ end: {
13056
+ line: 9,
13057
+ column: 1
13058
+ }
13059
+ },
13060
+ "1": {
13061
+ start: {
13062
+ line: 11,
13063
+ column: 39
13064
+ },
13065
+ end: {
13066
+ line: 13,
13067
+ column: 1
13068
+ }
13069
+ }
13070
+ },
13071
+ fnMap: {},
13072
+ branchMap: {},
13073
+ s: {
13074
+ "0": 0,
13075
+ "1": 0
13076
+ },
13077
+ f: {},
13078
+ b: {},
13079
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
13080
+ hash: "efcf21ee2ae95b9913d326332d0e428ef1f30f58"
13081
+ };
13082
+ var coverage = global[gcv] || (global[gcv] = {});
13083
+ if (!coverage[path] || coverage[path].hash !== hash) {
13084
+ coverage[path] = coverageData;
13085
+ }
13086
+ var actualCoverage = coverage[path];
13087
+ {
13088
+ // @ts-ignore
13089
+ cov_1hbt2gy24u = function () {
13090
+ return actualCoverage;
13091
+ };
13092
+ }
13093
+ return actualCoverage;
13094
+ }
13095
+ cov_1hbt2gy24u();
13096
+ var OBJECT_EXPRESSION_PATTERN = (cov_1hbt2gy24u().s[0]++, {
13097
+ type: TYPES.OBJECT_EXPRESSION,
13098
+ properties: isNotEmpty$1
13099
+ });
13100
+ var ARRAY_OR_OBJECT_PATTERN = (cov_1hbt2gy24u().s[1]++, {
13101
+ type: ramda.includes(ramda.__, [TYPES.ARRAY_EXPRESSION, TYPES.PROPERTY])
13102
+ });
13103
+
13104
+ function cov_17yhjdv6rr() {
13105
+ var path = "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/ensure-compact-objects/index.js";
13106
+ var hash = "bc220bea68267c3c797a9839f5dc276073d3b9c7";
13107
+ var global = new Function("return this")();
13108
+ var gcv = "__coverage__";
13109
+ var coverageData = {
13110
+ path: "/home/runner/work/eslint-plugin-neeto/eslint-plugin-neeto/src/lib/rules/ensure-compact-objects/index.js",
13111
+ statementMap: {
13112
+ "0": {
13113
+ start: {
13114
+ line: 10,
13115
+ column: 26
13116
+ },
13117
+ end: {
13118
+ line: 10,
13119
+ column: 45
13120
+ }
13121
+ },
13122
+ "1": {
13123
+ start: {
13124
+ line: 20,
12862
13125
  column: 22
12863
13126
  },
12864
13127
  end: {
12865
- line: 26,
13128
+ line: 68,
12866
13129
  column: 3
12867
13130
  }
12868
13131
  },
12869
- "1": {
13132
+ "2": {
12870
13133
  start: {
12871
- line: 18,
13134
+ line: 22,
12872
13135
  column: 6
12873
13136
  },
12874
13137
  end: {
12875
- line: 24,
12876
- column: 7
13138
+ line: 22,
13139
+ column: 60
12877
13140
  }
12878
13141
  },
12879
- "2": {
13142
+ "3": {
12880
13143
  start: {
12881
13144
  line: 22,
12882
- column: 29
13145
+ column: 53
12883
13146
  },
12884
13147
  end: {
12885
13148
  line: 22,
13149
+ column: 60
13150
+ }
13151
+ },
13152
+ "4": {
13153
+ start: {
13154
+ line: 24,
13155
+ column: 6
13156
+ },
13157
+ end: {
13158
+ line: 24,
13159
+ column: 64
13160
+ }
13161
+ },
13162
+ "5": {
13163
+ start: {
13164
+ line: 24,
12886
13165
  column: 57
13166
+ },
13167
+ end: {
13168
+ line: 24,
13169
+ column: 64
12887
13170
  }
12888
13171
  },
12889
- "3": {
13172
+ "6": {
12890
13173
  start: {
12891
- line: 23,
13174
+ line: 26,
13175
+ column: 25
13176
+ },
13177
+ end: {
13178
+ line: 26,
13179
+ column: 48
13180
+ }
13181
+ },
13182
+ "7": {
13183
+ start: {
13184
+ line: 28,
13185
+ column: 26
13186
+ },
13187
+ end: {
13188
+ line: 28,
13189
+ column: 72
13190
+ }
13191
+ },
13192
+ "8": {
13193
+ start: {
13194
+ line: 29,
13195
+ column: 6
13196
+ },
13197
+ end: {
13198
+ line: 29,
13199
+ column: 30
13200
+ }
13201
+ },
13202
+ "9": {
13203
+ start: {
13204
+ line: 29,
13205
+ column: 23
13206
+ },
13207
+ end: {
13208
+ line: 29,
13209
+ column: 30
13210
+ }
13211
+ },
13212
+ "10": {
13213
+ start: {
13214
+ line: 31,
13215
+ column: 31
13216
+ },
13217
+ end: {
13218
+ line: 31,
13219
+ column: 50
13220
+ }
13221
+ },
13222
+ "11": {
13223
+ start: {
13224
+ line: 32,
13225
+ column: 31
13226
+ },
13227
+ end: {
13228
+ line: 32,
13229
+ column: 48
13230
+ }
13231
+ },
13232
+ "12": {
13233
+ start: {
13234
+ line: 34,
13235
+ column: 6
13236
+ },
13237
+ end: {
13238
+ line: 34,
13239
+ column: 56
13240
+ }
13241
+ },
13242
+ "13": {
13243
+ start: {
13244
+ line: 34,
13245
+ column: 49
13246
+ },
13247
+ end: {
13248
+ line: 34,
13249
+ column: 56
13250
+ }
13251
+ },
13252
+ "14": {
13253
+ start: {
13254
+ line: 36,
13255
+ column: 35
13256
+ },
13257
+ end: {
13258
+ line: 38,
13259
+ column: 19
13260
+ }
13261
+ },
13262
+ "15": {
13263
+ start: {
13264
+ line: 37,
13265
+ column: 25
13266
+ },
13267
+ end: {
13268
+ line: 37,
13269
+ column: 53
13270
+ }
13271
+ },
13272
+ "16": {
13273
+ start: {
13274
+ line: 40,
13275
+ column: 18
13276
+ },
13277
+ end: {
13278
+ line: 40,
13279
+ column: 47
13280
+ }
13281
+ },
13282
+ "17": {
13283
+ start: {
13284
+ line: 42,
13285
+ column: 6
13286
+ },
13287
+ end: {
13288
+ line: 42,
13289
+ column: 36
13290
+ }
13291
+ },
13292
+ "18": {
13293
+ start: {
13294
+ line: 42,
13295
+ column: 29
13296
+ },
13297
+ end: {
13298
+ line: 42,
13299
+ column: 36
13300
+ }
13301
+ },
13302
+ "19": {
13303
+ start: {
13304
+ line: 44,
13305
+ column: 33
13306
+ },
13307
+ end: {
13308
+ line: 44,
13309
+ column: 54
13310
+ }
13311
+ },
13312
+ "20": {
13313
+ start: {
13314
+ line: 45,
13315
+ column: 33
13316
+ },
13317
+ end: {
13318
+ line: 45,
13319
+ column: 52
13320
+ }
13321
+ },
13322
+ "21": {
13323
+ start: {
13324
+ line: 48,
12892
13325
  column: 8
12893
13326
  },
12894
13327
  end: {
12895
- line: 23,
12896
- column: 62
13328
+ line: 51,
13329
+ column: 28
13330
+ }
13331
+ },
13332
+ "22": {
13333
+ start: {
13334
+ line: 54,
13335
+ column: 8
13336
+ },
13337
+ end: {
13338
+ line: 54,
13339
+ column: 79
13340
+ }
13341
+ },
13342
+ "23": {
13343
+ start: {
13344
+ line: 57,
13345
+ column: 8
13346
+ },
13347
+ end: {
13348
+ line: 57,
13349
+ column: 72
13350
+ }
13351
+ },
13352
+ "24": {
13353
+ start: {
13354
+ line: 59,
13355
+ column: 6
13356
+ },
13357
+ end: {
13358
+ line: 59,
13359
+ column: 44
13360
+ }
13361
+ },
13362
+ "25": {
13363
+ start: {
13364
+ line: 59,
13365
+ column: 37
13366
+ },
13367
+ end: {
13368
+ line: 59,
13369
+ column: 44
13370
+ }
13371
+ },
13372
+ "26": {
13373
+ start: {
13374
+ line: 61,
13375
+ column: 6
13376
+ },
13377
+ end: {
13378
+ line: 66,
13379
+ column: 9
13380
+ }
13381
+ },
13382
+ "27": {
13383
+ start: {
13384
+ line: 65,
13385
+ column: 22
13386
+ },
13387
+ end: {
13388
+ line: 65,
13389
+ column: 50
12897
13390
  }
12898
13391
  }
12899
13392
  },
@@ -12902,72 +13395,153 @@
12902
13395
  name: "(anonymous_0)",
12903
13396
  decl: {
12904
13397
  start: {
12905
- line: 16,
13398
+ line: 20,
12906
13399
  column: 10
12907
13400
  },
12908
13401
  end: {
12909
- line: 16,
13402
+ line: 20,
12910
13403
  column: 11
12911
13404
  }
12912
13405
  },
12913
13406
  loc: {
12914
13407
  start: {
12915
- line: 16,
13408
+ line: 20,
12916
13409
  column: 22
12917
13410
  },
12918
13411
  end: {
12919
- line: 26,
13412
+ line: 68,
12920
13413
  column: 3
12921
13414
  }
12922
13415
  },
12923
- line: 16
13416
+ line: 20
12924
13417
  },
12925
13418
  "1": {
12926
13419
  name: "(anonymous_1)",
12927
13420
  decl: {
12928
13421
  start: {
12929
- line: 17,
13422
+ line: 21,
12930
13423
  column: 4
12931
13424
  },
12932
13425
  end: {
12933
- line: 17,
13426
+ line: 21,
12934
13427
  column: 5
12935
13428
  }
12936
13429
  },
12937
13430
  loc: {
12938
13431
  start: {
12939
- line: 17,
12940
- column: 30
13432
+ line: 21,
13433
+ column: 27
12941
13434
  },
12942
13435
  end: {
12943
- line: 25,
13436
+ line: 67,
12944
13437
  column: 5
12945
13438
  }
12946
13439
  },
12947
- line: 17
13440
+ line: 21
13441
+ },
13442
+ "2": {
13443
+ name: "(anonymous_2)",
13444
+ decl: {
13445
+ start: {
13446
+ line: 37,
13447
+ column: 13
13448
+ },
13449
+ end: {
13450
+ line: 37,
13451
+ column: 14
13452
+ }
13453
+ },
13454
+ loc: {
13455
+ start: {
13456
+ line: 37,
13457
+ column: 25
13458
+ },
13459
+ end: {
13460
+ line: 37,
13461
+ column: 53
13462
+ }
13463
+ },
13464
+ line: 37
13465
+ },
13466
+ "3": {
13467
+ name: "(anonymous_3)",
13468
+ decl: {
13469
+ start: {
13470
+ line: 65,
13471
+ column: 13
13472
+ },
13473
+ end: {
13474
+ line: 65,
13475
+ column: 14
13476
+ }
13477
+ },
13478
+ loc: {
13479
+ start: {
13480
+ line: 65,
13481
+ column: 22
13482
+ },
13483
+ end: {
13484
+ line: 65,
13485
+ column: 50
13486
+ }
13487
+ },
13488
+ line: 65
12948
13489
  }
12949
13490
  },
12950
13491
  branchMap: {
12951
13492
  "0": {
12952
13493
  loc: {
12953
13494
  start: {
12954
- line: 18,
13495
+ line: 22,
12955
13496
  column: 6
12956
13497
  },
12957
13498
  end: {
13499
+ line: 22,
13500
+ column: 60
13501
+ }
13502
+ },
13503
+ type: "if",
13504
+ locations: [{
13505
+ start: {
13506
+ line: 22,
13507
+ column: 6
13508
+ },
13509
+ end: {
13510
+ line: 22,
13511
+ column: 60
13512
+ }
13513
+ }, {
13514
+ start: {
13515
+ line: undefined,
13516
+ column: undefined
13517
+ },
13518
+ end: {
13519
+ line: undefined,
13520
+ column: undefined
13521
+ }
13522
+ }],
13523
+ line: 22
13524
+ },
13525
+ "1": {
13526
+ loc: {
13527
+ start: {
12958
13528
  line: 24,
12959
- column: 7
13529
+ column: 6
13530
+ },
13531
+ end: {
13532
+ line: 24,
13533
+ column: 64
12960
13534
  }
12961
13535
  },
12962
13536
  type: "if",
12963
13537
  locations: [{
12964
13538
  start: {
12965
- line: 18,
13539
+ line: 24,
12966
13540
  column: 6
12967
13541
  },
12968
13542
  end: {
12969
13543
  line: 24,
12970
- column: 7
13544
+ column: 64
12971
13545
  }
12972
13546
  }, {
12973
13547
  start: {
@@ -12979,58 +13553,221 @@
12979
13553
  column: undefined
12980
13554
  }
12981
13555
  }],
12982
- line: 18
13556
+ line: 24
12983
13557
  },
12984
- "1": {
13558
+ "2": {
12985
13559
  loc: {
12986
13560
  start: {
12987
- line: 19,
13561
+ line: 29,
13562
+ column: 6
13563
+ },
13564
+ end: {
13565
+ line: 29,
13566
+ column: 30
13567
+ }
13568
+ },
13569
+ type: "if",
13570
+ locations: [{
13571
+ start: {
13572
+ line: 29,
13573
+ column: 6
13574
+ },
13575
+ end: {
13576
+ line: 29,
13577
+ column: 30
13578
+ }
13579
+ }, {
13580
+ start: {
13581
+ line: undefined,
13582
+ column: undefined
13583
+ },
13584
+ end: {
13585
+ line: undefined,
13586
+ column: undefined
13587
+ }
13588
+ }],
13589
+ line: 29
13590
+ },
13591
+ "3": {
13592
+ loc: {
13593
+ start: {
13594
+ line: 34,
13595
+ column: 6
13596
+ },
13597
+ end: {
13598
+ line: 34,
13599
+ column: 56
13600
+ }
13601
+ },
13602
+ type: "if",
13603
+ locations: [{
13604
+ start: {
13605
+ line: 34,
13606
+ column: 6
13607
+ },
13608
+ end: {
13609
+ line: 34,
13610
+ column: 56
13611
+ }
13612
+ }, {
13613
+ start: {
13614
+ line: undefined,
13615
+ column: undefined
13616
+ },
13617
+ end: {
13618
+ line: undefined,
13619
+ column: undefined
13620
+ }
13621
+ }],
13622
+ line: 34
13623
+ },
13624
+ "4": {
13625
+ loc: {
13626
+ start: {
13627
+ line: 42,
13628
+ column: 6
13629
+ },
13630
+ end: {
13631
+ line: 42,
13632
+ column: 36
13633
+ }
13634
+ },
13635
+ type: "if",
13636
+ locations: [{
13637
+ start: {
13638
+ line: 42,
13639
+ column: 6
13640
+ },
13641
+ end: {
13642
+ line: 42,
13643
+ column: 36
13644
+ }
13645
+ }, {
13646
+ start: {
13647
+ line: undefined,
13648
+ column: undefined
13649
+ },
13650
+ end: {
13651
+ line: undefined,
13652
+ column: undefined
13653
+ }
13654
+ }],
13655
+ line: 42
13656
+ },
13657
+ "5": {
13658
+ loc: {
13659
+ start: {
13660
+ line: 48,
12988
13661
  column: 8
12989
13662
  },
12990
13663
  end: {
12991
- line: 20,
12992
- column: 52
13664
+ line: 51,
13665
+ column: 28
12993
13666
  }
12994
13667
  },
12995
13668
  type: "binary-expr",
12996
13669
  locations: [{
12997
13670
  start: {
12998
- line: 19,
13671
+ line: 48,
12999
13672
  column: 8
13000
13673
  },
13001
13674
  end: {
13002
- line: 19,
13003
- column: 33
13675
+ line: 51,
13676
+ column: 22
13004
13677
  }
13005
13678
  }, {
13006
13679
  start: {
13007
- line: 20,
13008
- column: 8
13680
+ line: 51,
13681
+ column: 26
13009
13682
  },
13010
13683
  end: {
13011
- line: 20,
13012
- column: 52
13684
+ line: 51,
13685
+ column: 28
13013
13686
  }
13014
13687
  }],
13015
- line: 19
13688
+ line: 48
13689
+ },
13690
+ "6": {
13691
+ loc: {
13692
+ start: {
13693
+ line: 59,
13694
+ column: 6
13695
+ },
13696
+ end: {
13697
+ line: 59,
13698
+ column: 44
13699
+ }
13700
+ },
13701
+ type: "if",
13702
+ locations: [{
13703
+ start: {
13704
+ line: 59,
13705
+ column: 6
13706
+ },
13707
+ end: {
13708
+ line: 59,
13709
+ column: 44
13710
+ }
13711
+ }, {
13712
+ start: {
13713
+ line: undefined,
13714
+ column: undefined
13715
+ },
13716
+ end: {
13717
+ line: undefined,
13718
+ column: undefined
13719
+ }
13720
+ }],
13721
+ line: 59
13016
13722
  }
13017
13723
  },
13018
13724
  s: {
13019
13725
  "0": 0,
13020
13726
  "1": 0,
13021
13727
  "2": 0,
13022
- "3": 0
13728
+ "3": 0,
13729
+ "4": 0,
13730
+ "5": 0,
13731
+ "6": 0,
13732
+ "7": 0,
13733
+ "8": 0,
13734
+ "9": 0,
13735
+ "10": 0,
13736
+ "11": 0,
13737
+ "12": 0,
13738
+ "13": 0,
13739
+ "14": 0,
13740
+ "15": 0,
13741
+ "16": 0,
13742
+ "17": 0,
13743
+ "18": 0,
13744
+ "19": 0,
13745
+ "20": 0,
13746
+ "21": 0,
13747
+ "22": 0,
13748
+ "23": 0,
13749
+ "24": 0,
13750
+ "25": 0,
13751
+ "26": 0,
13752
+ "27": 0
13023
13753
  },
13024
13754
  f: {
13025
13755
  "0": 0,
13026
- "1": 0
13756
+ "1": 0,
13757
+ "2": 0,
13758
+ "3": 0
13027
13759
  },
13028
13760
  b: {
13029
13761
  "0": [0, 0],
13030
- "1": [0, 0]
13762
+ "1": [0, 0],
13763
+ "2": [0, 0],
13764
+ "3": [0, 0],
13765
+ "4": [0, 0],
13766
+ "5": [0, 0],
13767
+ "6": [0, 0]
13031
13768
  },
13032
13769
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
13033
- hash: "453af03f3dd7f85ab3bf4c8db8a9fd491e49a472"
13770
+ hash: "bc220bea68267c3c797a9839f5dc276073d3b9c7"
13034
13771
  };
13035
13772
  var coverage = global[gcv] || (global[gcv] = {});
13036
13773
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -13039,35 +13776,110 @@
13039
13776
  var actualCoverage = coverage[path];
13040
13777
  {
13041
13778
  // @ts-ignore
13042
- cov_1ppagvbu7n = function () {
13779
+ cov_17yhjdv6rr = function () {
13043
13780
  return actualCoverage;
13044
13781
  };
13045
13782
  }
13046
13783
  return actualCoverage;
13047
13784
  }
13048
- cov_1ppagvbu7n();
13049
- var noDanglingConstants = {
13785
+ cov_17yhjdv6rr();
13786
+ var _ref = (cov_17yhjdv6rr().s[0]++, require("prettier")),
13787
+ resolveConfig = _ref.resolveConfig;
13788
+ var ensureCompactObjects = {
13050
13789
  meta: {
13051
- type: "suggestion",
13790
+ type: "problem",
13052
13791
  docs: {
13053
- description: "Indicates that any constant outside a constant.[js|jsx] file should be moved to a constant.[js|jsx] file."
13054
- }
13792
+ description: "Ensures compact objects"
13793
+ },
13794
+ fixable: "whitespace"
13055
13795
  },
13056
13796
  create: function create(context) {
13057
- cov_1ppagvbu7n().f[0]++;
13058
- cov_1ppagvbu7n().s[0]++;
13797
+ cov_17yhjdv6rr().f[0]++;
13798
+ cov_17yhjdv6rr().s[1]++;
13059
13799
  return {
13060
- VariableDeclaration: function VariableDeclaration(node) {
13061
- cov_1ppagvbu7n().f[1]++;
13062
- cov_1ppagvbu7n().s[1]++;
13063
- if ((cov_1ppagvbu7n().b[1][0]++, !isConstantsFile(context)) && (cov_1ppagvbu7n().b[1][1]++, matches(CONSTANT_DECALARATION_PATTERN, node))) {
13064
- cov_1ppagvbu7n().b[0][0]++;
13065
- var constantName = (cov_1ppagvbu7n().s[2]++, node.declarations[0].id.name);
13066
- cov_1ppagvbu7n().s[3]++;
13067
- context.report(node, moveToConstantsJs(constantName));
13800
+ ObjectExpression: function ObjectExpression(node) {
13801
+ var _resolveConfig$sync;
13802
+ cov_17yhjdv6rr().f[1]++;
13803
+ cov_17yhjdv6rr().s[2]++;
13804
+ if (!matches(OBJECT_EXPRESSION_PATTERN, node)) {
13805
+ cov_17yhjdv6rr().b[0][0]++;
13806
+ cov_17yhjdv6rr().s[3]++;
13807
+ return;
13068
13808
  } else {
13069
- cov_1ppagvbu7n().b[0][1]++;
13809
+ cov_17yhjdv6rr().b[0][1]++;
13070
13810
  }
13811
+ cov_17yhjdv6rr().s[4]++;
13812
+ if (matches(ARRAY_OR_OBJECT_PATTERN, node.parent)) {
13813
+ cov_17yhjdv6rr().b[1][0]++;
13814
+ cov_17yhjdv6rr().s[5]++;
13815
+ return;
13816
+ } else {
13817
+ cov_17yhjdv6rr().b[1][1]++;
13818
+ }
13819
+ var sourceCode = (cov_17yhjdv6rr().s[6]++, context.getSourceCode());
13820
+ var hasComments = (cov_17yhjdv6rr().s[7]++, isNotEmpty$1(sourceCode.getCommentsInside(node)));
13821
+ cov_17yhjdv6rr().s[8]++;
13822
+ if (hasComments) {
13823
+ cov_17yhjdv6rr().b[2][0]++;
13824
+ cov_17yhjdv6rr().s[9]++;
13825
+ return;
13826
+ } else {
13827
+ cov_17yhjdv6rr().b[2][1]++;
13828
+ }
13829
+ var openingBraceLine = (cov_17yhjdv6rr().s[10]++, node.loc.start.line);
13830
+ var closingBraceLine = (cov_17yhjdv6rr().s[11]++, node.loc.end.line);
13831
+ cov_17yhjdv6rr().s[12]++;
13832
+ if (openingBraceLine === closingBraceLine) {
13833
+ cov_17yhjdv6rr().b[3][0]++;
13834
+ cov_17yhjdv6rr().s[13]++;
13835
+ return;
13836
+ } else {
13837
+ cov_17yhjdv6rr().b[3][1]++;
13838
+ }
13839
+ var singleLineExpression = (cov_17yhjdv6rr().s[14]++, node.properties.map(function (property) {
13840
+ cov_17yhjdv6rr().f[2]++;
13841
+ cov_17yhjdv6rr().s[15]++;
13842
+ return sourceCode.getText(property);
13843
+ }).join(", "));
13844
+ var _fix = (cov_17yhjdv6rr().s[16]++, "{ ".concat(singleLineExpression, " }"));
13845
+ cov_17yhjdv6rr().s[17]++;
13846
+ if (/\r|\n/.test(_fix)) {
13847
+ cov_17yhjdv6rr().b[4][0]++;
13848
+ cov_17yhjdv6rr().s[18]++;
13849
+ return;
13850
+ } else {
13851
+ cov_17yhjdv6rr().b[4][1]++;
13852
+ }
13853
+ var openingBraceColumn = (cov_17yhjdv6rr().s[19]++, node.loc.start.column);
13854
+ var closingBraceColumn = (cov_17yhjdv6rr().s[20]++, node.loc.end.column);
13855
+ var printWidth = (cov_17yhjdv6rr().s[21]++, (cov_17yhjdv6rr().b[5][0]++, (_resolveConfig$sync = resolveConfig.sync(context.getFilename(), {
13856
+ useCache: true,
13857
+ editorconfig: true
13858
+ })) === null || _resolveConfig$sync === void 0 ? void 0 : _resolveConfig$sync.printWidth) || (cov_17yhjdv6rr().b[5][1]++, 80));
13859
+ var countOfTokensAfterClosingBrace = (cov_17yhjdv6rr().s[22]++, sourceCode.lines[closingBraceLine - 1].slice(closingBraceColumn).length);
13860
+ var resultLength = (cov_17yhjdv6rr().s[23]++, openingBraceColumn + _fix.length + countOfTokensAfterClosingBrace);
13861
+ cov_17yhjdv6rr().s[24]++;
13862
+ if (resultLength > printWidth) {
13863
+ cov_17yhjdv6rr().b[6][0]++;
13864
+ cov_17yhjdv6rr().s[25]++;
13865
+ return;
13866
+ } else {
13867
+ cov_17yhjdv6rr().b[6][1]++;
13868
+ }
13869
+ cov_17yhjdv6rr().s[26]++;
13870
+ context.report({
13871
+ node: node,
13872
+ loc: {
13873
+ start: node.loc.start,
13874
+ end: node.loc.end
13875
+ },
13876
+ message: replaceWith(_fix),
13877
+ fix: function fix(fixer) {
13878
+ cov_17yhjdv6rr().f[3]++;
13879
+ cov_17yhjdv6rr().s[27]++;
13880
+ return fixer.replaceText(node, _fix);
13881
+ }
13882
+ });
13071
13883
  }
13072
13884
  };
13073
13885
  }
@@ -55993,6 +56805,7 @@
55993
56805
  "api-connector-should-use-default-export": apiConnectorShouldUseDefaultExport,
55994
56806
  "combine-multiple-independent-awaits": combineMultipleIndependentAwaits,
55995
56807
  "consistent-button-link-anchor": consistentButtonLinkAnchor,
56808
+ "ensure-compact-objects": ensureCompactObjects,
55996
56809
  "ensure-zustand-stores-are-type-annotated": ensureZustandStoresAreTypeAnnotated,
55997
56810
  "files-inside-react-query-folder-should-end-with-api": filesInsideReactQueryFolderShouldEndWithApi,
55998
56811
  "file-name-and-export-name-standards": fileNameAndExportNameStandards,