@typescript-eslint/eslint-plugin 8.42.1-alpha.8 → 8.42.1-alpha.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"no-confusing-void-expression.d.ts","sourceRoot":"","sources":["../../src/rules/no-confusing-void-expression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AAoBnE,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,4BAA4B,CAAC,EAAE,OAAO,CAAC;KACxC;CACF,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,iBAAiB,GACjB,sBAAsB,GACtB,8BAA8B,GAC9B,uBAAuB,GACvB,2BAA2B,GAC3B,+BAA+B,GAC/B,yBAAyB,GACzB,kBAAkB,CAAC;;AAEvB,wBAobG"}
1
+ {"version":3,"file":"no-confusing-void-expression.d.ts","sourceRoot":"","sources":["../../src/rules/no-confusing-void-expression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,QAAQ,EAET,MAAM,0BAA0B,CAAC;AAoBlC,MAAM,MAAM,OAAO,GAAG;IACpB;QACE,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,4BAA4B,CAAC,EAAE,OAAO,CAAC;KACxC;CACF,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,iBAAiB,GACjB,sBAAsB,GACtB,8BAA8B,GAC9B,uBAAuB,GACvB,2BAA2B,GAC3B,+BAA+B,GAC/B,yBAAyB,GACzB,kBAAkB,CAAC;;AAEvB,wBAibG"}
@@ -236,7 +236,7 @@ exports.default = (0, util_1.createRule)({
236
236
  * @returns Invalid ancestor node if it was found. `null` otherwise.
237
237
  */
238
238
  function findInvalidAncestor(node) {
239
- const parent = (0, util_1.nullThrows)(node.parent, util_1.NullThrowsReasons.MissingParent);
239
+ const parent = node.parent;
240
240
  if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression &&
241
241
  node !== parent.expressions[parent.expressions.length - 1]) {
242
242
  return null;
@@ -282,13 +282,13 @@ exports.default = (0, util_1.createRule)({
282
282
  /** Checks whether the return statement is the last statement in a function body. */
283
283
  function isFinalReturn(node) {
284
284
  // the parent must be a block
285
- const block = (0, util_1.nullThrows)(node.parent, util_1.NullThrowsReasons.MissingParent);
285
+ const block = node.parent;
286
286
  if (block.type !== utils_1.AST_NODE_TYPES.BlockStatement) {
287
287
  // e.g. `if (cond) return;` (not in a block)
288
288
  return false;
289
289
  }
290
290
  // the block's parent must be a function
291
- const blockParent = (0, util_1.nullThrows)(block.parent, util_1.NullThrowsReasons.MissingParent);
291
+ const blockParent = block.parent;
292
292
  if (![
293
293
  utils_1.AST_NODE_TYPES.ArrowFunctionExpression,
294
294
  utils_1.AST_NODE_TYPES.FunctionDeclaration,
@@ -1 +1 @@
1
- {"version":3,"file":"collectUnusedVariables.d.ts","sourceRoot":"","sources":["../../src/util/collectUnusedVariables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACd,MAAM,kCAAkC,CAAC;AAQ1C,OAAO,EAIL,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAKlC,UAAU,gBAAgB;IACxB,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACrD,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACpD;AAmxBD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,SAAS,MAAM,EACzB,OAAO,SAAS,SAAS,OAAO,EAAE,EAElC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,GAC3D,gBAAgB,CAQlB"}
1
+ {"version":3,"file":"collectUnusedVariables.d.ts","sourceRoot":"","sources":["../../src/util/collectUnusedVariables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EACd,MAAM,kCAAkC,CAAC;AAQ1C,OAAO,EAIL,QAAQ,EACT,MAAM,0BAA0B,CAAC;AAKlC,UAAU,gBAAgB;IACxB,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IACrD,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;CACpD;AAixBD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,SAAS,MAAM,EACzB,OAAO,SAAS,SAAS,OAAO,EAAE,EAElC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,GAC3D,gBAAgB,CAQlB"}
@@ -306,8 +306,8 @@ function isMergableExported(variable) {
306
306
  continue;
307
307
  }
308
308
  if ((MERGABLE_TYPES.has(def.node.type) &&
309
- def.node.parent?.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration) ||
310
- def.node.parent?.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration) {
309
+ def.node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration) ||
310
+ def.node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration) {
311
311
  return true;
312
312
  }
313
313
  }
@@ -322,13 +322,11 @@ function isExported(variable) {
322
322
  return variable.defs.some(definition => {
323
323
  let node = definition.node;
324
324
  if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) {
325
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
326
325
  node = node.parent;
327
326
  }
328
327
  else if (definition.type === utils_1.TSESLint.Scope.DefinitionType.Parameter) {
329
328
  return false;
330
329
  }
331
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
332
330
  return node.parent.type.startsWith('Export');
333
331
  });
334
332
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/eslint-plugin",
3
- "version": "8.42.1-alpha.8",
3
+ "version": "8.42.1-alpha.9",
4
4
  "description": "TypeScript plugin for ESLint",
5
5
  "files": [
6
6
  "dist",
@@ -59,10 +59,10 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@eslint-community/regexpp": "^4.10.0",
62
- "@typescript-eslint/scope-manager": "8.42.1-alpha.8",
63
- "@typescript-eslint/type-utils": "8.42.1-alpha.8",
64
- "@typescript-eslint/utils": "8.42.1-alpha.8",
65
- "@typescript-eslint/visitor-keys": "8.42.1-alpha.8",
62
+ "@typescript-eslint/scope-manager": "8.42.1-alpha.9",
63
+ "@typescript-eslint/type-utils": "8.42.1-alpha.9",
64
+ "@typescript-eslint/utils": "8.42.1-alpha.9",
65
+ "@typescript-eslint/visitor-keys": "8.42.1-alpha.9",
66
66
  "graphemer": "^1.4.0",
67
67
  "ignore": "^7.0.0",
68
68
  "natural-compare": "^1.4.0",
@@ -71,8 +71,8 @@
71
71
  "devDependencies": {
72
72
  "@types/mdast": "^4.0.3",
73
73
  "@types/natural-compare": "*",
74
- "@typescript-eslint/rule-schema-to-typescript-types": "8.42.1-alpha.8",
75
- "@typescript-eslint/rule-tester": "8.42.1-alpha.8",
74
+ "@typescript-eslint/rule-schema-to-typescript-types": "8.42.1-alpha.9",
75
+ "@typescript-eslint/rule-tester": "8.42.1-alpha.9",
76
76
  "@vitest/coverage-v8": "^3.1.3",
77
77
  "ajv": "^6.12.6",
78
78
  "cross-fetch": "*",
@@ -92,7 +92,7 @@
92
92
  "vitest": "^3.1.3"
93
93
  },
94
94
  "peerDependencies": {
95
- "@typescript-eslint/parser": "^8.42.1-alpha.8",
95
+ "@typescript-eslint/parser": "^8.42.1-alpha.9",
96
96
  "eslint": "^8.57.0 || ^9.0.0",
97
97
  "typescript": ">=4.8.4 <6.0.0"
98
98
  },