@typescript-eslint/typescript-estree 8.48.1-alpha.8 → 8.48.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/convert.js CHANGED
@@ -710,17 +710,16 @@ class Converter {
710
710
  }
711
711
  case SyntaxKind.VariableDeclaration: {
712
712
  const definite = !!node.exclamationToken;
713
- const init = this.convertChild(node.initializer);
714
- const id = this.convertBindingNameWithTypeAnnotation(node.name, node.type, node);
715
713
  if (definite) {
716
- if (init) {
714
+ if (node.initializer) {
717
715
  this.#throwError(node, 'Declarations with initializers cannot also have definite assignment assertions.');
718
716
  }
719
- else if (id.type !== ts_estree_1.AST_NODE_TYPES.Identifier ||
720
- !id.typeAnnotation) {
717
+ else if (node.name.kind !== SyntaxKind.Identifier || !node.type) {
721
718
  this.#throwError(node, 'Declarations with definite assignment assertions must also have type annotations.');
722
719
  }
723
720
  }
721
+ const init = this.convertChild(node.initializer);
722
+ const id = this.convertBindingNameWithTypeAnnotation(node.name, node.type, node);
724
723
  return this.createNode(node, {
725
724
  type: ts_estree_1.AST_NODE_TYPES.VariableDeclarator,
726
725
  definite,
@@ -155,6 +155,7 @@ export declare class TSError extends Error {
155
155
  offset: number;
156
156
  };
157
157
  };
158
+ name: string;
158
159
  constructor(message: string, fileName: string, location: {
159
160
  end: {
160
161
  column: number;
@@ -533,15 +533,11 @@ function convertTokens(ast) {
533
533
  class TSError extends Error {
534
534
  fileName;
535
535
  location;
536
+ name = 'TSError';
536
537
  constructor(message, fileName, location) {
537
538
  super(message);
538
539
  this.fileName = fileName;
539
540
  this.location = location;
540
- Object.defineProperty(this, 'name', {
541
- configurable: true,
542
- enumerable: false,
543
- value: new.target.name,
544
- });
545
541
  }
546
542
  // For old version of ESLint https://github.com/typescript-eslint/typescript-eslint/pull/6556#discussion_r1123237311
547
543
  get index() {
@@ -1,6 +1,6 @@
1
1
  import type { CacheDurationSeconds, DebugLevel, JSDocParsingMode, ProjectServiceOptions, SourceType } from '@typescript-eslint/types';
2
2
  import type * as ts from 'typescript';
3
- import type { TSESTree, TSESTreeToTSNode, TSToken } from './ts-estree';
3
+ import type { TSESTree, TSESTreeToTSNode, TSNode, TSToken } from './ts-estree';
4
4
  interface ParseOptions {
5
5
  /**
6
6
  * Specify the `sourceType`.
@@ -192,7 +192,7 @@ export interface ParserServicesBase {
192
192
  }
193
193
  export interface ParserServicesNodeMaps {
194
194
  esTreeNodeToTSNodeMap: ParserWeakMapESTreeToTSNode;
195
- tsNodeToESTreeNodeMap: ParserWeakMap<TSToken, TSESTree.Node>;
195
+ tsNodeToESTreeNodeMap: ParserWeakMap<TSNode | TSToken, TSESTree.Node>;
196
196
  }
197
197
  export interface ParserServicesWithTypeInformation extends ParserServicesNodeMaps, ParserServicesBase {
198
198
  getSymbolAtLocation: (node: TSESTree.Node) => ts.Symbol | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/typescript-estree",
3
- "version": "8.48.1-alpha.8",
3
+ "version": "8.48.1",
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.48.1-alpha.8",
56
- "@typescript-eslint/tsconfig-utils": "8.48.1-alpha.8",
57
- "@typescript-eslint/types": "8.48.1-alpha.8",
58
- "@typescript-eslint/visitor-keys": "8.48.1-alpha.8",
55
+ "@typescript-eslint/project-service": "8.48.1",
56
+ "@typescript-eslint/tsconfig-utils": "8.48.1",
57
+ "@typescript-eslint/types": "8.48.1",
58
+ "@typescript-eslint/visitor-keys": "8.48.1",
59
59
  "debug": "^4.3.4",
60
60
  "minimatch": "^9.0.4",
61
61
  "semver": "^7.6.0",