@typescript-eslint/typescript-estree 8.52.1-alpha.1 → 8.52.1-alpha.3

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.
@@ -90,19 +90,12 @@ function checkSyntaxError(tsNode, parent, allowPattern) {
90
90
  if (node.parent.kind === SyntaxKind.VariableDeclarationList) {
91
91
  const variableDeclarationList = node.parent;
92
92
  const kind = (0, node_utils_1.getDeclarationKind)(variableDeclarationList);
93
- if ((variableDeclarationList.parent.kind === SyntaxKind.ForInStatement ||
94
- variableDeclarationList.parent.kind === SyntaxKind.ForStatement) &&
95
- (kind === 'using' || kind === 'await using')) {
96
- if (!node.initializer) {
97
- throw (0, node_utils_1.createError)(node, `'${kind}' declarations may not be initialized in for statement.`);
93
+ if (kind === 'using' || kind === 'await using') {
94
+ if (variableDeclarationList.parent.kind === SyntaxKind.ForInStatement) {
95
+ throw (0, node_utils_1.createError)(variableDeclarationList, `The left-hand side of a 'for...in' statement cannot be a '${kind}' declaration.`);
98
96
  }
99
- if (node.name.kind !== SyntaxKind.Identifier) {
100
- throw (0, node_utils_1.createError)(node.name, `'${kind}' declarations may not have binding patterns.`);
101
- }
102
- }
103
- if (variableDeclarationList.parent.kind === SyntaxKind.VariableStatement) {
104
- const variableStatement = variableDeclarationList.parent;
105
- if (kind === 'using' || kind === 'await using') {
97
+ if (variableDeclarationList.parent.kind === SyntaxKind.ForStatement ||
98
+ variableDeclarationList.parent.kind === SyntaxKind.VariableStatement) {
106
99
  if (!node.initializer) {
107
100
  throw (0, node_utils_1.createError)(node, `'${kind}' declarations must be initialized.`);
108
101
  }
@@ -110,6 +103,9 @@ function checkSyntaxError(tsNode, parent, allowPattern) {
110
103
  throw (0, node_utils_1.createError)(node.name, `'${kind}' declarations may not have binding patterns.`);
111
104
  }
112
105
  }
106
+ }
107
+ if (variableDeclarationList.parent.kind === SyntaxKind.VariableStatement) {
108
+ const variableStatement = variableDeclarationList.parent;
113
109
  const hasDeclareKeyword = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, variableStatement);
114
110
  // Definite assignment only allowed for non-declare let and var
115
111
  if ((hasDeclareKeyword ||
@@ -386,10 +382,6 @@ function checkForStatementDeclaration(node) {
386
382
  else if (declaration.type) {
387
383
  throw (0, node_utils_1.createError)(declaration, `The variable declaration of a '${loop}' statement cannot have a type annotation.`);
388
384
  }
389
- if (kind === SyntaxKind.ForInStatement &&
390
- initializer.flags & ts.NodeFlags.Using) {
391
- throw (0, node_utils_1.createError)(initializer, "The left-hand side of a 'for...in' statement cannot be a 'using' declaration.");
392
- }
393
385
  }
394
386
  else if (!(0, node_utils_1.isValidAssignmentTarget)(initializer) &&
395
387
  initializer.kind !== SyntaxKind.ObjectLiteralExpression &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/typescript-estree",
3
- "version": "8.52.1-alpha.1",
3
+ "version": "8.52.1-alpha.3",
4
4
  "description": "A parser that converts TypeScript source code into an ESTree compatible form",
5
5
  "files": [
6
6
  "dist",
@@ -52,10 +52,10 @@
52
52
  "typecheck": "yarn run -BT nx typecheck"
53
53
  },
54
54
  "dependencies": {
55
- "@typescript-eslint/project-service": "8.52.1-alpha.1",
56
- "@typescript-eslint/tsconfig-utils": "8.52.1-alpha.1",
57
- "@typescript-eslint/types": "8.52.1-alpha.1",
58
- "@typescript-eslint/visitor-keys": "8.52.1-alpha.1",
55
+ "@typescript-eslint/project-service": "8.52.1-alpha.3",
56
+ "@typescript-eslint/tsconfig-utils": "8.52.1-alpha.3",
57
+ "@typescript-eslint/types": "8.52.1-alpha.3",
58
+ "@typescript-eslint/visitor-keys": "8.52.1-alpha.3",
59
59
  "debug": "^4.4.3",
60
60
  "minimatch": "^9.0.5",
61
61
  "semver": "^7.7.3",