@typescript-eslint/experimental-utils 5.9.2-alpha.2 → 5.9.2-alpha.21

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 (170) hide show
  1. package/README.md +9 -21
  2. package/dist/index.d.ts +1 -7
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +2 -24
  5. package/dist/index.js.map +1 -1
  6. package/package.json +3 -16
  7. package/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +0 -48
  8. package/dist/ast-utils/eslint-utils/PatternMatcher.d.ts.map +0 -1
  9. package/dist/ast-utils/eslint-utils/PatternMatcher.js +0 -32
  10. package/dist/ast-utils/eslint-utils/PatternMatcher.js.map +0 -1
  11. package/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +0 -76
  12. package/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts.map +0 -1
  13. package/dist/ast-utils/eslint-utils/ReferenceTracker.js +0 -36
  14. package/dist/ast-utils/eslint-utils/ReferenceTracker.js.map +0 -1
  15. package/dist/ast-utils/eslint-utils/astUtilities.d.ts +0 -76
  16. package/dist/ast-utils/eslint-utils/astUtilities.d.ts.map +0 -1
  17. package/dist/ast-utils/eslint-utils/astUtilities.js +0 -95
  18. package/dist/ast-utils/eslint-utils/astUtilities.js.map +0 -1
  19. package/dist/ast-utils/eslint-utils/index.d.ts +0 -6
  20. package/dist/ast-utils/eslint-utils/index.d.ts.map +0 -1
  21. package/dist/ast-utils/eslint-utils/index.js +0 -18
  22. package/dist/ast-utils/eslint-utils/index.js.map +0 -1
  23. package/dist/ast-utils/eslint-utils/predicates.d.ts +0 -32
  24. package/dist/ast-utils/eslint-utils/predicates.d.ts.map +0 -1
  25. package/dist/ast-utils/eslint-utils/predicates.js +0 -68
  26. package/dist/ast-utils/eslint-utils/predicates.js.map +0 -1
  27. package/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +0 -18
  28. package/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts.map +0 -1
  29. package/dist/ast-utils/eslint-utils/scopeAnalysis.js +0 -40
  30. package/dist/ast-utils/eslint-utils/scopeAnalysis.js.map +0 -1
  31. package/dist/ast-utils/helpers.d.ts +0 -18
  32. package/dist/ast-utils/helpers.d.ts.map +0 -1
  33. package/dist/ast-utils/helpers.js +0 -20
  34. package/dist/ast-utils/helpers.js.map +0 -1
  35. package/dist/ast-utils/index.d.ts +0 -4
  36. package/dist/ast-utils/index.d.ts.map +0 -1
  37. package/dist/ast-utils/index.js +0 -16
  38. package/dist/ast-utils/index.js.map +0 -1
  39. package/dist/ast-utils/misc.d.ts +0 -8
  40. package/dist/ast-utils/misc.d.ts.map +0 -1
  41. package/dist/ast-utils/misc.js +0 -13
  42. package/dist/ast-utils/misc.js.map +0 -1
  43. package/dist/ast-utils/predicates.d.ts +0 -180
  44. package/dist/ast-utils/predicates.d.ts.map +0 -1
  45. package/dist/ast-utils/predicates.js +0 -125
  46. package/dist/ast-utils/predicates.js.map +0 -1
  47. package/dist/eslint-utils/InferTypesFromRule.d.ts +0 -11
  48. package/dist/eslint-utils/InferTypesFromRule.d.ts.map +0 -1
  49. package/dist/eslint-utils/InferTypesFromRule.js +0 -3
  50. package/dist/eslint-utils/InferTypesFromRule.js.map +0 -1
  51. package/dist/eslint-utils/RuleCreator.d.ts +0 -35
  52. package/dist/eslint-utils/RuleCreator.d.ts.map +0 -1
  53. package/dist/eslint-utils/RuleCreator.js +0 -47
  54. package/dist/eslint-utils/RuleCreator.js.map +0 -1
  55. package/dist/eslint-utils/RuleTester.d.ts +0 -18
  56. package/dist/eslint-utils/RuleTester.d.ts.map +0 -1
  57. package/dist/eslint-utils/RuleTester.js +0 -127
  58. package/dist/eslint-utils/RuleTester.js.map +0 -1
  59. package/dist/eslint-utils/applyDefault.d.ts +0 -10
  60. package/dist/eslint-utils/applyDefault.d.ts.map +0 -1
  61. package/dist/eslint-utils/applyDefault.js +0 -32
  62. package/dist/eslint-utils/applyDefault.js.map +0 -1
  63. package/dist/eslint-utils/batchedSingleLineTests.d.ts +0 -24
  64. package/dist/eslint-utils/batchedSingleLineTests.d.ts.map +0 -1
  65. package/dist/eslint-utils/batchedSingleLineTests.js +0 -26
  66. package/dist/eslint-utils/batchedSingleLineTests.js.map +0 -1
  67. package/dist/eslint-utils/deepMerge.d.ts +0 -17
  68. package/dist/eslint-utils/deepMerge.d.ts.map +0 -1
  69. package/dist/eslint-utils/deepMerge.js +0 -48
  70. package/dist/eslint-utils/deepMerge.js.map +0 -1
  71. package/dist/eslint-utils/getParserServices.d.ts +0 -8
  72. package/dist/eslint-utils/getParserServices.d.ts.map +0 -1
  73. package/dist/eslint-utils/getParserServices.js +0 -28
  74. package/dist/eslint-utils/getParserServices.js.map +0 -1
  75. package/dist/eslint-utils/index.d.ts +0 -9
  76. package/dist/eslint-utils/index.d.ts.map +0 -1
  77. package/dist/eslint-utils/index.js +0 -21
  78. package/dist/eslint-utils/index.js.map +0 -1
  79. package/dist/eslint-utils/nullThrows.d.ts +0 -14
  80. package/dist/eslint-utils/nullThrows.d.ts.map +0 -1
  81. package/dist/eslint-utils/nullThrows.js +0 -28
  82. package/dist/eslint-utils/nullThrows.js.map +0 -1
  83. package/dist/json-schema.d.ts +0 -2
  84. package/dist/json-schema.d.ts.map +0 -1
  85. package/dist/json-schema.js +0 -6
  86. package/dist/json-schema.js.map +0 -1
  87. package/dist/ts-eslint/AST.d.ts +0 -9
  88. package/dist/ts-eslint/AST.d.ts.map +0 -1
  89. package/dist/ts-eslint/AST.js +0 -4
  90. package/dist/ts-eslint/AST.js.map +0 -1
  91. package/dist/ts-eslint/CLIEngine.d.ts +0 -137
  92. package/dist/ts-eslint/CLIEngine.d.ts.map +0 -1
  93. package/dist/ts-eslint/CLIEngine.js +0 -17
  94. package/dist/ts-eslint/CLIEngine.js.map +0 -1
  95. package/dist/ts-eslint/ESLint.d.ts +0 -338
  96. package/dist/ts-eslint/ESLint.d.ts.map +0 -1
  97. package/dist/ts-eslint/ESLint.js +0 -23
  98. package/dist/ts-eslint/ESLint.js.map +0 -1
  99. package/dist/ts-eslint/Linter.d.ts +0 -323
  100. package/dist/ts-eslint/Linter.d.ts.map +0 -1
  101. package/dist/ts-eslint/Linter.js +0 -14
  102. package/dist/ts-eslint/Linter.js.map +0 -1
  103. package/dist/ts-eslint/ParserOptions.d.ts +0 -2
  104. package/dist/ts-eslint/ParserOptions.d.ts.map +0 -1
  105. package/dist/ts-eslint/ParserOptions.js +0 -3
  106. package/dist/ts-eslint/ParserOptions.js.map +0 -1
  107. package/dist/ts-eslint/Rule.d.ts +0 -389
  108. package/dist/ts-eslint/Rule.d.ts.map +0 -1
  109. package/dist/ts-eslint/Rule.js +0 -3
  110. package/dist/ts-eslint/Rule.js.map +0 -1
  111. package/dist/ts-eslint/RuleTester.d.ts +0 -152
  112. package/dist/ts-eslint/RuleTester.d.ts.map +0 -1
  113. package/dist/ts-eslint/RuleTester.js +0 -8
  114. package/dist/ts-eslint/RuleTester.js.map +0 -1
  115. package/dist/ts-eslint/Scope.d.ts +0 -44
  116. package/dist/ts-eslint/Scope.d.ts.map +0 -1
  117. package/dist/ts-eslint/Scope.js +0 -31
  118. package/dist/ts-eslint/Scope.js.map +0 -1
  119. package/dist/ts-eslint/SourceCode.d.ts +0 -343
  120. package/dist/ts-eslint/SourceCode.d.ts.map +0 -1
  121. package/dist/ts-eslint/SourceCode.js +0 -9
  122. package/dist/ts-eslint/SourceCode.js.map +0 -1
  123. package/dist/ts-eslint/index.d.ts +0 -10
  124. package/dist/ts-eslint/index.d.ts.map +0 -1
  125. package/dist/ts-eslint/index.js +0 -22
  126. package/dist/ts-eslint/index.js.map +0 -1
  127. package/dist/ts-eslint-scope/Definition.d.ts +0 -19
  128. package/dist/ts-eslint-scope/Definition.d.ts.map +0 -1
  129. package/dist/ts-eslint-scope/Definition.js +0 -9
  130. package/dist/ts-eslint-scope/Definition.js.map +0 -1
  131. package/dist/ts-eslint-scope/Options.d.ts +0 -15
  132. package/dist/ts-eslint-scope/Options.d.ts.map +0 -1
  133. package/dist/ts-eslint-scope/Options.js +0 -3
  134. package/dist/ts-eslint-scope/Options.js.map +0 -1
  135. package/dist/ts-eslint-scope/PatternVisitor.d.ts +0 -25
  136. package/dist/ts-eslint-scope/PatternVisitor.d.ts.map +0 -1
  137. package/dist/ts-eslint-scope/PatternVisitor.js +0 -10
  138. package/dist/ts-eslint-scope/PatternVisitor.js.map +0 -1
  139. package/dist/ts-eslint-scope/Reference.d.ts +0 -28
  140. package/dist/ts-eslint-scope/Reference.d.ts.map +0 -1
  141. package/dist/ts-eslint-scope/Reference.js +0 -10
  142. package/dist/ts-eslint-scope/Reference.js.map +0 -1
  143. package/dist/ts-eslint-scope/Referencer.d.ts +0 -55
  144. package/dist/ts-eslint-scope/Referencer.d.ts.map +0 -1
  145. package/dist/ts-eslint-scope/Referencer.js +0 -11
  146. package/dist/ts-eslint-scope/Referencer.js.map +0 -1
  147. package/dist/ts-eslint-scope/Scope.d.ts +0 -103
  148. package/dist/ts-eslint-scope/Scope.d.ts.map +0 -1
  149. package/dist/ts-eslint-scope/Scope.js +0 -28
  150. package/dist/ts-eslint-scope/Scope.js.map +0 -1
  151. package/dist/ts-eslint-scope/ScopeManager.d.ts +0 -50
  152. package/dist/ts-eslint-scope/ScopeManager.d.ts.map +0 -1
  153. package/dist/ts-eslint-scope/ScopeManager.js +0 -10
  154. package/dist/ts-eslint-scope/ScopeManager.js.map +0 -1
  155. package/dist/ts-eslint-scope/Variable.d.ts +0 -17
  156. package/dist/ts-eslint-scope/Variable.d.ts.map +0 -1
  157. package/dist/ts-eslint-scope/Variable.js +0 -10
  158. package/dist/ts-eslint-scope/Variable.js.map +0 -1
  159. package/dist/ts-eslint-scope/analyze.d.ts +0 -16
  160. package/dist/ts-eslint-scope/analyze.d.ts.map +0 -1
  161. package/dist/ts-eslint-scope/analyze.js +0 -7
  162. package/dist/ts-eslint-scope/analyze.js.map +0 -1
  163. package/dist/ts-eslint-scope/index.d.ts +0 -11
  164. package/dist/ts-eslint-scope/index.d.ts.map +0 -1
  165. package/dist/ts-eslint-scope/index.js +0 -25
  166. package/dist/ts-eslint-scope/index.js.map +0 -1
  167. package/dist/ts-estree.d.ts +0 -3
  168. package/dist/ts-estree.d.ts.map +0 -1
  169. package/dist/ts-estree.js +0 -10
  170. package/dist/ts-estree.js.map +0 -1
