@depup/typescript-eslint__eslint-plugin 8.68.0-depup.0 → 8.69.0-depup.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.
package/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/typescript-eslint__eslint-plugin
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) @ 8.68.0 |
17
- | Processed | 2026-08-25 |
16
+ | Original | [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) @ 8.69.0 |
17
+ | Processed | 2026-09-01 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 1 |
20
20
 
@@ -22,7 +22,7 @@ npm install @depup/typescript-eslint__eslint-plugin
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
- | ignore | ^7.0.5 | ^7.0.6 |
25
+ | ignore | ^7.0.5 | ^7.0.8 |
26
26
 
27
27
  ---
28
28
 
package/changes.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "bumped": {
3
3
  "ignore": {
4
4
  "from": "^7.0.5",
5
- "to": "^7.0.6"
5
+ "to": "^7.0.8"
6
6
  }
7
7
  },
8
- "timestamp": "2026-08-25T00:16:47.315Z",
8
+ "timestamp": "2026-09-01T00:39:42.146Z",
9
9
  "totalUpdated": 1
10
10
  }
package/dist/index.d.ts CHANGED
@@ -855,7 +855,7 @@ declare const _default: {
855
855
  }], import("../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
856
856
  name: string;
857
857
  };
858
- 'no-meaningless-void-operator': import("@typescript-eslint/utils/ts-eslint").RuleModule<"meaninglessVoidOperator" | "removeVoid", import("./rules/no-meaningless-void-operator").Options, import("../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
858
+ 'no-meaningless-void-operator': import("@typescript-eslint/utils/ts-eslint").RuleModule<"meaninglessVoidOnNonCall" | "meaninglessVoidOperator" | "removeVoid", import("./rules/no-meaningless-void-operator").Options, import("../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
859
859
  name: string;
860
860
  };
861
861
  'no-misused-new': import("@typescript-eslint/utils/ts-eslint").RuleModule<"errorMessageClass" | "errorMessageInterface", [], import("../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
@@ -878,7 +878,7 @@ declare const _default: {
878
878
  }], import("../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
879
879
  name: string;
880
880
  };
881
- 'no-meaningless-void-operator': TSESLint.RuleModule<"meaninglessVoidOperator" | "removeVoid", import("./rules/no-meaningless-void-operator").Options, import("../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
881
+ 'no-meaningless-void-operator': TSESLint.RuleModule<"meaninglessVoidOnNonCall" | "meaninglessVoidOperator" | "removeVoid", import("./rules/no-meaningless-void-operator").Options, import("../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
882
882
  name: string;
883
883
  };
884
884
  'no-misused-new': TSESLint.RuleModule<"errorMessageClass" | "errorMessageInterface", [], import("../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
@@ -180,7 +180,7 @@ declare const rules: {
180
180
  }], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
181
181
  name: string;
182
182
  };
183
- 'no-meaningless-void-operator': import("@typescript-eslint/utils/ts-eslint").RuleModule<"meaninglessVoidOperator" | "removeVoid", import("./no-meaningless-void-operator").Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
183
+ 'no-meaningless-void-operator': import("@typescript-eslint/utils/ts-eslint").RuleModule<"meaninglessVoidOnNonCall" | "meaninglessVoidOperator" | "removeVoid", import("./no-meaningless-void-operator").Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
184
184
  name: string;
185
185
  };
186
186
  'no-misused-new': import("@typescript-eslint/utils/ts-eslint").RuleModule<"errorMessageClass" | "errorMessageInterface", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
@@ -4,7 +4,7 @@ export type Options = [
4
4
  checkNever: boolean;
5
5
  }
6
6
  ];
7
- declare const _default: TSESLint.RuleModule<"meaninglessVoidOperator" | "removeVoid", Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
7
+ declare const _default: TSESLint.RuleModule<"meaninglessVoidOnNonCall" | "meaninglessVoidOperator" | "removeVoid", Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & {
8
8
  name: string;
9
9
  };
10
10
  export default _default;
