eslint-plugin-rxjs-x 0.8.5 → 0.9.1

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.
package/dist/index.mjs CHANGED
@@ -1,14 +1,21 @@
1
1
  // package.json
2
2
  var name = "eslint-plugin-rxjs-x";
3
- var version = "0.8.5";
3
+ var version = "0.9.1";
4
4
 
5
5
  // src/configs/recommended.ts
6
6
  var createRecommendedConfig = (plugin2) => ({
7
+ ...baseConfig,
7
8
  name: "rxjs-x/recommended",
8
9
  plugins: {
9
10
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- "A type annotation is necessary."
10
11
  "rxjs-x": plugin2
11
- },
12
+ }
13
+ });
14
+ var createLegacyRecommendedConfig = () => ({
15
+ ...baseConfig,
16
+ plugins: ["rxjs-x"]
17
+ });
18
+ var baseConfig = {
12
19
  rules: {
13
20
  "rxjs-x/no-async-subscribe": "error",
14
21
  "rxjs-x/no-create": "error",
@@ -31,7 +38,7 @@ var createRecommendedConfig = (plugin2) => ({
31
38
  "rxjs-x/prefer-root-operators": "error",
32
39
  "rxjs-x/throw-error": "error"
33
40
  }
34
- });
41
+ };
35
42
 
36
43
  // src/configs/strict.ts