@@ -1,35 +0,0 @@
1
- import { RuleMetaData, RuleMetaDataDocs, RuleListener, RuleContext, RuleModule } from '../ts-eslint/Rule';
2
- export declare type NamedCreateRuleMetaDocs = Omit<RuleMetaDataDocs, 'url'>;
3
- export declare type NamedCreateRuleMeta<TMessageIds extends string> = {
4
- docs: NamedCreateRuleMetaDocs;
5
- } & Omit<RuleMetaData<TMessageIds>, 'docs'>;
6
- export interface RuleCreateAndOptions<TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends RuleListener> {
7
- create: (context: Readonly<RuleContext<TMessageIds, TOptions>>, optionsWithDefault: Readonly<TOptions>) => TRuleListener;
8
- defaultOptions: Readonly<TOptions>;
9
- }
10
- export interface RuleWithMeta<TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends RuleListener> extends RuleCreateAndOptions<TOptions, TMessageIds, TRuleListener> {
11
- meta: RuleMetaData<TMessageIds>;
12
- }
13
- export interface RuleWithMetaAndName<TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends RuleListener> extends RuleCreateAndOptions<TOptions, TMessageIds, TRuleListener> {
14
- meta: NamedCreateRuleMeta<TMessageIds>;
15
- name: string;
16
- }
17
- /**
18
- * Creates reusable function to create rules with default options and docs URLs.
19
- *
20
- * @param urlCreator Creates a documentation URL for a given rule name.
21
- * @returns Function to create a rule with the docs URL format.
22
- */
23
- export declare function RuleCreator(urlCreator: (ruleName: string) => string): <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends RuleListener = RuleListener>({ name, meta, ...rule }: Readonly<RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => RuleModule<TMessageIds, TOptions, TRuleListener>;
24
- export declare namespace RuleCreator {
25
- var withoutDocs: typeof createRule;
26
- }
27
- /**
28
- * Creates a well-typed TSESLint custom ESLint rule without a docs URL.
29
- *
30
- * @returns Well-typed TSESLint custom ESLint rule.
31
- * @remarks It is generally better to provide a docs URL function to RuleCreator.
32
- */
33
- declare function createRule<TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends RuleListener = RuleListener>({ create, defaultOptions, meta, }: Readonly<RuleWithMeta<TOptions, TMessageIds, TRuleListener>>): RuleModule<TMessageIds, TOptions, TRuleListener>;
34
- export {};
35
- //# sourceMappingURL=RuleCreator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RuleCreator.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/RuleCreator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B,oBAAY,uBAAuB,GAAG,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;AACpE,oBAAY,mBAAmB,CAAC,WAAW,SAAS,MAAM,IAAI;IAC5D,IAAI,EAAE,uBAAuB,CAAC;CAC/B,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;AAE5C,MAAM,WAAW,oBAAoB,CACnC,QAAQ,SAAS,SAAS,OAAO,EAAE,EACnC,WAAW,SAAS,MAAM,EAC1B,aAAa,SAAS,YAAY;IAElC,MAAM,EAAE,CACN,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,EACrD,kBAAkB,EAAE,QAAQ,CAAC,QAAQ,CAAC,KACnC,aAAa,CAAC;IACnB,cAAc,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,YAAY,CAC3B,QAAQ,SAAS,SAAS,OAAO,EAAE,EACnC,WAAW,SAAS,MAAM,EAC1B,aAAa,SAAS,YAAY,CAClC,SAAQ,oBAAoB,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,CAAC;IAClE,IAAI,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB,CAClC,QAAQ,SAAS,SAAS,OAAO,EAAE,EACnC,WAAW,SAAS,MAAM,EAC1B,aAAa,SAAS,YAAY,CAClC,SAAQ,oBAAoB,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,CAAC;IAClE,IAAI,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,0QAyBnE;yBAzBe,WAAW;;;AA2B3B;;;;;GAKG;AACH,iBAAS,UAAU,CACjB,QAAQ,SAAS,SAAS,OAAO,EAAE,EACnC,WAAW,SAAS,MAAM,EAC1B,aAAa,SAAS,YAAY,GAAG,YAAY,EACjD,EACA,MAAM,EACN,cAAc,EACd,IAAI,GACL,EAAE,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,GAAG,UAAU,CAC1E,WAAW,EACX,QAAQ,EACR,aAAa,CACd,CAUA"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.RuleCreator = void 0;
15
- const applyDefault_1 = require("./applyDefault");
16
- /**
17
- * Creates reusable function to create rules with default options and docs URLs.
18
- *
19
- * @param urlCreator Creates a documentation URL for a given rule name.
20
- * @returns Function to create a rule with the docs URL format.
21
- */
22
- function RuleCreator(urlCreator) {
23
- // This function will get much easier to call when this is merged https://github.com/Microsoft/TypeScript/pull/26349
24
- // TODO - when the above PR lands; add type checking for the context.report `data` property
25
- return function createNamedRule(_a) {
26
- var { name, meta } = _a, rule = __rest(_a, ["name", "meta"]);
27
- return createRule(Object.assign({ meta: Object.assign(Object.assign({}, meta), { docs: Object.assign(Object.assign({}, meta.docs), { url: urlCreator(name) }) }) }, rule));
28
- };
29
- }
30
- exports.RuleCreator = RuleCreator;
31
- /**
32
- * Creates a well-typed TSESLint custom ESLint rule without a docs URL.
33
- *
34
- * @returns Well-typed TSESLint custom ESLint rule.
35
- * @remarks It is generally better to provide a docs URL function to RuleCreator.
36
- */
37
- function createRule({ create, defaultOptions, meta, }) {
38
- return {
39
- meta,
40
- create(context) {
41
- const optionsWithDefault = (0, applyDefault_1.applyDefault)(defaultOptions, context.options);
42
- return create(context, optionsWithDefault);
43
- },
44
- };
45
- }
46
- RuleCreator.withoutDocs = createRule;
47
- //# sourceMappingURL=RuleCreator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RuleCreator.js","sourceRoot":"","sources":["../../src/eslint-utils/RuleCreator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAOA,iDAA8C;AAqC9C;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,UAAwC;IAClE,oHAAoH;IACpH,2FAA2F;IAC3F,OAAO,SAAS,eAAe,CAI7B,EAMD;YANC,EACA,IAAI,EACJ,IAAI,OAIL,EAHI,IAAI,cAHP,gBAID,CADQ;QAIP,OAAO,UAAU,iBACf,IAAI,kCACC,IAAI,KACP,IAAI,kCACC,IAAI,CAAC,IAAI,KACZ,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,UAGtB,IAAI,EACP,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAzBD,kCAyBC;AAED;;;;;GAKG;AACH,SAAS,UAAU,CAIjB,EACA,MAAM,EACN,cAAc,EACd,IAAI,GACyD;IAK7D,OAAO;QACL,IAAI;QACJ,MAAM,CACJ,OAAqD;YAErD,MAAM,kBAAkB,GAAG,IAAA,2BAAY,EAAC,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACzE,OAAO,MAAM,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,WAAW,GAAG,UAAU,CAAC"}
@@ -1,18 +0,0 @@
1
- import * as TSESLint from '../ts-eslint';
2
- declare const parser = "@typescript-eslint/parser";
3
- declare type RuleTesterConfig = Omit<TSESLint.RuleTesterConfig, 'parser'> & {
4
- parser: typeof parser;
5
- };
6
- declare class RuleTester extends TSESLint.RuleTester {
7
- #private;
8
- constructor(options: RuleTesterConfig);
9
- private getFilename;
10
- run<TMessageIds extends string, TOptions extends Readonly<unknown[]>>(name: string, rule: TSESLint.RuleModule<TMessageIds, TOptions>, testsReadonly: TSESLint.RunTests<TMessageIds, TOptions>): void;
11
- }
12
- /**
13
- * Simple no-op tag to mark code samples as "should not format with prettier"
14
- * for the internal/plugin-test-formatting lint rule
15
- */
16
- declare function noFormat(strings: TemplateStringsArray, ...keys: string[]): string;
17
- export { noFormat, RuleTester };
18
- //# sourceMappingURL=RuleTester.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RuleTester.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/RuleTester.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AAEzC,QAAA,MAAM,MAAM,8BAA8B,CAAC;AAE3C,aAAK,gBAAgB,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAAG;IAClE,MAAM,EAAE,OAAO,MAAM,CAAC;CACvB,CAAC;AAEF,cAAM,UAAW,SAAQ,QAAQ,CAAC,UAAU;;gBAM9B,OAAO,EAAE,gBAAgB;IA0BrC,OAAO,CAAC,WAAW;IAuBnB,GAAG,CAAC,WAAW,SAAS,MAAM,EAAE,QAAQ,SAAS,QAAQ,CAAC,OAAO,EAAE,CAAC,EAClE,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,EAChD,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,GACtD,IAAI;CA4CR;AAED;;;GAGG;AACH,iBAAS,QAAQ,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAM1E;AAED,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC"}
@@ -1,127 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
22
- if (kind === "m") throw new TypeError("Private method is not writable");
23
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
24
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
25
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
26
- };
27
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
28
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
29
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
30
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
31
- };
32
- var _RuleTester_options;
33
- Object.defineProperty(exports, "__esModule", { value: true });
34
- exports.RuleTester = exports.noFormat = void 0;
35
- const path = __importStar(require("path"));
36
- const TSESLint = __importStar(require("../ts-eslint"));
37
- const parser = '@typescript-eslint/parser';
38
- class RuleTester extends TSESLint.RuleTester {
39
- // as of eslint 6 you have to provide an absolute path to the parser
40
- // but that's not as clean to type, this saves us trying to manually enforce
41
- // that contributors require.resolve everything
42
- constructor(options) {
43
- var _a, _b;
44
- super(Object.assign(Object.assign({}, options), { parserOptions: Object.assign(Object.assign({}, options.parserOptions), { warnOnUnsupportedTypeScriptVersion: (_b = (_a = options.parserOptions) === null || _a === void 0 ? void 0 : _a.warnOnUnsupportedTypeScriptVersion) !== null && _b !== void 0 ? _b : false }), parser: require.resolve(options.parser) }));
45
- _RuleTester_options.set(this, void 0);
46
- __classPrivateFieldSet(this, _RuleTester_options, options, "f");
47
- // make sure that the parser doesn't hold onto file handles between tests
48
- // on linux (i.e. our CI env), there can be very a limited number of watch handles available
49
- afterAll(() => {
50
- try {
51
- // instead of creating a hard dependency, just use a soft require
52
- // a bit weird, but if they're using this tooling, it'll be installed
53
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
54
- require(parser).clearCaches();
55
- }
56
- catch (_a) {
57
- // ignored
58
- }
59
- });
60
- }
61
- getFilename(options) {
62
- var _a;
63
- if (options) {
64
- const filename = `file.ts${((_a = options.ecmaFeatures) === null || _a === void 0 ? void 0 : _a.jsx) ? 'x' : ''}`;
65
- if (options.project) {
66
- return path.join(options.tsconfigRootDir != null
67
- ? options.tsconfigRootDir
68
- : process.cwd(), filename);
69
- }
70
- return filename;
71
- }
72
- else if (__classPrivateFieldGet(this, _RuleTester_options, "f").parserOptions) {
73
- return this.getFilename(__classPrivateFieldGet(this, _RuleTester_options, "f").parserOptions);
74
- }
75
- return 'file.ts';
76
- }
77
- // as of eslint 6 you have to provide an absolute path to the parser
78
- // If you don't do that at the test level, the test will fail somewhat cryptically...
79
- // This is a lot more explicit
80
- run(name, rule, testsReadonly) {
81
- const errorMessage = `Do not set the parser at the test level unless you want to use a parser other than ${parser}`;
82
- const tests = Object.assign({}, testsReadonly);
83
- // standardize the valid tests as objects
84
- tests.valid = tests.valid.map(test => {
85
- if (typeof test === 'string') {
86
- return {
87
- code: test,
88
- };
89
- }
90
- return test;
91
- });
92
- tests.valid = tests.valid.map(test => {
93
- if (typeof test !== 'string') {
94
- if (test.parser === parser) {
95
- throw new Error(errorMessage);
96
- }
97
- if (!test.filename) {
98
- return Object.assign(Object.assign({}, test), { filename: this.getFilename(test.parserOptions) });
99
- }
100
- }
101
- return test;
102
- });
103
- tests.invalid = tests.invalid.map(test => {
104
- if (test.parser === parser) {
105
- throw new Error(errorMessage);
106
- }
107
- if (!test.filename) {
108
- return Object.assign(Object.assign({}, test), { filename: this.getFilename(test.parserOptions) });
109
- }
110
- return test;
111
- });
112
- super.run(name, rule, tests);
113
- }
114
- }
115
- exports.RuleTester = RuleTester;
116
- _RuleTester_options = new WeakMap();
117
- /**
118
- * Simple no-op tag to mark code samples as "should not format with prettier"
119
- * for the internal/plugin-test-formatting lint rule
120
- */
121
- function noFormat(strings, ...keys) {
122
- const lastIndex = strings.length - 1;
123
- return (strings.slice(0, lastIndex).reduce((p, s, i) => p + s + keys[i], '') +
124
- strings[lastIndex]);
125
- }
126
- exports.noFormat = noFormat;
127
- //# sourceMappingURL=RuleTester.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RuleTester.js","sourceRoot":"","sources":["../../src/eslint-utils/RuleTester.ts"],"names":[],"mappings":"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"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Pure function - doesn't mutate either parameter!
3
- * Uses the default options and overrides with the options provided by the user
4
- * @param defaultOptions the defaults
5
- * @param userOptions the user opts
6
- * @returns the options with defaults
7
- */
8
- declare function applyDefault<TUser extends readonly unknown[], TDefault extends TUser>(defaultOptions: Readonly<TDefault>, userOptions: Readonly<TUser> | null): TDefault;
9
- export { applyDefault };
10
- //# sourceMappingURL=applyDefault.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"applyDefault.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/applyDefault.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,KAAK,SAAS,SAAS,OAAO,EAAE,EAAE,QAAQ,SAAS,KAAK,EAC5E,cAAc,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAClC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,GAClC,QAAQ,CAuBV;AAMD,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applyDefault = void 0;
4
- const deepMerge_1 = require("./deepMerge");
5
- /**
6
- * Pure function - doesn't mutate either parameter!
7
- * Uses the default options and overrides with the options provided by the user
8
- * @param defaultOptions the defaults
9
- * @param userOptions the user opts
10
- * @returns the options with defaults
11
- */
12
- function applyDefault(defaultOptions, userOptions) {
13
- // clone defaults
14
- const options = JSON.parse(JSON.stringify(defaultOptions));
15
- if (userOptions === null || userOptions === undefined) {
16
- return options;
17
- }
18
- options.forEach((opt, i) => {
19
- if (userOptions[i] !== undefined) {
20
- const userOpt = userOptions[i];
21
- if ((0, deepMerge_1.isObjectNotArray)(userOpt) && (0, deepMerge_1.isObjectNotArray)(opt)) {
22
- options[i] = (0, deepMerge_1.deepMerge)(opt, userOpt);
23
- }
24
- else {
25
- options[i] = userOpt;
26
- }
27
- }
28
- });
29
- return options;
30
- }
31
- exports.applyDefault = applyDefault;
32
- //# sourceMappingURL=applyDefault.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"applyDefault.js","sourceRoot":"","sources":["../../src/eslint-utils/applyDefault.ts"],"names":[],"mappings":";;;AAAA,2CAA0D;AAE1D;;;;;;GAMG;AACH,SAAS,YAAY,CACnB,cAAkC,EAClC,WAAmC;IAEnC,iBAAiB;IACjB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CACxB,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CACR,CAAC;IAEzB,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE;QACrD,OAAO,OAAO,CAAC;KAChB;IAED,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QACzB,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE;YAChC,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,IAAA,4BAAgB,EAAC,OAAO,CAAC,IAAI,IAAA,4BAAgB,EAAC,GAAG,CAAC,EAAE;gBACtD,OAAO,CAAC,CAAC,CAAC,GAAG,IAAA,qBAAS,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;aACtC;iBAAM;gBACL,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;aACtB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAMQ,oCAAY"}
@@ -1,24 +0,0 @@
1
- import { ValidTestCase, InvalidTestCase } from '../ts-eslint';
2
- /**
3
- * Converts a batch of single line tests into a number of separate test cases.
4
- * This makes it easier to write tests which use the same options.
5
- *
6
- * Why wouldn't you just leave them as one test?
7
- * Because it makes the test error messages harder to decipher.
8
- * This way each line will fail separately, instead of them all failing together.
9
- */
10
- declare function batchedSingleLineTests<TOptions extends Readonly<unknown[]>>(test: ValidTestCase<TOptions>): ValidTestCase<TOptions>[];
11
- /**
12
- * Converts a batch of single line tests into a number of separate test cases.
13
- * This makes it easier to write tests which use the same options.
14
- *
15
- * Why wouldn't you just leave them as one test?
16
- * Because it makes the test error messages harder to decipher.
17
- * This way each line will fail separately, instead of them all failing together.
18
- *
19
- * Make sure you have your line numbers correct for error reporting, as it will match
20
- * the line numbers up with the split tests!
21
- */
22
- declare function batchedSingleLineTests<TMessageIds extends string, TOptions extends Readonly<unknown[]>>(test: InvalidTestCase<TMessageIds, TOptions>): InvalidTestCase<TMessageIds, TOptions>[];
23
- export { batchedSingleLineTests };
24
- //# sourceMappingURL=batchedSingleLineTests.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"batchedSingleLineTests.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/batchedSingleLineTests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;GAOG;AACH,iBAAS,sBAAsB,CAAC,QAAQ,SAAS,QAAQ,CAAC,OAAO,EAAE,CAAC,EAClE,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,GAC5B,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC7B;;;;;;;;;;GAUG;AACH,iBAAS,sBAAsB,CAC7B,WAAW,SAAS,MAAM,EAC1B,QAAQ,SAAS,QAAQ,CAAC,OAAO,EAAE,CAAC,EAEpC,IAAI,EAAE,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC,GAC3C,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC;AAwC5C,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.batchedSingleLineTests = void 0;
4
- function batchedSingleLineTests(options) {
5
- // -- eslint counts lines from 1
6
- const lineOffset = options.code.startsWith('\n') ? 2 : 1;
7
- const output = 'output' in options && options.output
8
- ? options.output.trim().split('\n')
9
- : null;
10
- return options.code
11
- .trim()
12
- .split('\n')
13
- .map((code, i) => {
14
- const lineNum = i + lineOffset;
15
- const errors = 'errors' in options
16
- ? options.errors.filter(e => e.line === lineNum)
17
- : [];
18
- const returnVal = Object.assign(Object.assign({}, options), { code, errors: errors.map(e => (Object.assign(Object.assign({}, e), { line: 1 }))) });
19
- if (output === null || output === void 0 ? void 0 : output[i]) {
20
- return Object.assign(Object.assign({}, returnVal), { output: output[i] });
21
- }
22
- return returnVal;
23
- });
24
- }
25
- exports.batchedSingleLineTests = batchedSingleLineTests;
26
- //# sourceMappingURL=batchedSingleLineTests.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"batchedSingleLineTests.js","sourceRoot":"","sources":["../../src/eslint-utils/batchedSingleLineTests.ts"],"names":[],"mappings":";;;AA8BA,SAAS,sBAAsB,CAI7B,OAAyE;IAEzE,gCAAgC;IAChC,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,MAAM,MAAM,GACV,QAAQ,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM;QACnC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;QACnC,CAAC,CAAC,IAAI,CAAC;IACX,OAAO,OAAO,CAAC,IAAI;SAChB,IAAI,EAAE;SACN,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACf,MAAM,OAAO,GAAG,CAAC,GAAG,UAAU,CAAC;QAC/B,MAAM,MAAM,GACV,QAAQ,IAAI,OAAO;YACjB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC;YAChD,CAAC,CAAC,EAAE,CAAC;QACT,MAAM,SAAS,mCACV,OAAO,KACV,IAAI,EACJ,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,iCACnB,CAAC,KACJ,IAAI,EAAE,CAAC,IACP,CAAC,GACJ,CAAC;QACF,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,CAAC,CAAC,EAAE;YACf,uCACK,SAAS,KACZ,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,IACjB;SACH;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC;AAEQ,wDAAsB"}
@@ -1,17 +0,0 @@
1
- declare type ObjectLike<T = unknown> = Record<string, T>;
2
- /**
3
- * Check if the variable contains an object strictly rejecting arrays
4
- * @param obj an object
5
- * @returns `true` if obj is an object
6
- */
7
- declare function isObjectNotArray<T extends ObjectLike>(obj: unknown | unknown[]): obj is T;
8
- /**
9
- * Pure function - doesn't mutate either parameter!
10
- * Merges two objects together deeply, overwriting the properties in first with the properties in second
11
- * @param first The first object
12
- * @param second The second object
13
- * @returns a new object
14
- */
15
- export declare function deepMerge(first?: ObjectLike, second?: ObjectLike): Record<string, unknown>;
16
- export { isObjectNotArray };
17
- //# sourceMappingURL=deepMerge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":"AAAA,aAAK,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAEjD;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAC5C,GAAG,EAAE,OAAO,GAAG,OAAO,EAAE,GACvB,GAAG,IAAI,CAAC,CAEV;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,KAAK,GAAE,UAAe,EACtB,MAAM,GAAE,UAAe,GACtB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0BzB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isObjectNotArray = exports.deepMerge = void 0;
4
- /**
5
- * Check if the variable contains an object strictly rejecting arrays
6
- * @param obj an object
7
- * @returns `true` if obj is an object
8
- */
9
- function isObjectNotArray(obj) {
10
- return typeof obj === 'object' && !Array.isArray(obj);
11
- }
12
- exports.isObjectNotArray = isObjectNotArray;
13
- /**
14
- * Pure function - doesn't mutate either parameter!
15
- * Merges two objects together deeply, overwriting the properties in first with the properties in second
16
- * @param first The first object
17
- * @param second The second object
18
- * @returns a new object
19
- */
20
- function deepMerge(first = {}, second = {}) {
21
- // get the unique set of keys across both objects
22
- const keys = new Set(Object.keys(first).concat(Object.keys(second)));
23
- return Array.from(keys).reduce((acc, key) => {
24
- const firstHasKey = key in first;
25
- const secondHasKey = key in second;
26
- const firstValue = first[key];
27
- const secondValue = second[key];
28
- if (firstHasKey && secondHasKey) {
29
- if (isObjectNotArray(firstValue) && isObjectNotArray(secondValue)) {
30
- // object type
31
- acc[key] = deepMerge(firstValue, secondValue);
32
- }
33
- else {
34
- // value type
35
- acc[key] = secondValue;
36
- }
37
- }
38
- else if (firstHasKey) {
39
- acc[key] = firstValue;
40
- }
41
- else {
42
- acc[key] = secondValue;
43
- }
44
- return acc;
45
- }, {});
46
- }
47
- exports.deepMerge = deepMerge;
48
- //# sourceMappingURL=deepMerge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deepMerge.js","sourceRoot":"","sources":["../../src/eslint-utils/deepMerge.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,SAAS,gBAAgB,CACvB,GAAwB;IAExB,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC;AAwCQ,4CAAgB;AAtCzB;;;;;;GAMG;AACH,SAAgB,SAAS,CACvB,QAAoB,EAAE,EACtB,SAAqB,EAAE;IAEvB,iDAAiD;IACjD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAErE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAa,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACtD,MAAM,WAAW,GAAG,GAAG,IAAI,KAAK,CAAC;QACjC,MAAM,YAAY,GAAG,GAAG,IAAI,MAAM,CAAC;QACnC,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAEhC,IAAI,WAAW,IAAI,YAAY,EAAE;YAC/B,IAAI,gBAAgB,CAAC,UAAU,CAAC,IAAI,gBAAgB,CAAC,WAAW,CAAC,EAAE;gBACjE,cAAc;gBACd,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;aAC/C;iBAAM;gBACL,aAAa;gBACb,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;aACxB;SACF;aAAM,IAAI,WAAW,EAAE;YACtB,GAAG,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;SACvB;aAAM;YACL,GAAG,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;SACxB;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AA7BD,8BA6BC"}
@@ -1,8 +0,0 @@
1
- import * as TSESLint from '../ts-eslint';
2
- import { ParserServices } from '../ts-estree';
3
- /**
4
- * Try to retrieve typescript parser service from context
5
- */
6
- declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, allowWithoutFullTypeInformation?: boolean): ParserServices;
7
- export { getParserServices };
8
- //# sourceMappingURL=getParserServices.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getParserServices.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/getParserServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK9C;;GAEG;AACH,iBAAS,iBAAiB,CACxB,WAAW,SAAS,MAAM,EAC1B,QAAQ,SAAS,SAAS,OAAO,EAAE,EAEnC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,EAC9D,+BAA+B,UAAQ,GACtC,cAAc,CAuBhB;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getParserServices = void 0;
4
- const ERROR_MESSAGE = 'You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.';
5
- /**
6
- * Try to retrieve typescript parser service from context
7
- */
8
- function getParserServices(context, allowWithoutFullTypeInformation = false) {
9
- var _a;
10
- // backwards compatibility check
11
- // old versions of the parser would not return any parserServices unless parserOptions.project was set
12
- if (!context.parserServices ||
13
- !context.parserServices.program ||
14
- !context.parserServices.esTreeNodeToTSNodeMap ||
15
- !context.parserServices.tsNodeToESTreeNodeMap) {
16
- throw new Error(ERROR_MESSAGE);
17
- }
18
- const hasFullTypeInformation = (_a = context.parserServices.hasFullTypeInformation) !== null && _a !== void 0 ? _a :
19
- /* backwards compatible */ true;
20
- // if a rule requires full type information, then hard fail if it doesn't exist
21
- // this forces the user to supply parserOptions.project
22
- if (!hasFullTypeInformation && !allowWithoutFullTypeInformation) {
23
- throw new Error(ERROR_MESSAGE);
24
- }
25
- return context.parserServices;
26
- }
27
- exports.getParserServices = getParserServices;
28
- //# sourceMappingURL=getParserServices.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getParserServices.js","sourceRoot":"","sources":["../../src/eslint-utils/getParserServices.ts"],"names":[],"mappings":";;;AAGA,MAAM,aAAa,GACjB,gLAAgL,CAAC;AAEnL;;GAEG;AACH,SAAS,iBAAiB,CAIxB,OAA8D,EAC9D,+BAA+B,GAAG,KAAK;;IAEvC,gCAAgC;IAChC,sGAAsG;IACtG,IACE,CAAC,OAAO,CAAC,cAAc;QACvB,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO;QAC/B,CAAC,OAAO,CAAC,cAAc,CAAC,qBAAqB;QAC7C,CAAC,OAAO,CAAC,cAAc,CAAC,qBAAqB,EAC7C;QACA,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;KAChC;IAED,MAAM,sBAAsB,GAC1B,MAAA,OAAO,CAAC,cAAc,CAAC,sBAAsB;IAC7C,0BAA0B,CAAC,IAAI,CAAC;IAElC,+EAA+E;IAC/E,uDAAuD;IACvD,IAAI,CAAC,sBAAsB,IAAI,CAAC,+BAA+B,EAAE;QAC/D,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;KAChC;IAED,OAAO,OAAO,CAAC,cAAc,CAAC;AAChC,CAAC;AAEQ,8CAAiB"}
@@ -1,9 +0,0 @@
1
- export * from './applyDefault';
2
- export * from './batchedSingleLineTests';
3
- export * from './getParserServices';
4
- export * from './InferTypesFromRule';
5
- export * from './RuleCreator';
6
- export * from './RuleTester';
7
- export * from './deepMerge';
8
- export * from './nullThrows';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./applyDefault"), exports);
14
- __exportStar(require("./batchedSingleLineTests"), exports);
15
- __exportStar(require("./getParserServices"), exports);
16
- __exportStar(require("./InferTypesFromRule"), exports);
17
- __exportStar(require("./RuleCreator"), exports);
18
- __exportStar(require("./RuleTester"), exports);
19
- __exportStar(require("./deepMerge"), exports);
20
- __exportStar(require("./nullThrows"), exports);
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eslint-utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,2DAAyC;AACzC,sDAAoC;AACpC,uDAAqC;AACrC,gDAA8B;AAC9B,+CAA6B;AAC7B,8CAA4B;AAC5B,+CAA6B"}
@@ -1,14 +0,0 @@
1
- /**
2
- * A set of common reasons for calling nullThrows
3
- */
4
- declare const NullThrowsReasons: {
5
- readonly MissingParent: "Expected node to have a parent.";
6
- readonly MissingToken: (token: string, thing: string) => string;
7
- };
8
- /**
9
- * Assert that a value must not be null or undefined.
10
- * This is a nice explicit alternative to the non-null assertion operator.
11
- */
12
- declare function nullThrows<T>(value: T | null | undefined, message: string): T;
13
- export { nullThrows, NullThrowsReasons };
14
- //# sourceMappingURL=nullThrows.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nullThrows.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/nullThrows.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,QAAA,MAAM,iBAAiB;;mCAEC,MAAM,SAAS,MAAM;CAEnC,CAAC;AAEX;;;GAGG;AACH,iBAAS,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAYtE;AAED,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NullThrowsReasons = exports.nullThrows = void 0;
4
- /**
5
- * A set of common reasons for calling nullThrows
6
- */
7
- const NullThrowsReasons = {
8
- MissingParent: 'Expected node to have a parent.',
9
- MissingToken: (token, thing) => `Expected to find a ${token} for the ${thing}.`,
10
- };
11
- exports.NullThrowsReasons = NullThrowsReasons;
12
- /**
13
- * Assert that a value must not be null or undefined.
14
- * This is a nice explicit alternative to the non-null assertion operator.
15
- */
16
- function nullThrows(value, message) {
17
- // this function is primarily used to keep types happy in a safe way
18
- // i.e. is used when we expect that a value is never nullish
19
- // this means that it's pretty much impossible to test the below if...
20
- // so ignore it in coverage metrics.
21
- /* istanbul ignore if */
22
- if (value === null || value === undefined) {
23
- throw new Error(`Non-null Assertion Failed: ${message}`);
24
- }
25
- return value;
26
- }
27
- exports.nullThrows = nullThrows;
28
- //# sourceMappingURL=nullThrows.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nullThrows.js","sourceRoot":"","sources":["../../src/eslint-utils/nullThrows.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAM,iBAAiB,GAAG;IACxB,aAAa,EAAE,iCAAiC;IAChD,YAAY,EAAE,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE,CAC7C,sBAAsB,KAAK,YAAY,KAAK,GAAG;CACzC,CAAC;AAoBU,8CAAiB;AAlBtC;;;GAGG;AACH,SAAS,UAAU,CAAI,KAA2B,EAAE,OAAe;IACjE,oEAAoE;IACpE,4DAA4D;IAC5D,sEAAsE;IAEtE,oCAAoC;IACpC,wBAAwB;IACxB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,EAAE,CAAC,CAAC;KAC1D;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAEQ,gCAAU"}
@@ -1,2 +0,0 @@
1
- export { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName, JSONSchema4Version, JSONSchema6, JSONSchema6Definition, JSONSchema6Type, JSONSchema6TypeName, JSONSchema6Version, JSONSchema7, JSONSchema7Array, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName, JSONSchema7Version, ValidationError, ValidationResult, } from 'json-schema';
2
- //# sourceMappingURL=json-schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"json-schema.d.ts","sourceRoot":"","sources":["../src/json-schema.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- // Note - @types/json-schema@7.0.4 added some function declarations to the type package
3
- // If we do export *, then it will also export these function declarations.
4
- // This will cause typescript to not scrub the require from the build, breaking anyone who doesn't have it as a dependency
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- //# sourceMappingURL=json-schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../src/json-schema.ts"],"names":[],"mappings":";AAAA,uFAAuF;AACvF,2EAA2E;AAC3E,0HAA0H"}
@@ -1,9 +0,0 @@
1
- import { TSESTree, AST_TOKEN_TYPES } from '../ts-estree';
2
- declare namespace AST {
3
- type TokenType = AST_TOKEN_TYPES;
4
- type Token = TSESTree.Token;
5
- type SourceLocation = TSESTree.SourceLocation;
6
- type Range = TSESTree.Range;
7
- }
8
- export { AST };
9
- //# sourceMappingURL=AST.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AST.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/AST.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEzD,kBAAU,GAAG,CAAC;IACZ,KAAY,SAAS,GAAG,eAAe,CAAC;IAExC,KAAY,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEnC,KAAY,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;IAErD,KAAY,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;CACpC;AAED,OAAO,EAAE,GAAG,EAAE,CAAC"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/no-namespace */
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- //# sourceMappingURL=AST.js.map