@@ -49,6 +49,7 @@ exports.default = (0, util_1.createRule)({
49
49
  fixable: 'code',
50
50
  hasSuggestions: true,
51
51
  messages: {
52
+ meaninglessVoidOnNonCall: "void operator is useless here; it should only discard a call's return value",
52
53
  meaninglessVoidOperator: "void operator shouldn't be used on {{type}}; it should convey that a return value is being ignored",
53
54
  removeVoid: "Remove 'void'",
54
55
  },
@@ -59,7 +60,7 @@ exports.default = (0, util_1.createRule)({
59
60
  properties: {
60
61
  checkNever: {
61
62
  type: 'boolean',
62
- description: 'Whether to suggest removing `void` when the argument has type `never`.',
63
+ description: "Whether to suggest removing `void` when a call's return type is `never`.",
63
64
  },
64
65
  },
65
66
  },
@@ -77,6 +78,27 @@ exports.default = (0, util_1.createRule)({
77
78
  context.sourceCode.getTokens(node)[1].range[0],
78
79
  ]);
79
80
  };
81
+ const inner = unwrapVoidArgument(node.argument);
82
+ if (inner.type !== utils_1.AST_NODE_TYPES.CallExpression) {
83
+ // `void 0` is a common undefined idiom, not a discarded call.
84
+ if (inner.type === utils_1.AST_NODE_TYPES.Literal && inner.value === 0) {
85
+ return;
86
+ }
87
+ const tsArgument = services.esTreeNodeToTSNodeMap.get(node.argument);
88
+ const argType = services.getTypeAtLocation(node.argument);
89
+ // Allow `void promiseValue` so this rule does not fight no-floating-promises.
90
+ if (tsutils.isThenableType(checker, tsArgument, argType)) {
91
+ return;
92
+ }
93
+ context.report({
94
+ node,
95
+ messageId: 'meaninglessVoidOnNonCall',
96
+ fix: node.parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement
97
+ ? fix
98
+ : undefined,
99
+ });
100
+ return;
101
+ }
80
102
  const argType = services.getTypeAtLocation(node.argument);
81
103
  const unionParts = tsutils.unionConstituents(argType);
82
104
  if (unionParts.every(part => tsutils.isTypeFlagSet(part, ts.TypeFlags.Void | ts.TypeFlags.Undefined))) {
@@ -100,4 +122,23 @@ exports.default = (0, util_1.createRule)({
100
122
  };
101
123
  },
102
124
  });
125
+ function unwrapVoidArgument(node) {
126
+ let current = node;
127
+ while (true) {
128
+ switch (current.type) {
129
+ case utils_1.AST_NODE_TYPES.ChainExpression:
130
+ case utils_1.AST_NODE_TYPES.TSAsExpression:
131
+ case utils_1.AST_NODE_TYPES.TSNonNullExpression:
132
+ case utils_1.AST_NODE_TYPES.TSSatisfiesExpression:
133
+ case utils_1.AST_NODE_TYPES.TSTypeAssertion:
134
+ current = current.expression;
135
+ continue;
136
+ case utils_1.AST_NODE_TYPES.SequenceExpression:
137
+ current = (0, util_1.nullThrows)(current.expressions.at(-1), 'Expected SequenceExpression to have at least one expression');
138
+ continue;
139
+ default:
140
+ return current;
141
+ }
142
+ }
143
+ }
103
144
  //# sourceMappingURL=no-meaningless-void-operator.js.map
@@ -1,11 +1,15 @@
1
1
  import type { TSESLint } from '@typescript-eslint/utils';
2
2
  export type Options = [
3
3
  {
4
- checksConditionals?: boolean;
4
+ checksConditionals?: boolean | ChecksConditionalsOptions;
5
5
  checksSpreads?: boolean;
6
6
  checksVoidReturn?: boolean | ChecksVoidReturnOptions;
7
7
  }
8
8
  ];
9
+ export type FlagUnionsOptions = 'all' | 'none' | 'strict';
10
+ export interface ChecksConditionalsOptions {
11
+ flagUnions?: FlagUnionsOptions;
12
+ }
9
13
  export interface ChecksVoidReturnOptions {
10
14
  arguments?: boolean;
11
15
  attributes?: boolean;
@@ -89,8 +89,25 @@ exports.default = (0, util_1.createRule)({
89
89
  additionalProperties: false,
90
90
  properties: {
91
91
  checksConditionals: {
92
- type: 'boolean',
93
92
  description: 'Whether to warn when a Promise is provided to conditional statements.',
93
+ oneOf: [
94
+ {
95
+ type: 'boolean',
96
+ description: 'Whether to check conditionals.',
97
+ },
98
+ {
99
+ type: 'object',
100
+ additionalProperties: false,
101
+ description: 'Detailed settings for conditional inspection.',
102
+ properties: {
103
+ flagUnions: {
104
+ type: 'string',
105
+ description: 'Configures how union types containing Promise-like types are checked.',
106
+ enum: ['all', 'strict', 'none'],
107
+ },
108
+ },
109
+ },
110
+ ],
94
111
  },
95
112
  checksSpreads: {
96
113
  type: 'boolean',
@@ -151,6 +168,7 @@ exports.default = (0, util_1.createRule)({
151
168
  const services = (0, util_1.getParserServices)(context);
152
169
  const checker = services.program.getTypeChecker();
153
170
  const checkedNodes = new Set();
171
+ const flagUnionsOption = normalizeFlagUnionsOption(checksConditionals);
154
172
  const conditionalChecks = {
155
173
  'CallExpression > MemberExpression': checkArrayPredicates,
156
174
  ConditionalExpression: checkTestConditional,
@@ -284,6 +302,22 @@ exports.default = (0, util_1.createRule)({
284
302
  node,
285
303
  messageId: 'conditional',
286
304
  });
305
+ return;
306
+ }
307
+ if (
308
+ // none -> Report `Promise` but not `Promise | ...`
309
+ (flagUnionsOption === 'none' && isAlwaysThenable(checker, tsNode)) ||
310
+ //
311
+ // all -> Report `Promise` and `Promise | ...`
312
+ (flagUnionsOption === 'all' && isSometimesThenable(checker, tsNode)) ||
313
+ //
314
+ // strict -> Report `Promise<T> | T` but not `Promise<T> | NotT`
315
+ (flagUnionsOption === 'strict' &&
316
+ hasMatchingPromiseTypeArgument(checker, tsNode))) {
317
+ context.report({
318
+ node,
319
+ messageId: 'conditional',
320
+ });
287
321
  }
288
322
  }
289
323
  function checkArrayPredicates(node) {
@@ -801,4 +835,30 @@ function hasWellKnownSymbolWithVoidReturn(checker, node, type, symbolName) {
801
835
  return isVoidReturningFunctionType(checker, node, checker.getTypeOfSymbolAtLocation(symbol, node));
802
836
  });
803
837
  }
838
+ /**
839
+ * Check that the Promise argument is the same as the rest of the type when it is a Union that contains Promise.
840
+ */
841
+ function hasMatchingPromiseTypeArgument(checker, node) {
842
+ const type = checker.getTypeAtLocation(node);
843
+ const unionConstituents = tsutils.unionConstituents(checker.getApparentType(type));
844
+ const promiseType = unionConstituents.find(type => tsutils.isThenableType(checker, node, type));
845
+ if (!promiseType) {
846
+ return false;
847
+ }
848
+ const nonPromiseUnionConstituents = unionConstituents.filter(type => type !== promiseType);
849
+ const awaitedType = checker.getAwaitedType(promiseType);
850
+ if (!awaitedType) {
851
+ return false;
852
+ }
853
+ const awaitedTypeConstituents = tsutils.unionConstituents(awaitedType);
854
+ return (nonPromiseUnionConstituents.length === awaitedTypeConstituents.length &&
855
+ nonPromiseUnionConstituents.every(type => awaitedTypeConstituents.some(awaited => checker.isTypeAssignableTo(type, awaited) &&
856
+ checker.isTypeAssignableTo(awaited, type))));
857
+ }
858
+ function normalizeFlagUnionsOption(checksConditionals) {
859
+ if (!checksConditionals || checksConditionals === true) {
860
+ return 'none';
861
+ }
862
+ return checksConditionals.flagUnions ?? 'none';
863
+ }
804
864
  //# sourceMappingURL=no-misused-promises.js.map
@@ -62,14 +62,40 @@ exports.default = (0, util_1.createRule)({
62
62
  create(context) {
63
63
  const parserServices = (0, util_1.getParserServices)(context);
64
64
  const typeChecker = parserServices.program.getTypeChecker();
65
+ function getModuleName(id) {
66
+ if (id.type === utils_1.AST_NODE_TYPES.Literal) {
67
+ return JSON.stringify(id.value);
68
+ }
69
+ let qualifiers = '';
70
+ let current = id;
71
+ while (current.type === utils_1.AST_NODE_TYPES.TSQualifiedName) {
72
+ qualifiers = `.${current.right.name}${qualifiers}`;
73
+ current = current.left;
74
+ }
75
+ return context.sourceCode.getText(current) + qualifiers;
76
+ }
77
+ function getMergedScopes(scope) {
78
+ const { block } = scope;
79
+ if (block.type !== utils_1.AST_NODE_TYPES.TSModuleDeclaration) {
80
+ return [scope];
81
+ }
82
+ const name = getModuleName(block.id);
83
+ return getEnclosingScopes(block).flatMap(enclosing => enclosing.childScopes.filter(childScope => childScope.block.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration &&
84
+ getModuleName(childScope.block.id) === name));
85
+ }
86
+ function getEnclosingScopes(node) {
87
+ const enclosing = (0, util_1.nullThrows)(context.sourceCode.getScope(node).upper, util_1.NullThrowsReasons.MissingParent);
88
+ return node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration
89
+ ? getMergedScopes(enclosing)
90
+ : [enclosing];
91
+ }
65
92
  function collectNodeDefinitions(node) {
66
93
  const { name } = node.id;
67
94
  const found = {
68
95
  imports: [],
69
96
  previousSibling: undefined,
70
97
  };
71
- let scope = context.sourceCode.getScope(node);
72
- for (const definition of scope.upper?.set.get(name)?.defs ?? []) {
98
+ for (const definition of getEnclosingScopes(node).flatMap(enclosing => enclosing.set.get(name)?.defs ?? [])) {
73
99
  if (definition.node.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration &&
74
100
  definition.node.range[0] < node.range[0] &&
75
101
  definition.node.body.members.length > 0) {
@@ -77,6 +103,7 @@ exports.default = (0, util_1.createRule)({
77
103
  break;
78
104
  }
79
105
  }
106
+ let scope = context.sourceCode.getScope(node);
80
107
  while (scope) {
81
108
  scope.set.get(name)?.defs.forEach(definition => {
82
109
  if (definition.type === scope_manager_1.DefinitionType.ImportBinding) {
@@ -138,33 +165,16 @@ exports.default = (0, util_1.createRule)({
138
165
  // Case: Multiple enum declarations in the same file
139
166
  // enum MyEnum { A }
140
167
  // enum MyEnum { B }
141
- if (previousSibling) {
142
- return getMemberType(previousSibling.body.members[0]);
143
- }
144
- // Case: Namespace declaration merging
168
+ //
169
+ // ...including ones merged across namespace declarations
145
170
  // namespace MyNamespace {
146
171
  // export enum MyEnum { A }
147
172
  // }
148
173
  // namespace MyNamespace {
149
174
  // export enum MyEnum { B }
150
175
  // }
151
- if (node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration &&
152
- node.parent.parent.type === utils_1.AST_NODE_TYPES.TSModuleBlock) {
153
- // https://github.com/typescript-eslint/typescript-eslint/issues/8352
154
- // TODO: We don't need to dip into the TypeScript type checker here!
155
- // Merged namespaces must all exist in the same file.
156
- // We could instead compare this file's nodes to find the merges.
157
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.id);
158
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
159
- const declarations = typeChecker
160
- .getSymbolAtLocation(tsNode)
161
- .getDeclarations();
162
- const [{ initializer }] = declarations[0]
163
- .members;
164
- return initializer &&
165
- tsutils.isTypeFlagSet(typeChecker.getTypeAtLocation(initializer), ts.TypeFlags.StringLike)
166
- ? AllowedType.String
167
- : AllowedType.Number;
176
+ if (previousSibling) {
177
+ return getMemberType(previousSibling.body.members[0]);
168
178
  }
169
179
  // Finally, we default to the type of the first enum member
170
180
  return getMemberType(node.body.members[0]);
@@ -334,8 +334,7 @@ exports.default = (0, util_1.createRule)({
334
334
  (b.type === utils_1.AST_NODE_TYPES.RestElement) && optionalA === optionalB);
335
335
  }
336
336
  function typeParametersAreEqual(a, b) {
337
- return (a.name.name === b.name.name &&
338
- constraintsAreEqual(a.constraint, b.constraint));
337
+ return (a.name.name === b.name.name && typesAreEqual(a.constraint, b.constraint));
339
338
  }
340
339
  function typesAreEqual(a, b) {
341
340
  return (a === b ||
@@ -343,9 +342,6 @@ exports.default = (0, util_1.createRule)({
343
342
  b != null &&
344
343
  context.sourceCode.getText(a) === context.sourceCode.getText(b)));
345
344
  }
346
- function constraintsAreEqual(a, b) {
347
- return a === b || (a != null && a.type === b?.type);
348
- }
349
345
  /* Returns the first index where `a` and `b` differ. */
350
346
  function getIndexOfFirstDifference(a, b, equal) {
351
347
  for (let i = 0; i < a.length && i < b.length; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/typescript-eslint__eslint-plugin",
3
- "version": "8.68.0-depup.0",
3
+ "version": "8.69.0-depup.0",
4
4
  "description": "TypeScript plugin for ESLint (with updated dependencies)",
5
5
  "files": [
6
6
  "dist",
@@ -55,11 +55,11 @@
55
55
  ],
56
56
  "dependencies": {
57
57
  "@eslint-community/regexpp": "^4.12.2",
58
- "@typescript-eslint/scope-manager": "8.68.0",
59
- "@typescript-eslint/type-utils": "8.68.0",
60
- "@typescript-eslint/utils": "8.68.0",
61
- "@typescript-eslint/visitor-keys": "8.68.0",
62
- "ignore": "^7.0.6",
58
+ "@typescript-eslint/scope-manager": "8.69.0",
59
+ "@typescript-eslint/type-utils": "8.69.0",
60
+ "@typescript-eslint/utils": "8.69.0",
61
+ "@typescript-eslint/visitor-keys": "8.69.0",
62
+ "ignore": "^7.0.8",
63
63
  "natural-compare": "^1.4.0",
64
64
  "ts-api-utils": "^2.5.0"
65
65
  },
@@ -68,8 +68,8 @@
68
68
  "@types/mdast": "^4.0.4",
69
69
  "@types/natural-compare": "^1.4.3",
70
70
  "@types/react": "^18.3.21",
71
- "@typescript-eslint/rule-schema-to-typescript-types": "8.68.0",
72
- "@typescript-eslint/rule-tester": "8.68.0",
71
+ "@typescript-eslint/rule-schema-to-typescript-types": "8.69.0",
72
+ "@typescript-eslint/rule-tester": "8.69.0",
73
73
  "@typescript/native": "npm:typescript@^7.0.2",
74
74
  "@vitest/coverage-v8": "^4.0.18",
75
75
  "ajv": "^6.12.6",
@@ -89,7 +89,7 @@
89
89
  "vitest": "^4.0.18"
90
90
  },
91
91
  "peerDependencies": {
92
- "@typescript-eslint/parser": "^8.68.0",
92
+ "@typescript-eslint/parser": "^8.69.0",
93
93
  "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
94
94
  "typescript": ">=4.8.4 <6.1.0"
95
95
  },
@@ -144,13 +144,13 @@
144
144
  "changes": {
145
145
  "ignore": {
146
146
  "from": "^7.0.5",
147
- "to": "^7.0.6"
147
+ "to": "^7.0.8"
148
148
  }
149
149
  },
150
150
  "depsUpdated": 1,
151
151
  "originalPackage": "@typescript-eslint/eslint-plugin",
152
- "originalVersion": "8.68.0",
153
- "processedAt": "2026-08-25T00:16:59.780Z",
152
+ "originalVersion": "8.69.0",
153
+ "processedAt": "2026-09-01T00:39:55.232Z",
154
154
  "smokeTest": "passed"
155
155
  }
156
156
  }