37
44
  var createStrictConfig = (plugin2) => ({
@@ -215,7 +222,7 @@ function getLoc(node) {
215
222
 
216
223
  // src/etc/get-type-services.ts
217
224
  import { ESLintUtils } from "@typescript-eslint/utils";
218
- import ts4 from "typescript";
225
+ import * as tsutils2 from "ts-api-utils";
219
226
 
220
227
  // src/etc/is.ts
221
228
  import { AST_NODE_TYPES } from "@typescript-eslint/utils";
@@ -291,17 +298,26 @@ function isPropertyDefinition(node) {
291
298
  function isSpreadElement(node) {
292
299
  return node.type === AST_NODE_TYPES.SpreadElement;
293
300
  }
301
+ function isTSAsExpression(node) {
302
+ return node.type === AST_NODE_TYPES.TSAsExpression;
303
+ }
304
+ function isTSSatisfiesExpression(node) {
305
+ return node.type === AST_NODE_TYPES.TSSatisfiesExpression;
306
+ }
294
307
  function isUnaryExpression(node) {
295
308
  return node.type === AST_NODE_TYPES.UnaryExpression;
296
309
  }
297
310
  function isUnionType(node) {
298
311
  return node.type === AST_NODE_TYPES.TSUnionType;
299
312
  }
313
+ function isVariableDeclarator(node) {
314
+ return node.type === AST_NODE_TYPES.VariableDeclarator;
315
+ }
300
316
 
301
317
  // src/etc/get-type-services.ts
302
318
  function getTypeServices(context) {
303
319
  const services = ESLintUtils.getParserServices(context);
304
- const { esTreeNodeToTSNodeMap, program, getTypeAtLocation } = services;
320
+ const { program, getTypeAtLocation } = services;
305
321
  const typeChecker = program.getTypeChecker();
306
322
  const couldBeType2 = (node, name2, qualified) => {
307
323
  const type = getTypeAtLocation(node);
@@ -312,30 +328,18 @@ function getTypeServices(context) {
312
328
  );
313
329
  };
314
330
  const couldReturnType = (node, name2, qualified) => {
315
- let tsTypeNode;
316
- const tsNode = esTreeNodeToTSNodeMap.get(node);
317
- if (ts4.isArrowFunction(tsNode) || ts4.isFunctionDeclaration(tsNode) || ts4.isMethodDeclaration(tsNode) || ts4.isFunctionExpression(tsNode)) {
318
- if (tsNode.type) {
319
- tsTypeNode = tsNode.type;
320
- } else if (tsNode.body && ts4.isBlock(tsNode.body)) {
321
- const returnStatement = tsNode.body.statements.find(ts4.isReturnStatement);
322
- if (returnStatement == null ? void 0 : returnStatement.expression) {
323
- tsTypeNode = returnStatement.expression;
324
- }
325
- } else {
326
- tsTypeNode = tsNode.body;
327
- }
328
- } else if (ts4.isCallSignatureDeclaration(tsNode) || ts4.isMethodSignature(tsNode)) {
329
- tsTypeNode = tsNode.type;
330
- } else if (ts4.isPropertySignature(tsNode)) {
331
- }
332
- return Boolean(
333
- tsTypeNode && couldBeType(
334
- typeChecker.getTypeAtLocation(tsTypeNode),
331
+ const type = getTypeAtLocation(node);
332
+ for (const signature of tsutils2.getCallSignaturesOfType(type)) {
333
+ const returnType = signature.getReturnType();
334
+ if (couldBeType(
335
+ returnType,
335
336
  name2,
336
337
  qualified ? { ...qualified, typeChecker } : void 0
337
- )
338
- );
338
+ )) {
339
+ return true;
340
+ }
341
+ }
342
+ return false;
339
343
  };
340
344
  return {
341
345
  couldBeBehaviorSubject: (node) => couldBeType2(node, "BehaviorSubject"),
@@ -586,8 +590,9 @@ var banOperatorsRule = ruleCreator({
586
590
  });
587
591
 
588
592
  // src/rules/finnish.ts
589
- import { AST_NODE_TYPES as AST_NODE_TYPES4, ESLintUtils as ESLintUtils3 } from "@typescript-eslint/utils";
593
+ import { ESLintUtils as ESLintUtils3 } from "@typescript-eslint/utils";
590
594
  var defaultOptions3 = [];
595
+ var baseShouldBeFinnish = "Finnish notation should be used here.";
591
596
  var finnishRule = ruleCreator({
592
597
  defaultOptions: defaultOptions3,
593
598
  meta: {
@@ -596,7 +601,8 @@ var finnishRule = ruleCreator({
596
601
  requiresTypeChecking: true
597
602
  },
598
603
  messages: {
599
- shouldBeFinnish: "Finnish notation should be used here.",
604
+ shouldBeFinnish: baseShouldBeFinnish,
605
+ shouldBeFinnishProperty: `${baseShouldBeFinnish} Add a type annotation, assertion, or 'satisfies' to silence this rule.`,
600
606
  shouldNotBeFinnish: "Finnish notation should not be used here."
601
607
  },
602
608
  schema: [
@@ -606,7 +612,8 @@ var finnishRule = ruleCreator({
606
612
  methods: { type: "boolean", description: "Require for methods." },
607
613
  names: { type: "object", description: "Enforce for specific names. Keys are a RegExp, values are a boolean." },
608
614
  parameters: { type: "boolean", description: "Require for parameters." },
609
- properties: { type: "boolean", description: "Require for properties." },
615
+ properties: { type: "boolean", description: 'Require for properties, except object literal keys (see "objects" option).' },
616
+ objects: { type: "boolean", description: "Require for object literal keys." },
610
617
  strict: { type: "boolean", description: "Disallow Finnish notation for non-Observables." },
611
618
  types: { type: "object", description: "Enforce for specific types. Keys are a RegExp, values are a boolean." },
612
619
  variables: { type: "boolean", description: "Require for variables." }
@@ -632,6 +639,7 @@ var finnishRule = ruleCreator({
632
639
  methods: true,
633
640
  parameters: true,
634
641
  properties: true,
642
+ objects: true,
635
643
  variables: true,
636
644
  ...config
637
645
  };
@@ -661,7 +669,7 @@ var finnishRule = ruleCreator({
661
669
  validate: false
662
670
  });
663
671
  }
664
- function checkNode(nameNode, typeNode) {
672
+ function checkNode(nameNode, typeNode, shouldMessage = "shouldBeFinnish") {
665
673
  const tsNode = esTreeNodeToTSNodeMap.get(nameNode);
666
674
  const text = tsNode.getText();
667
675
  const hasFinnish = text.endsWith("$");
@@ -672,7 +680,7 @@ var finnishRule = ruleCreator({
672
680
  } : () => {
673
681
  context.report({
674
682
  loc: getLoc(tsNode),
675
- messageId: "shouldBeFinnish"
683
+ messageId: shouldMessage
676
684
  });
677
685
  };
678
686
  const shouldNotBeFinnish = hasFinnish ? () => {
@@ -682,21 +690,30 @@ var finnishRule = ruleCreator({
682
690
  });
683
691
  } : () => {
684
692
  };
685
- if (couldBeObservable(typeNode != null ? typeNode : nameNode) || couldReturnObservable(typeNode != null ? typeNode : nameNode)) {
686
- for (const name2 of names) {
687
- const { regExp, validate: validate2 } = name2;
688
- if (regExp.test(text) && !validate2) {
693
+ const nameWithoutDollar = text.endsWith("$") ? text.slice(0, -1) : text;
694
+ for (const name2 of names) {
695
+ const { regExp, validate: validate2 } = name2;
696
+ if (regExp.test(text) || regExp.test(nameWithoutDollar)) {
697
+ if (validate2) {
698
+ shouldBeFinnish();
699
+ } else {
689
700
  shouldNotBeFinnish();
690
- return;
691
701
  }
702
+ return;
692
703
  }
693
- for (const type of types) {
694
- const { regExp, validate: validate2 } = type;
695
- if ((couldBeType2(typeNode != null ? typeNode : nameNode, regExp) || couldReturnType(typeNode != null ? typeNode : nameNode, regExp)) && !validate2) {
704
+ }
705
+ for (const type of types) {
706
+ const { regExp, validate: validate2 } = type;
707
+ if (couldBeType2(typeNode != null ? typeNode : nameNode, regExp) || couldReturnType(typeNode != null ? typeNode : nameNode, regExp)) {
708
+ if (validate2) {
709
+ shouldBeFinnish();
710
+ } else {
696
711
  shouldNotBeFinnish();
697
- return;
698
712
  }
713
+ return;
699
714
  }
715
+ }
716
+ if (couldBeObservable(typeNode != null ? typeNode : nameNode) || couldReturnObservable(typeNode != null ? typeNode : nameNode)) {
700
717
  shouldBeFinnish();
701
718
  } else {
702
719
  shouldNotBeFinnish();
@@ -714,7 +731,7 @@ var finnishRule = ruleCreator({
714
731
  if (!found) {
715
732
  return;
716
733
  }
717
- if (!validate.variables && found.type === AST_NODE_TYPES4.VariableDeclarator) {
734
+ if (!validate.variables && isVariableDeclarator(found)) {
718
735
  return;
719
736
  }
720
737
  if (!validate.parameters) {
@@ -775,12 +792,29 @@ var finnishRule = ruleCreator({
775
792
  }
776
793
  },
777
794
  "ObjectExpression > Property[computed=false] > Identifier": (node) => {
778
- if (validate.properties) {
779
- const parent = node.parent;
780
- if (node === parent.key && !isSourcesObjectAcceptingStaticObservableCreator(parent.parent.parent)) {
781
- checkNode(node);
795
+ if (!validate.objects) {
796
+ return;
797
+ }
798
+ const found = findParent(
799
+ node,
800
+ "CallExpression",
801
+ "VariableDeclarator",
802
+ "TSSatisfiesExpression",
803
+ "TSAsExpression"
804
+ );
805
+ if (found) {
806
+ if (isCallExpression(found)) {
807
+ return;
808
+ } else if (isVariableDeclarator(found) && !!found.id.typeAnnotation) {
809
+ return;
810
+ } else if (isTSAsExpression(found) || isTSSatisfiesExpression(found)) {
811
+ return;
782
812
  }
783
813
  }
814
+ const parent = node.parent;
815
+ if (node === parent.key) {
816
+ checkNode(node, void 0, "shouldBeFinnishProperty");
817
+ }
784
818
  },
785
819
  "ObjectPattern > Property > Identifier": (node) => {
786
820
  const found = findParent(
@@ -793,7 +827,7 @@ var finnishRule = ruleCreator({
793
827
  if (!found) {
794
828
  return;
795
829
  }
796
- if (!validate.variables && found.type === AST_NODE_TYPES4.VariableDeclarator) {
830
+ if (!validate.variables && isVariableDeclarator(found)) {
797
831
  return;
798
832
  }
799
833
  if (!validate.parameters) {
@@ -1099,7 +1133,7 @@ var noCreateRule = ruleCreator({
1099
1133
  // src/rules/no-cyclic-action.ts
1100
1134
  import { ESLintUtils as ESLintUtils4 } from "@typescript-eslint/utils";
1101
1135
  import { stripIndent as stripIndent3 } from "common-tags";
1102
- import ts5 from "typescript";
1136
+ import ts4 from "typescript";
1103
1137
  function isTypeReference2(type) {
1104
1138
  return Boolean(type.target);
1105
1139
  }
@@ -1144,7 +1178,7 @@ var noCyclicActionRule = ruleCreator({
1144
1178
  const operatorType = getTypeAtLocation(operatorCallExpression);
1145
1179
  const [signature] = typeChecker.getSignaturesOfType(
1146
1180
  operatorType,
1147
- ts5.SignatureKind.Call
1181
+ ts4.SignatureKind.Call
1148
1182
  );
1149
1183
  if (!signature) {
1150
1184
  return;
@@ -1204,7 +1238,7 @@ var noCyclicActionRule = ruleCreator({
1204
1238
 
1205
1239
  // src/rules/no-explicit-generics.ts
1206
1240
  import { ESLintUtils as ESLintUtils5 } from "@typescript-eslint/utils";
1207
- import * as tsutils2 from "ts-api-utils";
1241
+ import * as tsutils3 from "ts-api-utils";
1208
1242
  var noExplicitGenericsRule = ruleCreator({
1209
1243
  defaultOptions: [],
1210
1244
  meta: {
@@ -1235,7 +1269,7 @@ var noExplicitGenericsRule = ruleCreator({
1235
1269
  }
1236
1270
  const { getTypeAtLocation } = ESLintUtils5.getParserServices(context);
1237
1271
  const type = getTypeAtLocation(node);
1238
- return tsutils2.isUnionOrIntersectionType(type);
1272
+ return tsutils3.isUnionOrIntersectionType(type);
1239
1273
  }
1240
1274
  function checkBehaviorSubjects(node) {
1241
1275
  var _a;
@@ -1793,6 +1827,37 @@ var noIgnoredNotifierRule = ruleCreator({
1793
1827
  }
1794
1828
  });
1795
1829
 
1830
+ // src/rules/no-ignored-observable.ts
1831
+ var noIgnoredObservableRule = ruleCreator({
1832
+ defaultOptions: [],
1833
+ meta: {
1834
+ deprecated: true,
1835
+ docs: {
1836
+ description: "Disallow ignoring of observables returned by functions."
1837
+ },
1838
+ messages: {
1839
+ forbidden: "Ignoring a returned Observable is forbidden."
1840
+ },
1841
+ replacedBy: ["no-floating-observables"],
1842
+ schema: [],
1843
+ type: "problem"
1844
+ },
1845
+ name: "no-ignored-observable",
1846
+ create: (context) => {
1847
+ const { couldBeObservable } = getTypeServices(context);
1848
+ return {
1849
+ "ExpressionStatement > CallExpression": (node) => {
1850
+ if (couldBeObservable(node)) {
1851
+ context.report({
1852
+ messageId: "forbidden",
1853
+ node
1854
+ });
1855
+ }
1856
+ }
1857
+ };
1858
+ }
1859
+ });
1860
+
1796
1861
  // src/rules/no-ignored-replay-buffer.ts
1797
1862
  var noIgnoredReplayBufferRule = ruleCreator({
1798
1863
  defaultOptions: [],
@@ -2013,7 +2078,7 @@ var noIgnoredTakewhileValueRule = ruleCreator({
2013
2078
 
2014
2079
  // src/rules/no-implicit-any-catch.ts
2015
2080
  import {
2016
- AST_NODE_TYPES as AST_NODE_TYPES5
2081
+ AST_NODE_TYPES as AST_NODE_TYPES4
2017
2082
  } from "@typescript-eslint/utils";
2018
2083
  function isParenthesised(sourceCode, node) {
2019
2084
  const before = sourceCode.getTokenBefore(node);
@@ -2037,10 +2102,11 @@ var noImplicitAnyCatchRule = ruleCreator({
2037
2102
  fixable: "code",
2038
2103
  hasSuggestions: true,
2039
2104
  messages: {
2040
- explicitAny: "Explicit `any` in `catchError`.",
2041
- implicitAny: "Implicit `any` in `catchError`.",
2105
+ explicitAny: "Explicit `any` in error callback.",
2106
+ implicitAny: "Implicit `any` in error callback.",
2042
2107
  narrowed: "Error type must be `unknown` or `any`.",
2043
- suggestExplicitUnknown: "Use `unknown` instead, this will force you to explicitly and safely assert the type is correct."
2108
+ suggestExplicitUnknown: "Use `unknown` instead to explicitly and safely assert the type is correct.",
2109
+ suggestExplicitAny: "Use `any` instead to explicitly opt out of type safety."
2044
2110
  },
2045
2111
  schema: [
2046
2112
  {
@@ -2063,6 +2129,22 @@ var noImplicitAnyCatchRule = ruleCreator({
2063
2129
  const { allowExplicitAny = true } = config;
2064
2130
  const { couldBeObservable } = getTypeServices(context);
2065
2131
  const sourceCode = context.sourceCode;
2132
+ function createReplacerFix(typeAnnotation, replaceWith) {
2133
+ return function fix(fixer) {
2134
+ return fixer.replaceText(typeAnnotation, `: ${replaceWith}`);
2135
+ };
2136
+ }
2137
+ function createInserterFix(param, annotateWith, { hasRestParams = false } = {}) {
2138
+ return function fix(fixer) {
2139
+ if (hasRestParams || isParenthesised(sourceCode, param)) {
2140
+ return fixer.insertTextAfter(param, `: ${annotateWith}`);
2141
+ }
2142
+ return [
2143
+ fixer.insertTextBefore(param, "("),
2144
+ fixer.insertTextAfter(param, `: ${annotateWith})`)
2145
+ ];
2146
+ };
2147
+ }
2066
2148
  function checkCallback(callback) {
2067
2149
  if (isArrowFunctionExpression(callback) || isFunctionExpression(callback)) {
2068
2150
  const [param, ...restParams] = callback.params;
@@ -2074,62 +2156,52 @@ var noImplicitAnyCatchRule = ruleCreator({
2074
2156
  const {
2075
2157
  typeAnnotation: { type }
2076
2158
  } = typeAnnotation;
2077
- if (type === AST_NODE_TYPES5.TSAnyKeyword) {
2078
- let fix2 = function(fixer) {
2079
- return fixer.replaceText(typeAnnotation, ": unknown");
2080
- };
2081
- var fix = fix2;
2159
+ if (type === AST_NODE_TYPES4.TSAnyKeyword) {
2082
2160
  if (allowExplicitAny) {
2083
2161
  return;
2084
2162
  }
2085
2163
  context.report({
2086
- fix: fix2,
2087
2164
  messageId: "explicitAny",
2088
2165
  node: param,
2089
2166
  suggest: [
2090
2167
  {
2091
2168
  messageId: "suggestExplicitUnknown",
2092
- fix: fix2
2169
+ fix: createReplacerFix(typeAnnotation, "unknown")
2093
2170
  }
2094
2171
  ]
2095
2172
  });
2096
- } else if (type !== AST_NODE_TYPES5.TSUnknownKeyword) {
2097
- let fix2 = function(fixer) {
2098
- return fixer.replaceText(typeAnnotation, ": unknown");
2099
- };
2100
- var fix = fix2;
2173
+ } else if (type !== AST_NODE_TYPES4.TSUnknownKeyword) {
2101
2174
  context.report({
2102
2175
  messageId: "narrowed",
2103
2176
  node: param,
2104
2177
  suggest: [
2105
2178
  {
2106
2179
  messageId: "suggestExplicitUnknown",
2107
- fix: fix2
2108
- }
2109
- ]
2180
+ fix: createReplacerFix(typeAnnotation, "unknown")
2181
+ },
2182
+ allowExplicitAny ? {
2183
+ messageId: "suggestExplicitAny",
2184
+ fix: createReplacerFix(typeAnnotation, "any")
2185
+ } : null
2186
+ ].filter((x) => !!x)
2110
2187
  });
2111
2188
  }
2112
2189
  } else {
2113
- let fix2 = function(fixer) {
2114
- if (isParenthesised(sourceCode, param) || restParams.length > 0) {
2115
- return fixer.insertTextAfter(param, ": unknown");
2116
- }
2117
- return [
2118
- fixer.insertTextBefore(param, "("),
2119
- fixer.insertTextAfter(param, ": unknown)")
2120
- ];
2121
- };
2122
- var fix = fix2;
2190
+ const hasRestParams = restParams.length > 0;
2123
2191
  context.report({
2124
- fix: fix2,
2192
+ fix: allowExplicitAny ? createInserterFix(param, "any", { hasRestParams }) : void 0,
2125
2193
  messageId: "implicitAny",
2126
2194
  node: param,
2127
2195
  suggest: [
2128
2196
  {
2129
2197
  messageId: "suggestExplicitUnknown",
2130
- fix: fix2
2131
- }
2132
- ]
2198
+ fix: createInserterFix(param, "unknown", { hasRestParams })
2199
+ },
2200
+ allowExplicitAny ? {
2201
+ messageId: "suggestExplicitAny",
2202
+ fix: createInserterFix(param, "any", { hasRestParams })
2203
+ } : null
2204
+ ].filter((x) => !!x)
2133
2205
  });
2134
2206
  }
2135
2207
  }
@@ -2267,10 +2339,10 @@ var noInternalRule = ruleCreator({
2267
2339
  });
2268
2340
 
2269
2341
  // src/rules/no-misused-observables.ts
2270
- import { AST_NODE_TYPES as AST_NODE_TYPES6, ESLintUtils as ESLintUtils9 } from "@typescript-eslint/utils";
2342
+ import { AST_NODE_TYPES as AST_NODE_TYPES5, ESLintUtils as ESLintUtils9 } from "@typescript-eslint/utils";
2271
2343
  import { getFunctionHeadLocation, isFunction } from "@typescript-eslint/utils/ast-utils";
2272
- import * as tsutils3 from "ts-api-utils";
2273
- import ts6 from "typescript";
2344
+ import * as tsutils4 from "ts-api-utils";
2345
+ import ts5 from "typescript";
2274
2346
  function parseChecksVoidReturn(checksVoidReturn) {
2275
2347
  var _a, _b, _c, _d, _e, _f;
2276
2348
  switch (checksVoidReturn) {
@@ -2566,8 +2638,8 @@ function voidFunctionArguments(checker, tsNode) {
2566
2638
  }
2567
2639
  const voidReturnIndices = /* @__PURE__ */ new Set();
2568
2640
  const type = checker.getTypeAtLocation(tsNode.expression);
2569
- for (const subType of tsutils3.unionTypeParts(type)) {
2570
- const signatures = ts6.isCallExpression(tsNode) ? subType.getCallSignatures() : subType.getConstructSignatures();
2641
+ for (const subType of tsutils4.unionConstituents(type)) {
2642
+ const signatures = ts5.isCallExpression(tsNode) ? subType.getCallSignatures() : subType.getConstructSignatures();
2571
2643
  for (const signature of signatures) {
2572
2644
  for (const [index, parameter] of signature.parameters.entries()) {
2573
2645
  const type2 = checker.getTypeOfSymbolAtLocation(parameter, tsNode.expression);
@@ -2581,13 +2653,13 @@ function voidFunctionArguments(checker, tsNode) {
2581
2653
  }
2582
2654
  function isVoidReturningFunctionType(type) {
2583
2655
  let hasVoidReturn = false;
2584
- for (const subType of tsutils3.unionTypeParts(type)) {
2656
+ for (const subType of tsutils4.unionConstituents(type)) {
2585
2657
  for (const signature of subType.getCallSignatures()) {
2586
2658
  const returnType = signature.getReturnType();
2587
2659
  if (couldBeType(returnType, "Observable")) {
2588
2660
  return false;
2589
2661
  }
2590
- hasVoidReturn || (hasVoidReturn = tsutils3.isTypeFlagSet(returnType, ts6.TypeFlags.Void));
2662
+ hasVoidReturn || (hasVoidReturn = tsutils4.isTypeFlagSet(returnType, ts5.TypeFlags.Void));
2591
2663
  }
2592
2664
  }
2593
2665
  return hasVoidReturn;
@@ -2598,31 +2670,31 @@ function getHeritageTypes(checker, tsNode) {
2598
2670
  }
2599
2671
  function getMemberIfExists(type, memberName) {
2600
2672
  var _a, _b;
2601
- const escapedMemberName = ts6.escapeLeadingUnderscores(memberName);
2673
+ const escapedMemberName = ts5.escapeLeadingUnderscores(memberName);
2602
2674
  const symbolMemberMatch = (_b = (_a = type.getSymbol()) == null ? void 0 : _a.members) == null ? void 0 : _b.get(escapedMemberName);
2603
- return symbolMemberMatch != null ? symbolMemberMatch : tsutils3.getPropertyOfType(type, escapedMemberName);
2675
+ return symbolMemberMatch != null ? symbolMemberMatch : tsutils4.getPropertyOfType(type, escapedMemberName);
2604
2676
  }
2605
2677
  function isStaticMember(node) {
2606
2678
  return (isMethodDefinition(node) || isPropertyDefinition(node) || isAccessorProperty(node)) && node.static;
2607
2679
  }
2608
2680
  function getPropertyContextualType(checker, tsNode) {
2609
- if (ts6.isPropertyAssignment(tsNode)) {
2681
+ if (ts5.isPropertyAssignment(tsNode)) {
2610
2682
  return checker.getContextualType(tsNode.initializer);
2611
- } else if (ts6.isShorthandPropertyAssignment(tsNode)) {
2683
+ } else if (ts5.isShorthandPropertyAssignment(tsNode)) {
2612
2684
  return checker.getContextualType(tsNode.name);
2613
- } else if (ts6.isMethodDeclaration(tsNode)) {
2614
- if (ts6.isComputedPropertyName(tsNode.name)) {
2685
+ } else if (ts5.isMethodDeclaration(tsNode)) {
2686
+ if (ts5.isComputedPropertyName(tsNode.name)) {
2615
2687
  return;
2616
2688
  }
2617
2689
  const obj = tsNode.parent;
2618
- if (!ts6.isObjectLiteralExpression(obj)) {
2690
+ if (!ts5.isObjectLiteralExpression(obj)) {
2619
2691
  return;
2620
2692
  }
2621
2693
  const objType = checker.getContextualType(obj);
2622
2694
  if (objType == null) {
2623
2695
  return;
2624
2696
  }
2625
- const propertySymbol = checker.getPropertyOfType(objType, tsNode.name.text);
2697
+ const propertySymbol = tsutils4.unionConstituents(objType).map((t) => checker.getPropertyOfType(t, tsNode.name.getText())).find((p) => p);
2626
2698
  if (propertySymbol == null) {
2627
2699
  return;
2628
2700
  }
@@ -2633,55 +2705,55 @@ function getPropertyContextualType(checker, tsNode) {
2633
2705
  }
2634
2706
  function isPossiblyFunctionType(node) {
2635
2707
  switch (node.typeAnnotation.type) {
2636
- case AST_NODE_TYPES6.TSConditionalType:
2637
- case AST_NODE_TYPES6.TSConstructorType:
2638
- case AST_NODE_TYPES6.TSFunctionType:
2639
- case AST_NODE_TYPES6.TSImportType:
2640
- case AST_NODE_TYPES6.TSIndexedAccessType:
2641
- case AST_NODE_TYPES6.TSInferType:
2642
- case AST_NODE_TYPES6.TSIntersectionType:
2643
- case AST_NODE_TYPES6.TSQualifiedName:
2644
- case AST_NODE_TYPES6.TSThisType:
2645
- case AST_NODE_TYPES6.TSTypeOperator:
2646
- case AST_NODE_TYPES6.TSTypeQuery:
2647
- case AST_NODE_TYPES6.TSTypeReference:
2648
- case AST_NODE_TYPES6.TSUnionType:
2708
+ case AST_NODE_TYPES5.TSConditionalType:
2709
+ case AST_NODE_TYPES5.TSConstructorType:
2710
+ case AST_NODE_TYPES5.TSFunctionType:
2711
+ case AST_NODE_TYPES5.TSImportType:
2712
+ case AST_NODE_TYPES5.TSIndexedAccessType:
2713
+ case AST_NODE_TYPES5.TSInferType:
2714
+ case AST_NODE_TYPES5.TSIntersectionType:
2715
+ case AST_NODE_TYPES5.TSQualifiedName:
2716
+ case AST_NODE_TYPES5.TSThisType:
2717
+ case AST_NODE_TYPES5.TSTypeOperator:
2718
+ case AST_NODE_TYPES5.TSTypeQuery:
2719
+ case AST_NODE_TYPES5.TSTypeReference:
2720
+ case AST_NODE_TYPES5.TSUnionType:
2649
2721
  return true;
2650
- case AST_NODE_TYPES6.TSTypeLiteral:
2722
+ case AST_NODE_TYPES5.TSTypeLiteral:
2651
2723
  return node.typeAnnotation.members.some(
2652
- (member) => member.type === AST_NODE_TYPES6.TSCallSignatureDeclaration || member.type === AST_NODE_TYPES6.TSConstructSignatureDeclaration
2724
+ (member) => member.type === AST_NODE_TYPES5.TSCallSignatureDeclaration || member.type === AST_NODE_TYPES5.TSConstructSignatureDeclaration
2653
2725
  );
2654
- case AST_NODE_TYPES6.TSAbstractKeyword:
2655
- case AST_NODE_TYPES6.TSAnyKeyword:
2656
- case AST_NODE_TYPES6.TSArrayType:
2657
- case AST_NODE_TYPES6.TSAsyncKeyword:
2658
- case AST_NODE_TYPES6.TSBigIntKeyword:
2659
- case AST_NODE_TYPES6.TSBooleanKeyword:
2660
- case AST_NODE_TYPES6.TSDeclareKeyword:
2661
- case AST_NODE_TYPES6.TSExportKeyword:
2662
- case AST_NODE_TYPES6.TSIntrinsicKeyword:
2663
- case AST_NODE_TYPES6.TSLiteralType:
2664
- case AST_NODE_TYPES6.TSMappedType:
2665
- case AST_NODE_TYPES6.TSNamedTupleMember:
2666
- case AST_NODE_TYPES6.TSNeverKeyword:
2667
- case AST_NODE_TYPES6.TSNullKeyword:
2668
- case AST_NODE_TYPES6.TSNumberKeyword:
2669
- case AST_NODE_TYPES6.TSObjectKeyword:
2670
- case AST_NODE_TYPES6.TSOptionalType:
2671
- case AST_NODE_TYPES6.TSPrivateKeyword:
2672
- case AST_NODE_TYPES6.TSProtectedKeyword:
2673
- case AST_NODE_TYPES6.TSPublicKeyword:
2674
- case AST_NODE_TYPES6.TSReadonlyKeyword:
2675
- case AST_NODE_TYPES6.TSRestType:
2676
- case AST_NODE_TYPES6.TSStaticKeyword:
2677
- case AST_NODE_TYPES6.TSStringKeyword:
2678
- case AST_NODE_TYPES6.TSSymbolKeyword:
2679
- case AST_NODE_TYPES6.TSTemplateLiteralType:
2680
- case AST_NODE_TYPES6.TSTupleType:
2681
- case AST_NODE_TYPES6.TSTypePredicate:
2682
- case AST_NODE_TYPES6.TSUndefinedKeyword:
2683
- case AST_NODE_TYPES6.TSUnknownKeyword:
2684
- case AST_NODE_TYPES6.TSVoidKeyword:
2726
+ case AST_NODE_TYPES5.TSAbstractKeyword:
2727
+ case AST_NODE_TYPES5.TSAnyKeyword:
2728
+ case AST_NODE_TYPES5.TSArrayType:
2729
+ case AST_NODE_TYPES5.TSAsyncKeyword:
2730
+ case AST_NODE_TYPES5.TSBigIntKeyword:
2731
+ case AST_NODE_TYPES5.TSBooleanKeyword:
2732
+ case AST_NODE_TYPES5.TSDeclareKeyword:
2733
+ case AST_NODE_TYPES5.TSExportKeyword:
2734
+ case AST_NODE_TYPES5.TSIntrinsicKeyword:
2735
+ case AST_NODE_TYPES5.TSLiteralType:
2736
+ case AST_NODE_TYPES5.TSMappedType:
2737
+ case AST_NODE_TYPES5.TSNamedTupleMember:
2738
+ case AST_NODE_TYPES5.TSNeverKeyword:
2739
+ case AST_NODE_TYPES5.TSNullKeyword:
2740
+ case AST_NODE_TYPES5.TSNumberKeyword:
2741
+ case AST_NODE_TYPES5.TSObjectKeyword:
2742
+ case AST_NODE_TYPES5.TSOptionalType:
2743
+ case AST_NODE_TYPES5.TSPrivateKeyword:
2744
+ case AST_NODE_TYPES5.TSProtectedKeyword:
2745
+ case AST_NODE_TYPES5.TSPublicKeyword:
2746
+ case AST_NODE_TYPES5.TSReadonlyKeyword:
2747
+ case AST_NODE_TYPES5.TSRestType:
2748
+ case AST_NODE_TYPES5.TSStaticKeyword:
2749
+ case AST_NODE_TYPES5.TSStringKeyword:
2750
+ case AST_NODE_TYPES5.TSSymbolKeyword:
2751
+ case AST_NODE_TYPES5.TSTemplateLiteralType:
2752
+ case AST_NODE_TYPES5.TSTupleType:
2753
+ case AST_NODE_TYPES5.TSTypePredicate:
2754
+ case AST_NODE_TYPES5.TSUndefinedKeyword:
2755
+ case AST_NODE_TYPES5.TSUnknownKeyword:
2756
+ case AST_NODE_TYPES5.TSVoidKeyword:
2685
2757
  return false;
2686
2758
  }
2687
2759
  }
@@ -2808,7 +2880,7 @@ function isExpressionObserver(expressionStatement, couldBeType2) {
2808
2880
  }
2809
2881
 
2810
2882
  // src/rules/no-sharereplay.ts
2811
- import { AST_NODE_TYPES as AST_NODE_TYPES7 } from "@typescript-eslint/utils";
2883
+ import { AST_NODE_TYPES as AST_NODE_TYPES6 } from "@typescript-eslint/utils";
2812
2884
  var defaultOptions10 = [];
2813
2885
  var noSharereplayRule = ruleCreator({
2814
2886
  defaultOptions: defaultOptions10,
@@ -2839,7 +2911,7 @@ var noSharereplayRule = ruleCreator({
2839
2911
  "CallExpression[callee.name='shareReplay']": (node) => {
2840
2912
  let report = true;
2841
2913
  if (allowConfig) {
2842
- report = node.arguments.length !== 1 || node.arguments[0].type !== AST_NODE_TYPES7.ObjectExpression;
2914
+ report = node.arguments.length !== 1 || node.arguments[0].type !== AST_NODE_TYPES6.ObjectExpression;
2843
2915
  }
2844
2916
  if (report) {
2845
2917
  context.report({
@@ -3076,7 +3148,7 @@ var noSubscribeHandlersRule = ruleCreator({
3076
3148
  });
3077
3149
 
3078
3150
  // src/rules/no-subscribe-in-pipe.ts
3079
- import { AST_NODE_TYPES as AST_NODE_TYPES8 } from "@typescript-eslint/utils";
3151
+ import { AST_NODE_TYPES as AST_NODE_TYPES7 } from "@typescript-eslint/utils";
3080
3152
  var noSubscribeInPipeRule = ruleCreator({
3081
3153
  defaultOptions: [],
3082
3154
  meta: {
@@ -3085,8 +3157,6 @@ var noSubscribeInPipeRule = ruleCreator({
3085
3157
  recommended: "recommended",
3086
3158
  requiresTypeChecking: true
3087
3159
  },
3088
- fixable: void 0,
3089
- hasSuggestions: false,
3090
3160
  messages: {
3091
3161
  forbidden: "Subscribe calls within pipe operators are forbidden."
3092
3162
  },
@@ -3099,7 +3169,7 @@ var noSubscribeInPipeRule = ruleCreator({
3099
3169
  function isWithinPipe(node) {
3100
3170
  let parent = node.parent;
3101
3171
  while (parent) {
3102
- if (parent.type === AST_NODE_TYPES8.CallExpression && parent.callee.type === AST_NODE_TYPES8.MemberExpression && parent.callee.property.type === AST_NODE_TYPES8.Identifier && parent.callee.property.name === "pipe") {
3172
+ if (parent.type === AST_NODE_TYPES7.CallExpression && parent.callee.type === AST_NODE_TYPES7.MemberExpression && parent.callee.property.type === AST_NODE_TYPES7.Identifier && parent.callee.property.name === "pipe") {
3103
3173
  return true;
3104
3174
  }
3105
3175
  parent = parent.parent;
@@ -3554,8 +3624,8 @@ var noUnsafeFirstRule = ruleCreator({
3554
3624
 
3555
3625
  // src/rules/no-unsafe-subject-next.ts
3556
3626
  import { ESLintUtils as ESLintUtils11 } from "@typescript-eslint/utils";
3557
- import * as tsutils4 from "ts-api-utils";
3558
- import ts7 from "typescript";
3627
+ import * as tsutils5 from "ts-api-utils";
3628
+ import ts6 from "typescript";
3559
3629
  var noUnsafeSubjectNext = ruleCreator({
3560
3630
  defaultOptions: [],
3561
3631
  meta: {
@@ -3578,19 +3648,19 @@ var noUnsafeSubjectNext = ruleCreator({
3578
3648
  [`CallExpression[callee.property.name='next']`]: (node) => {
3579
3649
  if (node.arguments.length === 0 && isMemberExpression(node.callee)) {
3580
3650
  const type = getTypeAtLocation(node.callee.object);
3581
- if (tsutils4.isTypeReference(type) && couldBeType(type, "Subject")) {
3651
+ if (tsutils5.isTypeReference(type) && couldBeType(type, "Subject")) {
3582
3652
  const [typeArg] = typeChecker.getTypeArguments(type);
3583
- if (tsutils4.isTypeFlagSet(typeArg, ts7.TypeFlags.Any)) {
3653
+ if (tsutils5.isTypeFlagSet(typeArg, ts6.TypeFlags.Any)) {
3584
3654
  return;
3585
3655
  }
3586
- if (tsutils4.isTypeFlagSet(typeArg, ts7.TypeFlags.Unknown)) {
3656
+ if (tsutils5.isTypeFlagSet(typeArg, ts6.TypeFlags.Unknown)) {
3587
3657
  return;
3588
3658
  }
3589
- if (tsutils4.isTypeFlagSet(typeArg, ts7.TypeFlags.Void)) {
3659
+ if (tsutils5.isTypeFlagSet(typeArg, ts6.TypeFlags.Void)) {
3590
3660
  return;
3591
3661
  }
3592
- if (tsutils4.isUnionType(typeArg) && typeArg.types.some(
3593
- (t) => tsutils4.isTypeFlagSet(t, ts7.TypeFlags.Void)
3662
+ if (tsutils5.isUnionType(typeArg) && typeArg.types.some(
3663
+ (t) => tsutils5.isTypeFlagSet(t, ts6.TypeFlags.Void)
3594
3664
  )) {
3595
3665
  return;
3596
3666
  }
@@ -4034,7 +4104,7 @@ var preferRootOperatorsRule = ruleCreator({
4034
4104
  });
4035
4105
 
4036
4106
  // src/rules/suffix-subjects.ts
4037
- import { AST_NODE_TYPES as AST_NODE_TYPES9, ESLintUtils as ESLintUtils12 } from "@typescript-eslint/utils";
4107
+ import { AST_NODE_TYPES as AST_NODE_TYPES8, ESLintUtils as ESLintUtils12 } from "@typescript-eslint/utils";
4038
4108
  var defaultOptions18 = [];
4039
4109
  var suffixSubjectsRule = ruleCreator({
4040
4110
  defaultOptions: defaultOptions18,
@@ -4118,7 +4188,7 @@ var suffixSubjectsRule = ruleCreator({
4118
4188
  if (!found) {
4119
4189
  return;
4120
4190
  }
4121
- if (!validate.variables && found.type === AST_NODE_TYPES9.VariableDeclarator) {
4191
+ if (!validate.variables && found.type === AST_NODE_TYPES8.VariableDeclarator) {
4122
4192
  return;
4123
4193
  }
4124
4194
  if (!validate.parameters) {
@@ -4185,7 +4255,7 @@ var suffixSubjectsRule = ruleCreator({
4185
4255
  if (!found) {
4186
4256
  return;
4187
4257
  }
4188
- if (!validate.variables && found.type === AST_NODE_TYPES9.VariableDeclarator) {
4258
+ if (!validate.variables && found.type === AST_NODE_TYPES8.VariableDeclarator) {
4189
4259
  return;
4190
4260
  }
4191
4261
  if (!validate.parameters) {
@@ -4233,7 +4303,7 @@ var suffixSubjectsRule = ruleCreator({
4233
4303
 
4234
4304
  // src/rules/throw-error.ts
4235
4305
  import { ESLintUtils as ESLintUtils13 } from "@typescript-eslint/utils";
4236
- import * as tsutils5 from "ts-api-utils";
4306
+ import * as tsutils6 from "ts-api-utils";
4237
4307
  var defaultOptions19 = [];
4238
4308
  var throwErrorRule = ruleCreator({
4239
4309
  defaultOptions: defaultOptions19,
@@ -4277,10 +4347,10 @@ var throwErrorRule = ruleCreator({
4277
4347
  const body = tsNode.body;
4278
4348
  type = program.getTypeChecker().getTypeAtLocation(annotation != null ? annotation : body);
4279
4349
  }
4280
- if (allowThrowingAny && tsutils5.isIntrinsicAnyType(type)) {
4350
+ if (allowThrowingAny && tsutils6.isIntrinsicAnyType(type)) {
4281
4351
  return;
4282
4352
  }
4283
- if (allowThrowingUnknown && tsutils5.isIntrinsicUnknownType(type)) {
4353
+ if (allowThrowingUnknown && tsutils6.isIntrinsicUnknownType(type)) {
4284
4354
  return;
4285
4355
  }
4286
4356
  if (couldBeType(type, /^Error$/)) {
@@ -4334,6 +4404,7 @@ var allRules = {
4334
4404
  "no-ignored-default-value": noIgnoredDefaultValueRule,
4335
4405
  "no-ignored-error": noIgnoredErrorRule,
4336
4406
  "no-ignored-notifier": noIgnoredNotifierRule,
4407
+ "no-ignored-observable": noIgnoredObservableRule,
4337
4408
  "no-ignored-replay-buffer": noIgnoredReplayBufferRule,
4338
4409
  "no-ignored-subscribe": noIgnoredSubscribeRule,
4339
4410
  "no-ignored-subscription": noIgnoredSubscriptionRule,
@@ -4377,8 +4448,9 @@ var plugin = {
4377
4448
  var rxjsX = {
4378
4449
  ...plugin,
4379
4450
  configs: {
4380
- recommended: createRecommendedConfig(plugin),
4381
- strict: createStrictConfig(plugin)
4451
+ "recommended": createRecommendedConfig(plugin),
4452
+ "strict": createStrictConfig(plugin),
4453
+ "recommended-legacy": createLegacyRecommendedConfig()
4382
4454
  }
4383
4455
  };
4384
4456
  var index_default = rxjsX;