eslint-plugin-obsidian 2.8.0 → 2.9.0

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 (96) hide show
  1. package/dist/dto/callExpression.d.ts.map +1 -1
  2. package/dist/dto/callExpression.js +3 -1
  3. package/dist/dto/callExpression.js.map +1 -1
  4. package/dist/dto/componentProps.d.ts +1 -1
  5. package/dist/dto/componentProps.d.ts.map +1 -1
  6. package/dist/dto/componentProps.js +4 -4
  7. package/dist/dto/componentProps.js.map +1 -1
  8. package/dist/dto/context.d.ts +1 -1
  9. package/dist/dto/context.d.ts.map +1 -1
  10. package/dist/dto/generics.d.ts +1 -1
  11. package/dist/dto/generics.d.ts.map +1 -1
  12. package/dist/dto/generics.js +2 -2
  13. package/dist/dto/generics.js.map +1 -1
  14. package/dist/dto/{missingType.d.ts → types/missingType.d.ts} +2 -0
  15. package/dist/dto/types/missingType.d.ts.map +1 -0
  16. package/dist/dto/{missingType.js → types/missingType.js} +6 -0
  17. package/dist/dto/types/missingType.js.map +1 -0
  18. package/dist/dto/{singleType.d.ts → types/singleType.d.ts} +2 -0
  19. package/dist/dto/types/singleType.d.ts.map +1 -0
  20. package/dist/dto/{singleType.js → types/singleType.js} +8 -1
  21. package/dist/dto/types/singleType.js.map +1 -0
  22. package/dist/dto/{type.d.ts → types/type.d.ts} +2 -0
  23. package/dist/dto/types/type.d.ts.map +1 -0
  24. package/dist/dto/{type.js.map → types/type.js.map} +1 -1
  25. package/dist/dto/{typeIntersection.d.ts → types/typeIntersection.d.ts} +3 -0
  26. package/dist/dto/types/typeIntersection.d.ts.map +1 -0
  27. package/dist/dto/{typeIntersection.js → types/typeIntersection.js} +13 -1
  28. package/dist/dto/types/typeIntersection.js.map +1 -0
  29. package/dist/dto/{typeLiteral.d.ts → types/typeLiteral.d.ts} +3 -0
  30. package/dist/dto/types/typeLiteral.d.ts.map +1 -0
  31. package/dist/dto/{typeLiteral.js → types/typeLiteral.js} +11 -1
  32. package/dist/dto/types/typeLiteral.js.map +1 -0
  33. package/dist/dto/{typeReference.d.ts → types/typeReference.d.ts} +2 -0
  34. package/dist/dto/types/typeReference.d.ts.map +1 -0
  35. package/dist/dto/{typeReference.js → types/typeReference.js} +7 -1
  36. package/dist/dto/types/typeReference.js.map +1 -0
  37. package/dist/rules/stronglyTypedInjectComponent/createRule.d.ts +2 -1
  38. package/dist/rules/stronglyTypedInjectComponent/createRule.d.ts.map +1 -1
  39. package/dist/rules/stronglyTypedInjectComponent/createRule.js +3 -3
  40. package/dist/rules/stronglyTypedInjectComponent/createRule.js.map +1 -1
  41. package/dist/rules/stronglyTypedInjectComponent/index.d.ts +6 -1
  42. package/dist/rules/stronglyTypedInjectComponent/index.d.ts.map +1 -1
  43. package/dist/rules/stronglyTypedInjectComponent/index.js +19 -5
  44. package/dist/rules/stronglyTypedInjectComponent/index.js.map +1 -1
  45. package/dist/rules/stronglyTypedInjectComponent/injectComponentHandler.d.ts +3 -3
  46. package/dist/rules/stronglyTypedInjectComponent/injectComponentHandler.d.ts.map +1 -1
  47. package/dist/rules/stronglyTypedInjectComponent/injectComponentHandler.js +4 -5
  48. package/dist/rules/stronglyTypedInjectComponent/injectComponentHandler.js.map +1 -1
  49. package/dist/rules/stronglyTypedInjectComponent/result/errorReporter.d.ts +9 -0
  50. package/dist/rules/stronglyTypedInjectComponent/result/errorReporter.d.ts.map +1 -0
  51. package/dist/rules/stronglyTypedInjectComponent/{errorReporter.js → result/errorReporter.js} +3 -3
  52. package/dist/rules/stronglyTypedInjectComponent/result/errorReporter.js.map +1 -0
  53. package/dist/rules/stronglyTypedInjectComponent/result/missingTypeError.d.ts +9 -0
  54. package/dist/rules/stronglyTypedInjectComponent/result/missingTypeError.d.ts.map +1 -0
  55. package/dist/rules/stronglyTypedInjectComponent/result/missingTypeError.js +14 -0
  56. package/dist/rules/stronglyTypedInjectComponent/result/missingTypeError.js.map +1 -0
  57. package/dist/rules/stronglyTypedInjectComponent/result/redundantTypeError.d.ts +9 -0
  58. package/dist/rules/stronglyTypedInjectComponent/result/redundantTypeError.d.ts.map +1 -0
  59. package/dist/rules/stronglyTypedInjectComponent/result/redundantTypeError.js +15 -0
  60. package/dist/rules/stronglyTypedInjectComponent/result/redundantTypeError.js.map +1 -0
  61. package/dist/rules/stronglyTypedInjectComponent/result/result.d.ts +5 -0
  62. package/dist/rules/stronglyTypedInjectComponent/result/result.d.ts.map +1 -0
  63. package/dist/rules/stronglyTypedInjectComponent/result/result.js +3 -0
  64. package/dist/rules/stronglyTypedInjectComponent/result/result.js.map +1 -0
  65. package/dist/rules/stronglyTypedInjectComponent/result/success.d.ts +6 -0
  66. package/dist/rules/stronglyTypedInjectComponent/result/success.d.ts.map +1 -0
  67. package/dist/rules/stronglyTypedInjectComponent/result/success.js +13 -0
  68. package/dist/rules/stronglyTypedInjectComponent/result/success.js.map +1 -0
  69. package/dist/rules/stronglyTypedInjectComponent/typeValidator.d.ts +10 -9
  70. package/dist/rules/stronglyTypedInjectComponent/typeValidator.d.ts.map +1 -1
  71. package/dist/rules/stronglyTypedInjectComponent/typeValidator.js +39 -8
  72. package/dist/rules/stronglyTypedInjectComponent/typeValidator.js.map +1 -1
  73. package/dist/utils/array.d.ts +1 -0
  74. package/dist/utils/array.d.ts.map +1 -1
  75. package/dist/utils/array.js +5 -1
  76. package/dist/utils/array.js.map +1 -1
  77. package/dist/utils/regex.d.ts +2 -0
  78. package/dist/utils/regex.d.ts.map +1 -0
  79. package/dist/utils/regex.js +10 -0
  80. package/dist/utils/regex.js.map +1 -0
  81. package/package.json +1 -1
  82. package/dist/dto/missingType.d.ts.map +0 -1
  83. package/dist/dto/missingType.js.map +0 -1
  84. package/dist/dto/singleType.d.ts.map +0 -1
  85. package/dist/dto/singleType.js.map +0 -1
  86. package/dist/dto/type.d.ts.map +0 -1
  87. package/dist/dto/typeIntersection.d.ts.map +0 -1
  88. package/dist/dto/typeIntersection.js.map +0 -1
  89. package/dist/dto/typeLiteral.d.ts.map +0 -1
  90. package/dist/dto/typeLiteral.js.map +0 -1
  91. package/dist/dto/typeReference.d.ts.map +0 -1
  92. package/dist/dto/typeReference.js.map +0 -1
  93. package/dist/rules/stronglyTypedInjectComponent/errorReporter.d.ts +0 -9
  94. package/dist/rules/stronglyTypedInjectComponent/errorReporter.d.ts.map +0 -1
  95. package/dist/rules/stronglyTypedInjectComponent/errorReporter.js.map +0 -1
  96. /package/dist/dto/{type.js → types/type.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"callExpression.d.ts","sourceRoot":"","sources":["../../src/dto/callExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,qBAAa,cAAc;IACX,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc;gBAA7B,IAAI,EAAE,QAAQ,CAAC,cAAc;IAE3C,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,MAAM,IAAI,QAAQ,CAAC,IAAI,CAE1B;IAED,IAAI,SAAS,IAAI,UAAU,EAAE,CAE5B;IAED,IAAI,QAAQ,yBAEX;IAED,OAAO,KAAK,MAAM,GAEjB;CACJ"}
1
+ {"version":3,"file":"callExpression.d.ts","sourceRoot":"","sources":["../../src/dto/callExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,qBAAa,cAAc;IACb,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc;gBAA7B,IAAI,EAAE,QAAQ,CAAC,cAAc;IAE3C,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,MAAM,IAAI,QAAQ,CAAC,IAAI,CAE1B;IAED,IAAI,SAAS,IAAI,UAAU,EAAE,CAE5B;IAED,IAAI,QAAQ,yBAIX;IAED,OAAO,KAAK,MAAM,GAEjB;CACF"}
@@ -20,7 +20,9 @@ class CallExpression {
20
20
  return this.node.arguments.map((arg) => new identifier_1.Identifier(arg));
21
21
  }
22
22
  get generics() {
23
- return this.node.typeArguments && new generics_1.Generics(this.node.typeArguments);
23
+ return this.node.typeArguments ?
24
+ new generics_1.Generics(this.node.typeArguments) :
25
+ this.node.typeParameters && new generics_1.Generics(this.node.typeParameters);
24
26
  }
25
27
  get callee() {
26
28
  return this.node.callee;
@@ -1 +1 @@
1
- {"version":3,"file":"callExpression.js","sourceRoot":"","sources":["../../src/dto/callExpression.ts"],"names":[],"mappings":";;;AACA,6CAA0C;AAC1C,yCAAsC;AAEtC,MAAa,cAAc;IACvB,YAAqB,IAA6B;QAA7B,SAAI,GAAJ,IAAI,CAAyB;IAAG,CAAC;IAE/C,YAAY,CAAC,IAAY;QAC5B,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;IAC9B,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,MAAO,CAAC;IAC7B,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,uBAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,mBAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1E,CAAC;IAED,IAAY,MAAM;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,MAA6B,CAAC;IACnD,CAAC;CACJ;AA1BD,wCA0BC"}
1
+ {"version":3,"file":"callExpression.js","sourceRoot":"","sources":["../../src/dto/callExpression.ts"],"names":[],"mappings":";;;AACA,6CAA0C;AAC1C,yCAAsC;AAEtC,MAAa,cAAc;IACzB,YAAqB,IAA6B;QAA7B,SAAI,GAAJ,IAAI,CAAyB;IAAI,CAAC;IAEhD,YAAY,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAO,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,uBAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC9B,IAAI,mBAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;YACvC,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,IAAI,mBAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACvE,CAAC;IAED,IAAY,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAA6B,CAAC;IACjD,CAAC;CACF;AA5BD,wCA4BC"}
@@ -1,5 +1,5 @@
1
1
  import type { TSESTree } from '@typescript-eslint/types';
2
- import type { Type } from './type';
2
+ import type { Type } from './types/type';
3
3
  export declare class ComponentProps {
4
4
  private props;
5
5
  constructor(props: TSESTree.Parameter);
@@ -1 +1 @@
1
- {"version":3,"file":"componentProps.d.ts","sourceRoot":"","sources":["../../src/dto/componentProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAUzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC,qBAAa,cAAc;IAEb,OAAO,CAAC,KAAK;gBADb,KAAK,EAAE,QAAQ,CAAC,SAAS;IAGrC,IAAI,IAAI,IAAI,IAAI,CAQf;CACF"}
1
+ {"version":3,"file":"componentProps.d.ts","sourceRoot":"","sources":["../../src/dto/componentProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAUzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,qBAAa,cAAc;IAEb,OAAO,CAAC,KAAK;gBADb,KAAK,EAAE,QAAQ,CAAC,SAAS;IAGrC,IAAI,IAAI,IAAI,IAAI,CAQf;CACF"}
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ComponentProps = void 0;
4
4
  const ast_1 = require("../utils/ast");
5
- const singleType_1 = require("./singleType");
6
- const typeIntersection_1 = require("./typeIntersection");
7
- const missingType_1 = require("./missingType");
8
- const typeReference_1 = require("./typeReference");
5
+ const singleType_1 = require("./types/singleType");
6
+ const typeIntersection_1 = require("./types/typeIntersection");
7
+ const missingType_1 = require("./types/missingType");
8
+ const typeReference_1 = require("./types/typeReference");
9
9
  class ComponentProps {
10
10
  constructor(props) {
11
11
  this.props = props;
@@ -1 +1 @@
1
- {"version":3,"file":"componentProps.js","sourceRoot":"","sources":["../../src/dto/componentProps.ts"],"names":[],"mappings":";;;AACA,sCAKsB;AACtB,6CAA0C;AAC1C,yDAAsD;AACtD,+CAA4C;AAE5C,mDAAgD;AAEhD,MAAa,cAAc;IAEzB,YAAoB,KAA0B;QAA1B,UAAK,GAAL,KAAK,CAAqB;IAAI,CAAC;IAEnD,IAAI,IAAI;;QACN,MAAM,cAAc,GAAG,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,0CAAE,cAAc,CAAC;QAClE,IAAI,CAAC,cAAc;YAAE,OAAO,IAAI,yBAAW,EAAE,CAAC;QAC9C,IAAI,IAAA,wBAAkB,EAAC,cAAc,CAAC;YAAE,OAAO,IAAI,mCAAgB,CAAC,cAAc,CAAC,CAAC;QACpF,IAAI,IAAA,eAAS,EAAC,cAAc,CAAC;YAAE,OAAO,IAAI,yBAAW,EAAE,CAAC;QACxD,IAAI,IAAA,qBAAe,EAAC,cAAc,CAAC;YAAE,OAAO,IAAI,6BAAa,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,IAAA,sBAAgB,EAAC,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,CAAC;YAAE,OAAO,IAAI,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpF,OAAO,IAAI,yBAAW,EAAE,CAAC;IAC3B,CAAC;CACF;AAbD,wCAaC"}
1
+ {"version":3,"file":"componentProps.js","sourceRoot":"","sources":["../../src/dto/componentProps.ts"],"names":[],"mappings":";;;AACA,sCAKsB;AACtB,mDAAgD;AAChD,+DAA4D;AAC5D,qDAAkD;AAElD,yDAAsD;AAEtD,MAAa,cAAc;IAEzB,YAAoB,KAA0B;QAA1B,UAAK,GAAL,KAAK,CAAqB;IAAI,CAAC;IAEnD,IAAI,IAAI;;QACN,MAAM,cAAc,GAAG,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,0CAAE,cAAc,CAAC;QAClE,IAAI,CAAC,cAAc;YAAE,OAAO,IAAI,yBAAW,EAAE,CAAC;QAC9C,IAAI,IAAA,wBAAkB,EAAC,cAAc,CAAC;YAAE,OAAO,IAAI,mCAAgB,CAAC,cAAc,CAAC,CAAC;QACpF,IAAI,IAAA,eAAS,EAAC,cAAc,CAAC;YAAE,OAAO,IAAI,yBAAW,EAAE,CAAC;QACxD,IAAI,IAAA,qBAAe,EAAC,cAAc,CAAC;YAAE,OAAO,IAAI,6BAAa,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,IAAA,sBAAgB,EAAC,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,CAAC;YAAE,OAAO,IAAI,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpF,OAAO,IAAI,yBAAW,EAAE,CAAC;IAC3B,CAAC;CACF;AAbD,wCAaC"}
@@ -1,6 +1,6 @@
1
1
  import type { TSESTree } from '@typescript-eslint/types';
2
2
  import type { RuleContext } from '@typescript-eslint/utils/ts-eslint';
3
- export declare class Context<MessageId extends string = any, Options extends any[] = any> {
3
+ export declare class Context<MessageId extends string = any, Options extends readonly unknown[] = any> {
4
4
  private context;
5
5
  constructor(context: RuleContext<MessageId, Options>);
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/dto/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,qBAAa,OAAO,CAAC,SAAS,SAAS,MAAM,GAAG,GAAG,EAAE,OAAO,SAAS,GAAG,EAAE,GAAG,GAAG;IAClE,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5D;;OAEG;IACH,IAAW,eAAe,WAEzB;IAEM,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG;CAGxE"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/dto/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,qBAAa,OAAO,CAAC,SAAS,SAAS,MAAM,GAAG,GAAG,EAAE,OAAO,SAAS,SAAS,OAAO,EAAE,GAAG,GAAG;IAC/E,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5D;;OAEG;IACH,IAAW,eAAe,WAEzB;IAEM,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG;CAGxE"}
@@ -1,5 +1,5 @@
1
1
  import type { TSESTree } from '@typescript-eslint/types';
2
- import type { Type } from './type';
2
+ import type { Type } from './types/type';
3
3
  export declare class Generics {
4
4
  readonly node: TSESTree.TSTypeParameterInstantiation;
5
5
  constructor(node: TSESTree.TSTypeParameterInstantiation | undefined);
@@ -1 +1 @@
1
- {"version":3,"file":"generics.d.ts","sourceRoot":"","sources":["../../src/dto/generics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC,qBAAa,QAAQ;IAEP,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,4BAA4B;gBADpD,IAAI,EAAE,QAAQ,CAAC,4BAA4B,GAAG,SAAS;IAKnE,IAAI,KAAK,IAAI,IAAI,EAAE,CAKlB;IAED,OAAO,KAAK,MAAM,GAEjB;CACF"}
1
+ {"version":3,"file":"generics.d.ts","sourceRoot":"","sources":["../../src/dto/generics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,qBAAa,QAAQ;IAEP,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,4BAA4B;gBADpD,IAAI,EAAE,QAAQ,CAAC,4BAA4B,GAAG,SAAS;IAKnE,IAAI,KAAK,IAAI,IAAI,EAAE,CAKlB;IAED,OAAO,KAAK,MAAM,GAEjB;CACF"}
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Generics = void 0;
4
4
  const assertions_1 = require("../utils/assertions");
5
5
  const ast_1 = require("../utils/ast");
6
- const typeLiteral_1 = require("./typeLiteral");
7
- const typeReference_1 = require("./typeReference");
6
+ const typeLiteral_1 = require("./types/typeLiteral");
7
+ const typeReference_1 = require("./types/typeReference");
8
8
  class Generics {
9
9
  constructor(node) {
10
10
  this.node = node;
@@ -1 +1 @@
1
- {"version":3,"file":"generics.js","sourceRoot":"","sources":["../../src/dto/generics.ts"],"names":[],"mappings":";;;AACA,oDAAoD;AACpD,sCAA6C;AAC7C,+CAA4C;AAE5C,mDAAgD;AAEhD,MAAa,QAAQ;IAEnB,YAAqB,IAA2C;QAA3C,SAAI,GAAJ,IAAI,CAAuC;QAC9D,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM;aACf,GAAG,CAAC,CAAC,KAA+B,EAAE,EAAE;YACvC,OAAO,IAAA,mBAAa,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,yBAAW,EAAE,CAAC,CAAC,CAAC,IAAI,6BAAa,CAAC,KAAK,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAY,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAoC,CAAC;IACxD,CAAC;CACF;AAhBD,4BAgBC"}
1
+ {"version":3,"file":"generics.js","sourceRoot":"","sources":["../../src/dto/generics.ts"],"names":[],"mappings":";;;AACA,oDAAoD;AACpD,sCAA6C;AAC7C,qDAAkD;AAElD,yDAAsD;AAEtD,MAAa,QAAQ;IAEnB,YAAqB,IAA2C;QAA3C,SAAI,GAAJ,IAAI,CAAuC;QAC9D,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM;aACf,GAAG,CAAC,CAAC,KAA+B,EAAE,EAAE;YACvC,OAAO,IAAA,mBAAa,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,yBAAW,EAAE,CAAC,CAAC,CAAC,IAAI,6BAAa,CAAC,KAAK,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAY,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAoC,CAAC;IACxD,CAAC;CACF;AAhBD,4BAgBC"}
@@ -3,5 +3,7 @@ export declare class MissingType implements Type {
3
3
  toString(): string[];
4
4
  isEmpty(): boolean;
5
5
  equals(types: Type[]): boolean;
6
+ includes(): boolean;
7
+ size(): number;
6
8
  }
7
9
  //# sourceMappingURL=missingType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"missingType.d.ts","sourceRoot":"","sources":["../../../src/dto/types/missingType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,qBAAa,WAAY,YAAW,IAAI;IACtC,QAAQ,IAAI,MAAM,EAAE;IAIpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;IAI9B,QAAQ,IAAI,OAAO;IAInB,IAAI,IAAI,MAAM;CAGf"}
@@ -11,6 +11,12 @@ class MissingType {
11
11
  equals(types) {
12
12
  return types.length === 0 || types.length === 1 && types[0].isEmpty();
13
13
  }
14
+ includes() {
15
+ return false;
16
+ }
17
+ size() {
18
+ return 0;
19
+ }
14
20
  }
15
21
  exports.MissingType = MissingType;
16
22
  //# sourceMappingURL=missingType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"missingType.js","sourceRoot":"","sources":["../../../src/dto/types/missingType.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;IACtB,QAAQ;QACN,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACxE,CAAC;IAED,QAAQ;QACJ,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI;QACF,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AApBD,kCAoBC"}
@@ -6,5 +6,7 @@ export declare class SingleType implements Type {
6
6
  toString(): string[];
7
7
  isEmpty(): boolean;
8
8
  equals(types: Type[]): boolean;
9
+ includes(type: Type[]): boolean;
10
+ size(): number;
9
11
  }
10
12
  //# sourceMappingURL=singleType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleType.d.ts","sourceRoot":"","sources":["../../../src/dto/types/singleType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC,qBAAa,UAAW,YAAW,IAAI;IACzB,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ,CAAC,UAAU;IAE9C,QAAQ,IAAI,MAAM,EAAE;IAKpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;IAI9B,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;IAI/B,IAAI,IAAI,MAAM;CAGf"}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SingleType = void 0;
4
- const identifier_1 = require("./identifier");
4
+ const lodash_1 = require("lodash");
5
+ const identifier_1 = require("../identifier");
5
6
  class SingleType {
6
7
  constructor(props) {
7
8
  this.props = props;
@@ -17,6 +18,12 @@ class SingleType {
17
18
  equals(types) {
18
19
  return types.length === 1 && types[0].toString() === this.toString();
19
20
  }
21
+ includes(type) {
22
+ return type.some((t) => (0, lodash_1.isEqual)(t.toString(), this.toString()));
23
+ }
24
+ size() {
25
+ return 1;
26
+ }
20
27
  }
21
28
  exports.SingleType = SingleType;
22
29
  //# sourceMappingURL=singleType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleType.js","sourceRoot":"","sources":["../../../src/dto/types/singleType.ts"],"names":[],"mappings":";;;AACA,mCAAiC;AAEjC,8CAA2C;AAE3C,MAAa,UAAU;IACrB,YAAoB,KAA0B;QAA1B,UAAK,GAAL,KAAK,CAAqB;IAAG,CAAC;IAElD,QAAQ;;QACN,MAAM,OAAO,GAAG,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,0CAAE,cAA0C,CAAC;QACvF,OAAO,CAAC,IAAI,uBAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;IACvE,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,IAAI;QACF,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AAvBD,gCAuBC"}
@@ -2,5 +2,7 @@ export interface Type {
2
2
  toString(): string[];
3
3
  isEmpty(): boolean;
4
4
  equals(types: Type[]): boolean;
5
+ includes(type: Type[]): boolean;
6
+ size(): number;
5
7
  }
6
8
  //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/dto/types/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,QAAQ,IAAI,MAAM,EAAE,CAAC;IACrB,OAAO,IAAI,OAAO,CAAC;IACnB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAChC,IAAI,IAAI,MAAM,CAAC;CAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/dto/type.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/dto/types/type.ts"],"names":[],"mappings":""}
@@ -6,5 +6,8 @@ export declare class TypeIntersection implements Type {
6
6
  toString(): string[];
7
7
  isEmpty(): boolean;
8
8
  equals(types: Type[]): boolean;
9
+ includes(type: Type[]): boolean;
10
+ private get types();
11
+ size(): number;
9
12
  }
10
13
  //# sourceMappingURL=typeIntersection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeIntersection.d.ts","sourceRoot":"","sources":["../../../src/dto/types/typeIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAI9B,qBAAa,gBAAiB,YAAW,IAAI;IAC/B,OAAO,CAAC,cAAc;gBAAd,cAAc,EAAE,QAAQ,CAAC,kBAAkB;IAE/D,QAAQ,IAAI,MAAM,EAAE;IAOpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;IAI9B,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;IAI/B,OAAO,KAAK,KAAK,GAIhB;IAED,IAAI,IAAI,MAAM;CAGf"}
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TypeIntersection = void 0;
4
4
  const lodash_1 = require("lodash");
5
- const identifier_1 = require("./identifier");
5
+ const identifier_1 = require("../identifier");
6
+ const typeReference_1 = require("./typeReference");
6
7
  class TypeIntersection {
7
8
  constructor(typeAnnotation) {
8
9
  this.typeAnnotation = typeAnnotation;
@@ -19,6 +20,17 @@ class TypeIntersection {
19
20
  equals(types) {
20
21
  return (0, lodash_1.isEqual)(this.toString(), types.map((type) => type.toString()).flat());
21
22
  }
23
+ includes(type) {
24
+ return this.types.every((t) => t.includes(type));
25
+ }
26
+ get types() {
27
+ return this.typeAnnotation.types.map((type) => {
28
+ return new typeReference_1.TypeReference(type);
29
+ });
30
+ }
31
+ size() {
32
+ return this.typeAnnotation.types.length;
33
+ }
22
34
  }
23
35
  exports.TypeIntersection = TypeIntersection;
24
36
  //# sourceMappingURL=typeIntersection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeIntersection.js","sourceRoot":"","sources":["../../../src/dto/types/typeIntersection.ts"],"names":[],"mappings":";;;AACA,mCAAiC;AAEjC,8CAA2C;AAC3C,mDAAgD;AAEhD,MAAa,gBAAgB;IAC3B,YAAoB,cAA2C;QAA3C,mBAAc,GAAd,cAAc,CAA6B;IAAI,CAAC;IAEpE,QAAQ;QACN,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,IAAgC,CAAC;YACjD,OAAO,IAAI,uBAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,IAAA,gBAAO,EAAC,IAAI,CAAC,QAAQ,EAAE,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5C,OAAO,IAAI,6BAAa,CAAC,IAAgC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1C,CAAC;CACF;AA/BD,4CA+BC"}
@@ -1,8 +1,11 @@
1
1
  import type { Type } from './type';
2
2
  export declare class TypeLiteral implements Type {
3
+ private readonly name;
3
4
  static isTypeLiteral(type: Type): type is TypeLiteral;
4
5
  toString(): string[];
5
6
  isEmpty(): boolean;
6
7
  equals(types: Type[]): boolean;
8
+ includes(type: Type[]): boolean;
9
+ size(): number;
7
10
  }
8
11
  //# sourceMappingURL=typeLiteral.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeLiteral.d.ts","sourceRoot":"","sources":["../../../src/dto/types/typeLiteral.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,qBAAa,WAAY,YAAW,IAAI;IACtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA2B;IAEhD,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,WAAW;IAIrD,QAAQ,IAAI,MAAM,EAAE;IAIpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;IAI9B,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;IAI/B,IAAI,IAAI,MAAM;CAGf"}
@@ -1,12 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TypeLiteral = void 0;
4
+ const lodash_1 = require("lodash");
4
5
  class TypeLiteral {
6
+ constructor() {
7
+ this.name = (0, lodash_1.uniqueId)('TypeLiteral');
8
+ }
5
9
  static isTypeLiteral(type) {
6
10
  return type instanceof TypeLiteral;
7
11
  }
8
12
  toString() {
9
- throw new Error('Method not implemented.');
13
+ return [this.name];
10
14
  }
11
15
  isEmpty() {
12
16
  throw new Error('Method not implemented.');
@@ -14,6 +18,12 @@ class TypeLiteral {
14
18
  equals(types) {
15
19
  return types.length === 1 && types[0].toString() === this.toString();
16
20
  }
21
+ includes(type) {
22
+ return type.every((t) => (0, lodash_1.isEqual)(t.toString(), this.toString()));
23
+ }
24
+ size() {
25
+ return 1;
26
+ }
17
27
  }
18
28
  exports.TypeLiteral = TypeLiteral;
19
29
  //# sourceMappingURL=typeLiteral.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeLiteral.js","sourceRoot":"","sources":["../../../src/dto/types/typeLiteral.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAG3C,MAAa,WAAW;IAAxB;QACmB,SAAI,GAAG,IAAA,iBAAQ,EAAC,aAAa,CAAC,CAAC;IAyBlD,CAAC;IAvBC,MAAM,CAAC,aAAa,CAAC,IAAU;QAC7B,OAAO,IAAI,YAAY,WAAW,CAAC;IACrC,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAED,OAAO;QACL,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;IACvE,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,IAAI;QACF,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AA1BD,kCA0BC"}
@@ -6,5 +6,7 @@ export declare class TypeReference implements Type {
6
6
  toString(): string[];
7
7
  isEmpty(): boolean;
8
8
  equals(types: Type[]): boolean;
9
+ includes(type: Type[]): boolean;
10
+ size(): number;
9
11
  }
10
12
  //# sourceMappingURL=typeReference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeReference.d.ts","sourceRoot":"","sources":["../../../src/dto/types/typeReference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC,qBAAa,aAAc,YAAW,IAAI;IAC5B,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,QAAQ,CAAC,eAAe;IAElD,QAAQ,IAAI,MAAM,EAAE;IAIpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;IAI9B,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;IAI/B,IAAI,IAAI,MAAM;CAGf"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TypeReference = void 0;
4
4
  const lodash_1 = require("lodash");
5
- const identifier_1 = require("./identifier");
5
+ const identifier_1 = require("../identifier");
6
6
  class TypeReference {
7
7
  constructor(node) {
8
8
  this.node = node;
@@ -16,6 +16,12 @@ class TypeReference {
16
16
  equals(types) {
17
17
  return (0, lodash_1.isEqual)(this.toString(), types.map((type) => type.toString()).flat());
18
18
  }
19
+ includes(type) {
20
+ return type.some((t) => (0, lodash_1.isEqual)(this.toString(), t.toString()));
21
+ }
22
+ size() {
23
+ return 1;
24
+ }
19
25
  }
20
26
  exports.TypeReference = TypeReference;
21
27
  //# sourceMappingURL=typeReference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeReference.js","sourceRoot":"","sources":["../../../src/dto/types/typeReference.ts"],"names":[],"mappings":";;;AACA,mCAAiC;AAEjC,8CAA2C;AAE3C,MAAa,aAAa;IACxB,YAAoB,IAA8B;QAA9B,SAAI,GAAJ,IAAI,CAA0B;IAAI,CAAC;IAEvD,QAAQ;QACN,OAAO,CAAC,IAAI,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,IAAA,gBAAO,EAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,IAAI;QACF,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AAtBD,sCAsBC"}
@@ -1,7 +1,8 @@
1
1
  import type { TSESTree } from '@typescript-eslint/types';
2
2
  import { Context } from '../../dto/context';
3
3
  import { CallExpression } from '../../dto/callExpression';
4
- export declare function create(context: Context): {
4
+ import type { Options } from '.';
5
+ export declare function create(context: Context, options: Options): {
5
6
  CallExpression(node: TSESTree.CallExpression): void;
6
7
  };
7
8
  //# sourceMappingURL=createRule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createRule.d.ts","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/createRule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO;yBAOd,uBAAuB;EAI/C"}
1
+ {"version":3,"file":"createRule.d.ts","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/createRule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAEjC,wBAAgB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;yBAOhC,uBAAuB;EAI/C"}
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.create = void 0;
4
4
  const injectComponentHandler_1 = require("./injectComponentHandler");
5
5
  const callExpression_1 = require("../../dto/callExpression");
6
- const errorReporter_1 = require("./errorReporter");
6
+ const errorReporter_1 = require("./result/errorReporter");
7
7
  const typeValidator_1 = require("./typeValidator");
8
- function create(context) {
9
- const injectComponentHandler = new injectComponentHandler_1.InjectComponentHandler(new errorReporter_1.ErrorReporter(context), new typeValidator_1.TypeValidator());
8
+ function create(context, options) {
9
+ const injectComponentHandler = new injectComponentHandler_1.InjectComponentHandler(new typeValidator_1.TypeValidator(options), new errorReporter_1.ErrorReporter(context));
10
10
  return {
11
11
  CallExpression(node) {
12
12
  injectComponentHandler.handle(new callExpression_1.CallExpression(node));
@@ -1 +1 @@
1
- {"version":3,"file":"createRule.js","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/createRule.ts"],"names":[],"mappings":";;;AAEA,qEAAkE;AAClE,6DAA0D;AAC1D,mDAAgD;AAChD,mDAAgD;AAEhD,SAAgB,MAAM,CAAC,OAAgB;IACrC,MAAM,sBAAsB,GAAG,IAAI,+CAAsB,CACvD,IAAI,6BAAa,CAAC,OAAO,CAAC,EAC1B,IAAI,6BAAa,EAAE,CACpB,CAAC;IAEF,OAAO;QACL,cAAc,CAAC,IAA6B;YAC1C,sBAAsB,CAAC,MAAM,CAAC,IAAI,+BAAc,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,CAAC;KACF,CAAC;AACJ,CAAC;AAXD,wBAWC"}
1
+ {"version":3,"file":"createRule.js","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/createRule.ts"],"names":[],"mappings":";;;AAEA,qEAAkE;AAClE,6DAA0D;AAC1D,0DAAuD;AACvD,mDAAgD;AAGhD,SAAgB,MAAM,CAAC,OAAgB,EAAE,OAAgB;IACvD,MAAM,sBAAsB,GAAG,IAAI,+CAAsB,CACvD,IAAI,6BAAa,CAAC,OAAO,CAAC,EAC1B,IAAI,6BAAa,CAAC,OAAO,CAAC,CAC3B,CAAC;IAEF,OAAO;QACL,cAAc,CAAC,IAA6B;YAC1C,sBAAsB,CAAC,MAAM,CAAC,IAAI,+BAAc,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,CAAC;KACF,CAAC;AACJ,CAAC;AAXD,wBAWC"}
@@ -1,3 +1,8 @@
1
1
  import { type TSESLint } from '@typescript-eslint/utils';
2
- export declare const stronglyTypedInjectComponentGenerator: () => TSESLint.RuleModule<"strongly-typed-inject-component", [], TSESLint.RuleListener>;
2
+ export type Options = readonly [
3
+ {
4
+ injectedPropsPattern: string;
5
+ }
6
+ ];
7
+ export declare const stronglyTypedInjectComponentGenerator: () => TSESLint.RuleModule<"strongly-typed-inject-component", Options, TSESLint.RuleListener>;
3
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAWtE,eAAO,MAAM,qCAAqC,yFAmBjD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKtE,MAAM,MAAM,OAAO,GAAG,SAAS;IAC7B;QACE,oBAAoB,EAAE,MAAM,CAAC;KAC9B;CACF,CAAC;AAQF,eAAO,MAAM,qCAAqC,8FAiCjD,CAAC"}
@@ -7,8 +7,8 @@ const context_1 = require("../../dto/context");
7
7
  const createRule = utils_1.ESLintUtils.RuleCreator((name) => `https://wix-incubator.github.io/obsidian/docs/documentation/meta/eslint#${name}`);
8
8
  const stronglyTypedInjectComponentGenerator = () => {
9
9
  return createRule({
10
- create: (context) => {
11
- return (0, createRule_1.create)(new context_1.Context(context));
10
+ create: (context, options) => {
11
+ return (0, createRule_1.create)(new context_1.Context(context), options);
12
12
  },
13
13
  name: 'strongly-typed-inject-component',
14
14
  meta: {
@@ -17,12 +17,26 @@ const stronglyTypedInjectComponentGenerator = () => {
17
17
  recommended: 'strict',
18
18
  },
19
19
  messages: {
20
- 'strongly-typed-inject-component': 'The call to injectComponent is missing prop types. It should be typed as: {{expectation}}',
20
+ 'strongly-typed-inject-component': '{{message}}',
21
21
  },
22
- schema: [],
22
+ schema: [
23
+ {
24
+ type: 'object',
25
+ properties: {
26
+ injectedPropsPattern: {
27
+ type: 'string',
28
+ },
29
+ },
30
+ additionalProperties: false,
31
+ },
32
+ ],
23
33
  type: 'problem',
24
34
  },
25
- defaultOptions: [],
35
+ defaultOptions: [
36
+ {
37
+ injectedPropsPattern: '/\\b(Injected|InjectedProps)\\b/',
38
+ },
39
+ ],
26
40
  });
27
41
  };
28
42
  exports.stronglyTypedInjectComponentGenerator = stronglyTypedInjectComponentGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/index.ts"],"names":[],"mappings":";;;AAAA,oDAAsE;AAEtE,6CAAsC;AACtC,+CAA0C;AAI1C,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,CAAC,IAAI,EAAE,EAAE,CAAC,2EAA2E,IAAI,EAAE,CAC5F,CAAC;AAEK,MAAM,qCAAqC,GAAG,GAAG,EAAE;IACxD,OAAO,UAAU,CAAC;QAChB,MAAM,EAAE,CAAC,OAA2D,EAAE,EAAE;YACtE,OAAO,IAAA,mBAAM,EAAC,IAAI,iBAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,EAAE,iCAAiC;QACvC,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,WAAW,EAAE,2FAA2F;gBACxG,WAAW,EAAE,QAAQ;aACtB;YACD,QAAQ,EAAE;gBACR,iCAAiC,EAAE,2FAA2F;aAC/H;YACD,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,SAAS;SAChB;QACD,cAAc,EAAE,EAAE;KACnB,CAAgB,CAAC;AACpB,CAAC,CAAC;AAnBW,QAAA,qCAAqC,yCAmBhD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/index.ts"],"names":[],"mappings":";;;AAAA,oDAAsE;AAEtE,6CAAsC;AACtC,+CAA0C;AAU1C,MAAM,UAAU,GAAG,mBAAW,CAAC,WAAW,CACxC,CAAC,IAAI,EAAE,EAAE,CAAC,2EAA2E,IAAI,EAAE,CAC5F,CAAC;AAEK,MAAM,qCAAqC,GAAG,GAAG,EAAE;IACxD,OAAO,UAAU,CAAC;QAChB,MAAM,EAAE,CAAC,OAAgE,EAAE,OAAgB,EAAE,EAAE;YAC7F,OAAO,IAAA,mBAAM,EAAC,IAAI,iBAAO,CAA6C,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QAC3F,CAAC;QACD,IAAI,EAAE,iCAAiC;QACvC,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,WAAW,EAAE,2FAA2F;gBACxG,WAAW,EAAE,QAAQ;aACtB;YACD,QAAQ,EAAE;gBACR,iCAAiC,EAAE,aAAa;aACjD;YACD,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,oBAAoB,EAAE;4BACpB,IAAI,EAAE,QAAQ;yBACf;qBACF;oBACD,oBAAoB,EAAE,KAAK;iBAC5B;aACF;YACD,IAAI,EAAE,SAAS;SAChB;QACD,cAAc,EAAE;YACd;gBACE,oBAAoB,EAAE,kCAAkC;aACzD;SACF;KACF,CAAgB,CAAC;AACpB,CAAC,CAAC;AAjCW,QAAA,qCAAqC,yCAiChD"}
@@ -1,10 +1,10 @@
1
1
  import type { CallExpression } from '../../dto/callExpression';
2
- import type { ErrorReporter } from './errorReporter';
2
+ import type { ErrorReporter } from './result/errorReporter';
3
3
  import type { TypeValidator } from './typeValidator';
4
4
  export declare class InjectComponentHandler {
5
- private errorReporter;
6
5
  private typeValidator;
7
- constructor(errorReporter: ErrorReporter, typeValidator: TypeValidator);
6
+ private errorReporter;
7
+ constructor(typeValidator: TypeValidator, errorReporter: ErrorReporter);
8
8
  handle(callExpression: CallExpression): void;
9
9
  private getInjectedComponent;
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"injectComponentHandler.d.ts","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/injectComponentHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,qBAAa,sBAAsB;IACrB,OAAO,CAAC,aAAa;IAAiB,OAAO,CAAC,aAAa;gBAAnD,aAAa,EAAE,aAAa,EAAU,aAAa,EAAE,aAAa;IAE/E,MAAM,CAAC,cAAc,EAAE,cAAc;IAQ5C,OAAO,CAAC,oBAAoB;CAM7B"}
1
+ {"version":3,"file":"injectComponentHandler.d.ts","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/injectComponentHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,qBAAa,sBAAsB;IACrB,OAAO,CAAC,aAAa;IAAiB,OAAO,CAAC,aAAa;gBAAnD,aAAa,EAAE,aAAa,EAAU,aAAa,EAAE,aAAa;IAE/E,MAAM,CAAC,cAAc,EAAE,cAAc;IAQ5C,OAAO,CAAC,oBAAoB;CAM7B"}
@@ -4,16 +4,15 @@ exports.InjectComponentHandler = void 0;
4
4
  const ast_1 = require("../../utils/ast");
5
5
  const file_1 = require("../../dto/file");
6
6
  class InjectComponentHandler {
7
- constructor(errorReporter, typeValidator) {
8
- this.errorReporter = errorReporter;
7
+ constructor(typeValidator, errorReporter) {
9
8
  this.typeValidator = typeValidator;
9
+ this.errorReporter = errorReporter;
10
10
  }
11
11
  handle(callExpression) {
12
12
  if (callExpression.isExpression('injectComponent')) {
13
13
  const injectedComponent = this.getInjectedComponent(callExpression.node, callExpression.arguments);
14
- const { isError, componentProps } = this.typeValidator.validate(injectedComponent, callExpression.generics);
15
- if (isError)
16
- this.errorReporter.report(componentProps, callExpression.node);
14
+ const result = this.typeValidator.validate(injectedComponent, callExpression.generics);
15
+ this.errorReporter.report(result, callExpression.node);
17
16
  }
18
17
  }
19
18
  getInjectedComponent(node, args) {
@@ -1 +1 @@
1
- {"version":3,"file":"injectComponentHandler.js","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/injectComponentHandler.ts"],"names":[],"mappings":";;;AAEA,yCAAiD;AACjD,yCAAsC;AAKtC,MAAa,sBAAsB;IACjC,YAAoB,aAA4B,EAAU,aAA4B;QAAlE,kBAAa,GAAb,aAAa,CAAe;QAAU,kBAAa,GAAb,aAAa,CAAe;IAAI,CAAC;IAEpF,MAAM,CAAC,cAA8B;QAC1C,IAAI,cAAc,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE;YAClD,MAAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;YACnG,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,iBAAiB,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;YAC5G,IAAI,OAAO;gBAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;SAC7E;IACH,CAAC;IAEO,oBAAoB,CAAC,IAA6B,EAAE,IAAkB;QAC5E,OAAO,IAAI,WAAI,CAAC,IAAA,oBAAc,EAAC,IAAI,CAAC,CAAC;aAClC,SAAS;aACT,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;aAC9C,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;CACF;AAjBD,wDAiBC"}
1
+ {"version":3,"file":"injectComponentHandler.js","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/injectComponentHandler.ts"],"names":[],"mappings":";;;AAEA,yCAAiD;AACjD,yCAAsC;AAKtC,MAAa,sBAAsB;IACjC,YAAoB,aAA4B,EAAU,aAA4B;QAAlE,kBAAa,GAAb,aAAa,CAAe;QAAU,kBAAa,GAAb,aAAa,CAAe;IAAI,CAAC;IAEpF,MAAM,CAAC,cAA8B;QAC1C,IAAI,cAAc,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE;YAClD,MAAM,iBAAiB,GAAG,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;YACnG,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,iBAAiB,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;YACvF,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;SACxD;IACH,CAAC;IAEO,oBAAoB,CAAC,IAA6B,EAAE,IAAkB;QAC5E,OAAO,IAAI,WAAI,CAAC,IAAA,oBAAc,EAAC,IAAI,CAAC,CAAC;aAClC,SAAS;aACT,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;aAC9C,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;CACF;AAjBD,wDAiBC"}
@@ -0,0 +1,9 @@
1
+ import type { TSESTree } from '@typescript-eslint/types';
2
+ import type { Context } from '../../../dto/context';
3
+ import type { Result } from './result';
4
+ export declare class ErrorReporter {
5
+ private context;
6
+ constructor(context: Context);
7
+ report(result: Result, node: TSESTree.Node): void;
8
+ }
9
+ //# sourceMappingURL=errorReporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorReporter.d.ts","sourceRoot":"","sources":["../../../../src/rules/stronglyTypedInjectComponent/result/errorReporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,qBAAa,aAAa;IACZ,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,OAAO;IAE7B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI;CAWlD"}
@@ -5,10 +5,10 @@ class ErrorReporter {
5
5
  constructor(context) {
6
6
  this.context = context;
7
7
  }
8
- report(types, node) {
9
- if (types && node) {
8
+ report(result, node) {
9
+ if (result.isError) {
10
10
  this.context.reportError(node, 'strongly-typed-inject-component', {
11
- expectation: `injectedComponent<${types.toString()}>`,
11
+ message: result.getMessage(),
12
12
  });
13
13
  }
14
14
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorReporter.js","sourceRoot":"","sources":["../../../../src/rules/stronglyTypedInjectComponent/result/errorReporter.ts"],"names":[],"mappings":";;;AAIA,MAAa,aAAa;IACxB,YAAoB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAI,CAAC;IAElC,MAAM,CAAC,MAAc,EAAE,IAAmB;QAC/C,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,IAAI,CAAC,OAAO,CAAC,WAAW,CACtB,IAAI,EACJ,iCAAiC,EACjC;gBACE,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE;aAC7B,CACF,CAAC;SACH;IACH,CAAC;CACF;AAdD,sCAcC"}
@@ -0,0 +1,9 @@
1
+ import type { Type } from '../../../dto/types/type';
2
+ import type { Result } from './result';
3
+ export declare class MissingTypeError implements Result {
4
+ private readonly missingTypes;
5
+ readonly isError = true;
6
+ constructor(missingTypes: Type[]);
7
+ getMessage(): string;
8
+ }
9
+ //# sourceMappingURL=missingTypeError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"missingTypeError.d.ts","sourceRoot":"","sources":["../../../../src/rules/stronglyTypedInjectComponent/result/missingTypeError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,qBAAa,gBAAiB,YAAW,MAAM;IAGjC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAFzC,QAAQ,CAAC,OAAO,QAAQ;gBAEK,YAAY,EAAE,IAAI,EAAE;IAEjD,UAAU;CAGX"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MissingTypeError = void 0;
4
+ class MissingTypeError {
5
+ constructor(missingTypes) {
6
+ this.missingTypes = missingTypes;
7
+ this.isError = true;
8
+ }
9
+ getMessage() {
10
+ return `The call to injectComponent is missing prop types. It should be typed as: injectComponent<${this.missingTypes.map(t => t.toString()).join(', ')}> `;
11
+ }
12
+ }
13
+ exports.MissingTypeError = MissingTypeError;
14
+ //# sourceMappingURL=missingTypeError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"missingTypeError.js","sourceRoot":"","sources":["../../../../src/rules/stronglyTypedInjectComponent/result/missingTypeError.ts"],"names":[],"mappings":";;;AAGA,MAAa,gBAAgB;IAG3B,YAA6B,YAAoB;QAApB,iBAAY,GAAZ,YAAY,CAAQ;QAFxC,YAAO,GAAG,IAAI,CAAC;IAE6B,CAAC;IAEtD,UAAU;QACR,OAAO,6FAA6F,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IAC9J,CAAC;CACF;AARD,4CAQC"}
@@ -0,0 +1,9 @@
1
+ import type { Type } from '../../../dto/types/type';
2
+ import type { Result } from './result';
3
+ export declare class RedundantTypeError implements Result {
4
+ private readonly redundantType;
5
+ readonly isError = true;
6
+ constructor(redundantType: Type[]);
7
+ getMessage(): string;
8
+ }
9
+ //# sourceMappingURL=redundantTypeError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redundantTypeError.d.ts","sourceRoot":"","sources":["../../../../src/rules/stronglyTypedInjectComponent/result/redundantTypeError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,qBAAa,kBAAmB,YAAW,MAAM;IAGnC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,QAAQ,CAAC,OAAO,QAAQ;gBAEK,aAAa,EAAE,IAAI,EAAE;IAElD,UAAU;CAGX"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RedundantTypeError = void 0;
4
+ const array_1 = require("../../../utils/array");
5
+ class RedundantTypeError {
6
+ constructor(redundantType) {
7
+ this.redundantType = redundantType;
8
+ this.isError = true;
9
+ }
10
+ getMessage() {
11
+ return `injectComponent has one or more redundant types: ${(0, array_1.toString)(this.redundantType)}.`;
12
+ }
13
+ }
14
+ exports.RedundantTypeError = RedundantTypeError;
15
+ //# sourceMappingURL=redundantTypeError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redundantTypeError.js","sourceRoot":"","sources":["../../../../src/rules/stronglyTypedInjectComponent/result/redundantTypeError.ts"],"names":[],"mappings":";;;AACA,gDAAgD;AAGhD,MAAa,kBAAkB;IAG7B,YAA6B,aAAqB;QAArB,kBAAa,GAAb,aAAa,CAAQ;QAFzC,YAAO,GAAG,IAAI,CAAC;IAE8B,CAAC;IAEvD,UAAU;QACR,OAAO,oDAAoD,IAAA,gBAAQ,EAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC;IAC7F,CAAC;CACF;AARD,gDAQC"}
@@ -0,0 +1,5 @@
1
+ export interface Result {
2
+ readonly isError: boolean;
3
+ getMessage: () => string;
4
+ }
5
+ //# sourceMappingURL=result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../../src/rules/stronglyTypedInjectComponent/result/result.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,MAAM,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result.js","sourceRoot":"","sources":["../../../../src/rules/stronglyTypedInjectComponent/result/result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { Result } from './result';
2
+ export declare class Success implements Result {
3
+ readonly isError = false;
4
+ getMessage(): string;
5
+ }
6
+ //# sourceMappingURL=success.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"success.d.ts","sourceRoot":"","sources":["../../../../src/rules/stronglyTypedInjectComponent/result/success.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,qBAAa,OAAQ,YAAW,MAAM;IACpC,QAAQ,CAAC,OAAO,SAAS;IAEzB,UAAU,IAAI,MAAM;CAGrB"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Success = void 0;
4
+ class Success {
5
+ constructor() {
6
+ this.isError = false;
7
+ }
8
+ getMessage() {
9
+ throw new Error('Success should not have an error message');
10
+ }
11
+ }
12
+ exports.Success = Success;
13
+ //# sourceMappingURL=success.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"success.js","sourceRoot":"","sources":["../../../../src/rules/stronglyTypedInjectComponent/result/success.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;IAApB;QACW,YAAO,GAAG,KAAK,CAAC;IAK3B,CAAC;IAHC,UAAU;QACR,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;CACF;AAND,0BAMC"}
@@ -1,15 +1,16 @@
1
1
  import type { Generics } from '../../dto/generics';
2
2
  import type { Variable } from '../../dto/variable';
3
- import type { Type } from '../../dto/type';
3
+ import type { Options } from '.';
4
+ import type { Result } from './result/result';
4
5
  export declare class TypeValidator {
5
- validate(injectedComponent?: Variable, generics?: Generics): {
6
- isError: boolean;
7
- componentProps?: undefined;
8
- } | {
9
- isError: boolean;
10
- componentProps: Type;
11
- };
12
- private comparePropsAndTypes;
6
+ private options;
7
+ constructor(options: Options);
8
+ validate(injectedComponent?: Variable, generics?: Generics): Result;
9
+ private areTypesValid;
13
10
  private hasInlineType;
11
+ private typesAreEqual;
12
+ private isInjected;
13
+ private typesAreInCorrectOrder;
14
+ private get injectedPattern();
14
15
  }
15
16
  //# sourceMappingURL=typeValidator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeValidator.d.ts","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/typeValidator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,qBAAa,aAAa;IACjB,QAAQ,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,QAAQ;;;;;;;IAOjE,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,aAAa;CAGtB"}
1
+ {"version":3,"file":"typeValidator.d.ts","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/typeValidator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC;AAIjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAI9C,qBAAa,aAAa;IACZ,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,OAAO;IAE7B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM;IAO1E,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,sBAAsB;IAO9B,OAAO,KAAK,eAAe,GAE1B;CACF"}
@@ -3,24 +3,55 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TypeValidator = void 0;
4
4
  const lodash_1 = require("lodash");
5
5
  const functionalComponent_1 = require("../../dto/functionalComponent");
6
- const typeLiteral_1 = require("../../dto/typeLiteral");
7
- const array_1 = require("../../utils/array");
6
+ const regex_1 = require("../../utils/regex");
7
+ const typeLiteral_1 = require("../../dto/types/typeLiteral");
8
+ const redundantTypeError_1 = require("./result/redundantTypeError");
9
+ const success_1 = require("./result/success");
10
+ const missingTypeError_1 = require("./result/missingTypeError");
8
11
  class TypeValidator {
12
+ constructor(options) {
13
+ this.options = options;
14
+ }
9
15
  validate(injectedComponent, generics) {
10
16
  if (!injectedComponent)
11
- return { isError: false };
17
+ return new success_1.Success();
12
18
  const componentProps = new functionalComponent_1.FunctionalComponent(injectedComponent.arrowFunction).props.type;
13
19
  const injectComponentGenerics = (generics === null || generics === void 0 ? void 0 : generics.types) || [];
14
- return { isError: !this.comparePropsAndTypes(componentProps, injectComponentGenerics), componentProps };
20
+ return this.areTypesValid(componentProps, injectComponentGenerics);
15
21
  }
16
- comparePropsAndTypes(componentProps, injectComponentGenerics) {
17
- return (this.hasInlineType(injectComponentGenerics) ||
18
- componentProps.equals(injectComponentGenerics) ||
19
- (0, array_1.isEmpty)(injectComponentGenerics) && (0, lodash_1.isEqual)(componentProps.toString(), ['Injected']));
22
+ areTypesValid(componentProps, injectComponentGenerics) {
23
+ if (this.typesAreEqual(componentProps, injectComponentGenerics) && this.isInjected(componentProps)) {
24
+ return new redundantTypeError_1.RedundantTypeError(injectComponentGenerics);
25
+ }
26
+ if (this.hasInlineType(injectComponentGenerics) ||
27
+ (this.typesAreEqual(componentProps, injectComponentGenerics) && !this.isInjected(componentProps)) ||
28
+ ((0, lodash_1.isEmpty)(injectComponentGenerics) && this.isInjected(componentProps)) ||
29
+ this.typesAreInCorrectOrder(injectComponentGenerics, componentProps)) {
30
+ return new success_1.Success();
31
+ }
32
+ // TODO: Report the actual missing type
33
+ return new missingTypeError_1.MissingTypeError(injectComponentGenerics);
20
34
  }
21
35
  hasInlineType(injectComponentGenerics) {
22
36
  return injectComponentGenerics.some(typeLiteral_1.TypeLiteral.isTypeLiteral);
23
37
  }
38
+ typesAreEqual(componentProps, injectComponentGenerics) {
39
+ return componentProps.equals(injectComponentGenerics);
40
+ }
41
+ isInjected(componentProps) {
42
+ return componentProps.size() === 1 &&
43
+ !!componentProps.toString()[0].match((0, regex_1.stringToRegex)(this.injectedPattern));
44
+ }
45
+ typesAreInCorrectOrder(injectComponentGenerics, componentProps) {
46
+ var _a;
47
+ const isInjectSecond = !!((_a = injectComponentGenerics[1]) === null || _a === void 0 ? void 0 : _a.toString()[0].match((0, regex_1.stringToRegex)(this.injectedPattern)));
48
+ return isInjectSecond &&
49
+ componentProps.size() === injectComponentGenerics.length &&
50
+ componentProps.includes(injectComponentGenerics);
51
+ }
52
+ get injectedPattern() {
53
+ return this.options[0].injectedPropsPattern;
54
+ }
24
55
  }
25
56
  exports.TypeValidator = TypeValidator;
26
57
  //# sourceMappingURL=typeValidator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeValidator.js","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/typeValidator.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AACjC,uEAAoE;AAEpE,uDAAoD;AAEpD,6CAA4C;AAG5C,MAAa,aAAa;IACjB,QAAQ,CAAC,iBAA4B,EAAE,QAAmB;QAC/D,IAAI,CAAC,iBAAiB;YAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAClD,MAAM,cAAc,GAAG,IAAI,yCAAmB,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QAC3F,MAAM,uBAAuB,GAAG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,KAAI,EAAE,CAAC;QACtD,OAAO,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,cAAc,EAAE,uBAAuB,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1G,CAAC;IAEO,oBAAoB,CAAC,cAAoB,EAAE,uBAA+B;QAChF,OAAO,CACL,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAC;YAC3C,cAAc,CAAC,MAAM,CAAC,uBAAuB,CAAC;YAC9C,IAAA,eAAO,EAAC,uBAAuB,CAAC,IAAI,IAAA,gBAAO,EAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CACrF,CAAC;IACJ,CAAC;IAEO,aAAa,CAAC,uBAA+B;QACnD,OAAO,uBAAuB,CAAC,IAAI,CAAC,yBAAW,CAAC,aAAa,CAAC,CAAC;IACjE,CAAC;CACF;AAnBD,sCAmBC"}
1
+ {"version":3,"file":"typeValidator.js","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/typeValidator.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AACjC,uEAAoE;AAKpE,6CAAkD;AAClD,6DAA0D;AAC1D,oEAAiE;AAEjE,8CAA2C;AAC3C,gEAA6D;AAE7D,MAAa,aAAa;IACxB,YAAoB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAI,CAAC;IAElC,QAAQ,CAAC,iBAA4B,EAAE,QAAmB;QAC/D,IAAI,CAAC,iBAAiB;YAAE,OAAO,IAAI,iBAAO,EAAE,CAAC;QAC7C,MAAM,cAAc,GAAG,IAAI,yCAAmB,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QAC3F,MAAM,uBAAuB,GAAG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,KAAK,KAAI,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,uBAAuB,CAAC,CAAC;IACrE,CAAC;IAEO,aAAa,CAAC,cAAoB,EAAE,uBAA+B;QACzE,IAAK,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,uBAAuB,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE;YACnG,OAAO,IAAI,uCAAkB,CAAC,uBAAuB,CAAC,CAAC;SACxD;QAED,IACE,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAC;YAC3C,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;YACjG,CAAC,IAAA,gBAAO,EAAC,uBAAuB,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;YACrE,IAAI,CAAC,sBAAsB,CAAC,uBAAuB,EAAE,cAAc,CAAC,EACpE;YACA,OAAO,IAAI,iBAAO,EAAE,CAAC;SACtB;QAED,uCAAuC;QACvC,OAAO,IAAI,mCAAgB,CAAC,uBAAuB,CAAC,CAAC;IACvD,CAAC;IAEO,aAAa,CAAC,uBAA+B;QACnD,OAAO,uBAAuB,CAAC,IAAI,CAAC,yBAAW,CAAC,aAAa,CAAC,CAAC;IACjE,CAAC;IAEO,aAAa,CAAC,cAAoB,EAAE,uBAA+B;QACzE,OAAO,cAAc,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;IACxD,CAAC;IAEO,UAAU,CAAC,cAAoB;QACrC,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC;YAChC,CAAC,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAA,qBAAa,EAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9E,CAAC;IAEO,sBAAsB,CAAC,uBAA+B,EAAE,cAAoB;;QAClF,MAAM,cAAc,GAAG,CAAC,CAAC,CAAA,MAAA,uBAAuB,CAAC,CAAC,CAAC,0CAAE,QAAQ,GAAG,CAAC,EAAE,KAAK,CAAC,IAAA,qBAAa,EAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAA,CAAC;QAC9G,OAAO,cAAc;YACnB,cAAc,CAAC,IAAI,EAAE,KAAK,uBAAuB,CAAC,MAAM;YACxD,cAAc,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;IACrD,CAAC;IAED,IAAY,eAAe;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC;IAC9C,CAAC;CACF;AAnDD,sCAmDC"}
@@ -1,2 +1,3 @@
1
1
  export declare function isEmpty(array?: any[]): boolean;
2
+ export declare function toString(array?: any[]): string;
2
3
  //# sourceMappingURL=array.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,WAEpC"}
1
+ {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,WAEpC;AAED,wBAAgB,QAAQ,CAAC,KAAK,GAAE,GAAG,EAAO,UAEzC"}
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isEmpty = void 0;
3
+ exports.toString = exports.isEmpty = void 0;
4
4
  function isEmpty(array) {
5
5
  return array === undefined || array.length === 0;
6
6
  }
7
7
  exports.isEmpty = isEmpty;
8
+ function toString(array = []) {
9
+ return `[${array.map((a) => a.toString()).join(', ')}]`;
10
+ }
11
+ exports.toString = toString;
8
12
  //# sourceMappingURL=array.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"array.js","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,KAAa;IACjC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;AACrD,CAAC;AAFD,0BAEC"}
1
+ {"version":3,"file":"array.js","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,KAAa;IACjC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;AACrD,CAAC;AAFD,0BAEC;AAED,SAAgB,QAAQ,CAAC,QAAe,EAAE;IACtC,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAC5D,CAAC;AAFD,4BAEC"}
@@ -0,0 +1,2 @@
1
+ export declare function stringToRegex(str: string): RegExp;
2
+ //# sourceMappingURL=regex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/utils/regex.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,UAIxC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stringToRegex = void 0;
4
+ function stringToRegex(str) {
5
+ const main = str.match(/\/(.+)\/.*/)[1];
6
+ const options = str.match(/\/.+\/(.*)/)[1];
7
+ return new RegExp(main, options);
8
+ }
9
+ exports.stringToRegex = stringToRegex;
10
+ //# sourceMappingURL=regex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.js","sourceRoot":"","sources":["../../src/utils/regex.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAC,GAAW;IACvC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,YAAY,CAAE,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,YAAY,CAAE,CAAC,CAAC,CAAC,CAAC;IAC5C,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACnC,CAAC;AAJD,sCAIC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "eslint-plugin-obsidian",
3
3
  "description": "ESLint rules for Obsidian",
4
4
  "main": "dist/index.js",
5
- "version": "2.8.0",
5
+ "version": "2.9.0",
6
6
  "scripts": {
7
7
  "build": "npx tsc --project tsconfig.prod.json",
8
8
  "test": "npx jest",
@@ -1 +0,0 @@
1
- {"version":3,"file":"missingType.d.ts","sourceRoot":"","sources":["../../src/dto/missingType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,qBAAa,WAAY,YAAW,IAAI;IACtC,QAAQ,IAAI,MAAM,EAAE;IAIpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;CAG/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"missingType.js","sourceRoot":"","sources":["../../src/dto/missingType.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;IACtB,QAAQ;QACN,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACxE,CAAC;CACF;AAZD,kCAYC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"singleType.d.ts","sourceRoot":"","sources":["../../src/dto/singleType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC,qBAAa,UAAW,YAAW,IAAI;IACzB,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ,CAAC,UAAU;IAE9C,QAAQ,IAAI,MAAM,EAAE;IAKpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;CAG/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"singleType.js","sourceRoot":"","sources":["../../src/dto/singleType.ts"],"names":[],"mappings":";;;AAEA,6CAA0C;AAE1C,MAAa,UAAU;IACrB,YAAoB,KAA0B;QAA1B,UAAK,GAAL,KAAK,CAAqB;IAAG,CAAC;IAElD,QAAQ;;QACN,MAAM,OAAO,GAAG,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,0CAAE,cAA0C,CAAC;QACvF,OAAO,CAAC,IAAI,uBAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;IACvE,CAAC;CACF;AAfD,gCAeC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/dto/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,QAAQ,IAAI,MAAM,EAAE,CAAC;IACrB,OAAO,IAAI,OAAO,CAAC;IACnB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;CAChC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typeIntersection.d.ts","sourceRoot":"","sources":["../../src/dto/typeIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,qBAAa,gBAAiB,YAAW,IAAI;IAC/B,OAAO,CAAC,cAAc;gBAAd,cAAc,EAAE,QAAQ,CAAC,kBAAkB;IAE/D,QAAQ,IAAI,MAAM,EAAE;IAOpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;CAG/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typeIntersection.js","sourceRoot":"","sources":["../../src/dto/typeIntersection.ts"],"names":[],"mappings":";;;AACA,mCAAiC;AAEjC,6CAA0C;AAE1C,MAAa,gBAAgB;IAC3B,YAAoB,cAA2C;QAA3C,mBAAc,GAAd,cAAc,CAA6B;IAAI,CAAC;IAEpE,QAAQ;QACN,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,IAAgC,CAAC;YACjD,OAAO,IAAI,uBAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,IAAA,gBAAO,EAAC,IAAI,CAAC,QAAQ,EAAE,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF;AAjBD,4CAiBC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typeLiteral.d.ts","sourceRoot":"","sources":["../../src/dto/typeLiteral.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,qBAAa,WAAY,YAAW,IAAI;IACtC,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,WAAW;IAIrD,QAAQ,IAAI,MAAM,EAAE;IAIpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;CAG/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typeLiteral.js","sourceRoot":"","sources":["../../src/dto/typeLiteral.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;IACtB,MAAM,CAAC,aAAa,CAAC,IAAU;QAC7B,OAAO,IAAI,YAAY,WAAW,CAAC;IACrC,CAAC;IAED,QAAQ;QACN,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO;QACL,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;IACvE,CAAC;CACF;AAhBD,kCAgBC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typeReference.d.ts","sourceRoot":"","sources":["../../src/dto/typeReference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC,qBAAa,aAAc,YAAW,IAAI;IAC5B,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,QAAQ,CAAC,eAAe;IAElD,QAAQ,IAAI,MAAM,EAAE;IAIpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;CAG/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"typeReference.js","sourceRoot":"","sources":["../../src/dto/typeReference.ts"],"names":[],"mappings":";;;AACA,mCAAiC;AAEjC,6CAA0C;AAE1C,MAAa,aAAa;IACxB,YAAoB,IAA8B;QAA9B,SAAI,GAAJ,IAAI,CAA0B;IAAG,CAAC;IAEtD,QAAQ;QACN,OAAO,CAAC,IAAI,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,IAAA,gBAAO,EAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;CACF;AAdD,sCAcC"}
@@ -1,9 +0,0 @@
1
- import type { TSESTree } from '@typescript-eslint/types';
2
- import type { Context } from '../../dto/context';
3
- import type { Type } from '../../dto/type';
4
- export declare class ErrorReporter {
5
- private context;
6
- constructor(context: Context);
7
- report(types?: Type, node?: TSESTree.Node): void;
8
- }
9
- //# sourceMappingURL=errorReporter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errorReporter.d.ts","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/errorReporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,qBAAa,aAAa;IACZ,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,OAAO;IAE7B,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI;CAWjD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"errorReporter.js","sourceRoot":"","sources":["../../../src/rules/stronglyTypedInjectComponent/errorReporter.ts"],"names":[],"mappings":";;;AAIA,MAAa,aAAa;IACxB,YAAoB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAI,CAAC;IAElC,MAAM,CAAC,KAAY,EAAE,IAAoB;QAC9C,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,WAAW,CACtB,IAAI,EACJ,iCAAiC,EACjC;gBACE,WAAW,EAAE,qBAAqB,KAAK,CAAC,QAAQ,EAAE,GAAG;aACtD,CACF,CAAC;SACH;IACH,CAAC;CACF;AAdD,sCAcC"}
File without changes