@typescript-eslint/utils 6.18.1-alpha.2 → 6.18.1-alpha.4

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":"getParserServices.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/getParserServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,cAAc,EACd,iCAAiC,EAClC,MAAM,cAAc,CAAC;AAMtB;;;GAGG;AACH,iBAAS,iBAAiB,CACxB,WAAW,SAAS,MAAM,EAC1B,QAAQ,SAAS,SAAS,OAAO,EAAE,EAEnC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,GAC7D,iCAAiC,CAAC;AACrC;;;GAGG;AACH,iBAAS,iBAAiB,CACxB,WAAW,SAAS,MAAM,EAC1B,QAAQ,SAAS,SAAS,OAAO,EAAE,EAEnC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,EAC9D,+BAA+B,EAAE,KAAK,GACrC,iCAAiC,CAAC;AACrC;;;GAGG;AACH,iBAAS,iBAAiB,CACxB,WAAW,SAAS,MAAM,EAC1B,QAAQ,SAAS,SAAS,OAAO,EAAE,EAEnC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,EAC9D,+BAA+B,EAAE,IAAI,GACpC,cAAc,CAAC;AAClB;;;GAGG;AACH,iBAAS,iBAAiB,CACxB,WAAW,SAAS,MAAM,EAC1B,QAAQ,SAAS,SAAS,OAAO,EAAE,EAEnC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,EAC9D,+BAA+B,EAAE,OAAO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
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getParserServices = void 0;
4
- const ERROR_MESSAGE = 'You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.';
4
+ const parserPathSeemsToBeTSESLint_1 = require("./parserPathSeemsToBeTSESLint");
5
+ const ERROR_MESSAGE_REQUIRES_PARSER_SERVICES = 'You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.';
6
+ const ERROR_MESSAGE_UNKNOWN_PARSER = 'Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.';
5
7
  function getParserServices(context, allowWithoutFullTypeInformation = false) {
6
8
  // This check is unnecessary if the user is using the latest version of our parser.
7
9
  //
@@ -18,7 +20,7 @@ function getParserServices(context, allowWithoutFullTypeInformation = false) {
18
20
  context.parserServices?.esTreeNodeToTSNodeMap == null ||
19
21
  // eslint-disable-next-line deprecation/deprecation, @typescript-eslint/no-unnecessary-condition -- TODO - support for ESLint v9 with backwards-compatible support for ESLint v8
20
22
  context.parserServices.tsNodeToESTreeNodeMap == null) {
21
- throw new Error(ERROR_MESSAGE);
23
+ throwError(context.parserPath);
22
24
  }
23
25
  // if a rule requires full type information, then hard fail if it doesn't exist
24
26
  // this forces the user to supply parserOptions.project
@@ -26,10 +28,19 @@ function getParserServices(context, allowWithoutFullTypeInformation = false) {
26
28
  // eslint-disable-next-line deprecation/deprecation -- TODO - support for ESLint v9 with backwards-compatible support for ESLint v8
27
29
  context.parserServices.program == null &&
28
30
  !allowWithoutFullTypeInformation) {
29
- throw new Error(ERROR_MESSAGE);
31
+ throwError(context.parserPath);
30
32
  }
31
33
  // eslint-disable-next-line deprecation/deprecation -- TODO - support for ESLint v9 with backwards-compatible support for ESLint v8
32
34
  return context.parserServices;
33
35
  }
34
36
  exports.getParserServices = getParserServices;
37
+ /* eslint-enable @typescript-eslint/unified-signatures */
38
+ function throwError(parserPath) {
39
+ throw new Error((0, parserPathSeemsToBeTSESLint_1.parserPathSeemsToBeTSESLint)(parserPath)
40
+ ? ERROR_MESSAGE_REQUIRES_PARSER_SERVICES
41
+ : [
42
+ ERROR_MESSAGE_REQUIRES_PARSER_SERVICES,
43
+ ERROR_MESSAGE_UNKNOWN_PARSER,
44
+ ].join('\n'));
45
+ }
35
46
  //# sourceMappingURL=getParserServices.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getParserServices.js","sourceRoot":"","sources":["../../src/eslint-utils/getParserServices.ts"],"names":[],"mappings":";;;AAMA,MAAM,aAAa,GACjB,gLAAgL,CAAC;AA+CnL,SAAS,iBAAiB,CACxB,OAA0D,EAC1D,+BAA+B,GAAG,KAAK;IAEvC,mFAAmF;IACnF,EAAE;IACF,mCAAmC;IACnC,yCAAyC;IACzC,yGAAyG;IACzG,sEAAsE;IACtE,0FAA0F;IAC1F,EAAE;IACF,qFAAqF;IACrF,wCAAwC;IACxC;IACE,mIAAmI;IACnI,OAAO,CAAC,cAAc,EAAE,qBAAqB,IAAI,IAAI;QACrD,gLAAgL;QAChL,OAAO,CAAC,cAAc,CAAC,qBAAqB,IAAI,IAAI,EACpD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;IAED,+EAA+E;IAC/E,uDAAuD;IACvD;IACE,mIAAmI;IACnI,OAAO,CAAC,cAAc,CAAC,OAAO,IAAI,IAAI;QACtC,CAAC,+BAA+B,EAChC,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;IAED,mIAAmI;IACnI,OAAO,OAAO,CAAC,cAAc,CAAC;AAChC,CAAC;AAGQ,8CAAiB"}
