@typescript-eslint/parser 8.64.1-alpha.1 → 8.64.1-alpha.10

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.js CHANGED
@@ -1,6 +1,53 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  Object.defineProperty(exports, "__esModule", { value: true });
3
36
  exports.meta = exports.version = exports.withoutProjectParserOptions = exports.createProgram = exports.clearCaches = exports.parseForESLint = exports.parse = void 0;
37
+ const ts = __importStar(require("typescript"));
38
+ // intentionally executing code before rest of the require()s. This will not work with ESM.
39
+ const [versionMajor, _versionMinor] = ts.versionMajorMinor
40
+ .split('.')
41
+ .map(Number);
42
+ if (versionMajor >= 7) {
43
+ // eslint-disable-next-line no-console
44
+ console.error([
45
+ 'typescript-eslint does not support TS 7.0.',
46
+ 'Please see https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0 to run typescript-eslint using the TS 6 API.',
47
+ "See also https://github.com/typescript-eslint/typescript-eslint/issues/10940 for tracking typescript-eslint's support for TS >=7.1",
48
+ ].join('\n'));
49
+ throw new Error('typescript-eslint does not support TS 7.0.');
50
+ }
4
51
  var parser_1 = require("./parser");
5
52
  Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parser_1.parse; } });
6
53
  Object.defineProperty(exports, "parseForESLint", { enumerable: true, get: function () { return parser_1.parseForESLint; } });
package/dist/parser.js CHANGED
@@ -77,15 +77,20 @@ function parseForESLint(code, parserOptions) {
77
77
  if (typeof parserOptions.ecmaFeatures !== 'object') {
78
78
  parserOptions.ecmaFeatures = {};
79
79
  }
80
- /**
81
- * Allow the user to suppress the warning from typescript-estree if they are using an unsupported
82
- * version of TypeScript
83
- */
84
- const warnOnUnsupportedTypeScriptVersion = validateBoolean(parserOptions.warnOnUnsupportedTypeScriptVersion, true);
80
+ if (parserOptions.onUnsupportedTypeScriptVersion != null &&
81
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- read for backwards compatibility
82
+ parserOptions.warnOnUnsupportedTypeScriptVersion != null) {
83
+ throw new Error('Cannot use both the `onUnsupportedTypeScriptVersion` and the deprecated `warnOnUnsupportedTypeScriptVersion` options. Please use only `onUnsupportedTypeScriptVersion`.');
84
+ }
85
+ const onUnsupportedTypeScriptVersion = parserOptions.onUnsupportedTypeScriptVersion ??
86
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- read for backwards compatibility
87
+ (validateBoolean(parserOptions.warnOnUnsupportedTypeScriptVersion, true)
88
+ ? 'warn'
89
+ : 'ignore');
85
90
  const tsestreeOptions = {
86
91
  jsx: validateBoolean(parserOptions.ecmaFeatures.jsx),
87
- ...(!warnOnUnsupportedTypeScriptVersion && { loggerFn: false }),
88
92
  ...parserOptions,
93
+ onUnsupportedTypeScriptVersion,
89
94
  // Override errorOnTypeScriptSyntacticAndSemanticIssues and set it to false to prevent use from user config
90
95
  // https://github.com/typescript-eslint/typescript-eslint/issues/8681#issuecomment-2000411834
91
96
  errorOnTypeScriptSyntacticAndSemanticIssues: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/parser",
3
- "version": "8.64.1-alpha.1",
3
+ "version": "8.64.1-alpha.10",
4
4
  "description": "An ESLint custom parser which leverages TypeScript ESTree",
5
5
  "files": [
6
6
  "dist",
@@ -42,10 +42,10 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "debug": "^4.4.3",
45
- "@typescript-eslint/typescript-estree": "8.64.1-alpha.1",
46
- "@typescript-eslint/types": "8.64.1-alpha.1",
47
- "@typescript-eslint/visitor-keys": "8.64.1-alpha.1",
48
- "@typescript-eslint/scope-manager": "8.64.1-alpha.1"
45
+ "@typescript-eslint/scope-manager": "8.64.1-alpha.10",
46
+ "@typescript-eslint/typescript-estree": "8.64.1-alpha.10",
47
+ "@typescript-eslint/types": "8.64.1-alpha.10",
48
+ "@typescript-eslint/visitor-keys": "8.64.1-alpha.10"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@typescript/native-preview": "7.0.0-dev.20260518.1",
@@ -69,7 +69,8 @@
69
69
  "lint": {
70
70
  "command": "eslint"
71
71
  },
72
- "typecheck:tsgo": {}
72
+ "typecheck:tsgo": {},
73
+ "attw-check": {}
73
74
  }
74
75
  },
75
76
  "scripts": {
@@ -79,6 +80,7 @@
79
80
  "lint": "pnpm -w exec nx lint",
80
81
  "test": "pnpm -w exec nx test",
81
82
  "typecheck": "pnpm -w exec nx typecheck",
82
- "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo"
83
+ "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo",
84
+ "attw-check": "pnpm -w exec nx attw-check"
83
85
  }
84
86
  }