1
+ {"version":3,"file":"getParserServices.js","sourceRoot":"","sources":["../../src/eslint-utils/getParserServices.ts"],"names":[],"mappings":";;;AAKA,+EAA4E;AAE5E,MAAM,sCAAsC,GAC1C,gLAAgL,CAAC;AAEnL,MAAM,4BAA4B,GAChC,mKAAmK,CAAC;AA+CtK,SAAS,iBAAiB,CACxB,OAA0D,EAC1D,+BAA+B,GAAG,KAAK;IAEvC,mFAAmF;IACnF,EAAE;IACF,mCAAmC;IACnC,yCAAyC;IACzC,yGAAyG;IACzG,sEAAsE;IACtE,0FAA0F;IAC1F,EAAE;IACF,qFAAqF;IACrF,wCAAwC;IACxC;IACE,mIAAmI;IACnI,OAAO,CAAC,cAAc,EAAE,qBAAqB,IAAI,IAAI;QACrD,gLAAgL;QAChL,OAAO,CAAC,cAAc,CAAC,qBAAqB,IAAI,IAAI,EACpD,CAAC;QACD,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAED,+EAA+E;IAC/E,uDAAuD;IACvD;IACE,mIAAmI;IACnI,OAAO,CAAC,cAAc,CAAC,OAAO,IAAI,IAAI;QACtC,CAAC,+BAA+B,EAChC,CAAC;QACD,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAED,mIAAmI;IACnI,OAAO,OAAO,CAAC,cAAc,CAAC;AAChC,CAAC;AAcQ,8CAAiB;AAb1B,yDAAyD;AAEzD,SAAS,UAAU,CAAC,UAAkB;IACpC,MAAM,IAAI,KAAK,CACb,IAAA,yDAA2B,EAAC,UAAU,CAAC;QACrC,CAAC,CAAC,sCAAsC;QACxC,CAAC,CAAC;YACE,sCAAsC;YACtC,4BAA4B;SAC7B,CAAC,IAAI,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function parserPathSeemsToBeTSESLint(parserPath: string): boolean;
2
+ //# sourceMappingURL=parserPathSeemsToBeTSESLint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parserPathSeemsToBeTSESLint.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/parserPathSeemsToBeTSESLint.ts"],"names":[],"mappings":"AAAA,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEvE"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parserPathSeemsToBeTSESLint = void 0;
4
+ function parserPathSeemsToBeTSESLint(parserPath) {
5
+ return /(?:typescript-eslint|\.\.)[\w/\\]*parser/.test(parserPath);
6
+ }
7
+ exports.parserPathSeemsToBeTSESLint = parserPathSeemsToBeTSESLint;
8
+ //# sourceMappingURL=parserPathSeemsToBeTSESLint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parserPathSeemsToBeTSESLint.js","sourceRoot":"","sources":["../../src/eslint-utils/parserPathSeemsToBeTSESLint.ts"],"names":[],"mappings":";;;AAAA,SAAgB,2BAA2B,CAAC,UAAkB;IAC5D,OAAO,0CAA0C,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACrE,CAAC;AAFD,kEAEC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/utils",
3
- "version": "6.18.1-alpha.2",
3
+ "version": "6.18.1-alpha.4",
4
4
  "description": "Utilities for working with TypeScript + ESLint together",
5
5
  "files": [
6
6
  "dist",
@@ -68,16 +68,16 @@
68
68
  "@eslint-community/eslint-utils": "^4.4.0",
69
69
  "@types/json-schema": "^7.0.12",
70
70
  "@types/semver": "^7.5.0",
71
- "@typescript-eslint/scope-manager": "6.18.1-alpha.2",
72
- "@typescript-eslint/types": "6.18.1-alpha.2",
73
- "@typescript-eslint/typescript-estree": "6.18.1-alpha.2",
71
+ "@typescript-eslint/scope-manager": "6.18.1-alpha.4",
72
+ "@typescript-eslint/types": "6.18.1-alpha.4",
73
+ "@typescript-eslint/typescript-estree": "6.18.1-alpha.4",
74
74
  "semver": "^7.5.4"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "eslint": "^7.0.0 || ^8.0.0"
78
78
  },
79
79
  "devDependencies": {
80
- "@typescript-eslint/parser": "6.18.1-alpha.2",
80
+ "@typescript-eslint/parser": "6.18.1-alpha.4",
81
81
  "downlevel-dts": "*",
82
82
  "jest": "29.7.0",
83
83
  "prettier": "^3.0.3",