@typescript-eslint/typescript-estree 8.40.1-alpha.0 → 8.40.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.
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/create-program/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC;IACnB,OAAO,EAAE,IAAI,CAAC;CACf;AACD,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC;IACnB,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;CACrB;AACD,MAAM,MAAM,aAAa,GAAG,qBAAqB,GAAG,eAAe,CAAC;AAYpE,eAAO,MAAM,6BAA6B,aASxC,CAAC;AAEH,wBAAgB,qCAAqC,CACnD,aAAa,EAAE,aAAa,GAC3B,EAAE,CAAC,eAAe,CASpB;AAGD,MAAM,MAAM,aAAa,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAAC;AAU1D,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAMpE;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAI7E;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,aAAa,GAAG,aAAa,CAEhE;AAmBD,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,OAAO,EACvB,QAAQ,EAAE,MAAM,GACf,qBAAqB,GAAG,SAAS,CAWnC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOlD"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/create-program/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1C,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC;IACnB,OAAO,EAAE,IAAI,CAAC;CACf;AACD,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC;IACnB,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;CACrB;AACD,MAAM,MAAM,aAAa,GAAG,qBAAqB,GAAG,eAAe,CAAC;AAYpE,eAAO,MAAM,6BAA6B,aASxC,CAAC;AAEH,wBAAgB,qCAAqC,CACnD,aAAa,EAAE,aAAa,GAC3B,EAAE,CAAC,eAAe,CASpB;AAGD,MAAM,MAAM,aAAa,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAAC;AAU1D,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAMpE;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,aAAa,GAAG,aAAa,CAEhE;AAmBD,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,OAAO,EACvB,QAAQ,EAAE,MAAM,GACf,qBAAqB,GAAG,SAAS,CAWnC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOlD"}
@@ -89,9 +89,7 @@ function getCanonicalFileName(filePath) {
89
89
  return correctPathCasing(normalized);
90
90
  }
91
91
  function ensureAbsolutePath(p, tsconfigRootDir) {
92
- return node_path_1.default.isAbsolute(p)
93
- ? p
94
- : node_path_1.default.join(tsconfigRootDir || process.cwd(), p);
92
+ return node_path_1.default.resolve(tsconfigRootDir, p);
95
93
  }
96
94
  function canonicalDirname(p) {
97
95
  return node_path_1.default.dirname(p);
@@ -1 +1 @@
1
- {"version":3,"file":"createParseSettings.d.ts","sourceRoot":"","sources":["../../src/parseSettings/createParseSettings.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAkCpD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,EAC5B,eAAe,GAAE,OAAO,CAAC,eAAe,CAAM,GAC7C,oBAAoB,CAwJtB;AAED,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
1
+ {"version":3,"file":"createParseSettings.d.ts","sourceRoot":"","sources":["../../src/parseSettings/createParseSettings.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAkCpD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,EAC5B,eAAe,GAAE,OAAO,CAAC,eAAe,CAAM,GAC7C,oBAAoB,CA0LtB;AAED,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
@@ -69,9 +69,28 @@ const JSDocParsingMode = {
69
69
  function createParseSettings(code, tsestreeOptions = {}) {
70
70
  const codeFullText = enforceCodeString(code);
71
71
  const singleRun = (0, inferSingleRun_1.inferSingleRun)(tsestreeOptions);
72
- const tsconfigRootDir = typeof tsestreeOptions.tsconfigRootDir === 'string'
73
- ? tsestreeOptions.tsconfigRootDir
74
- : (0, candidateTSConfigRootDirs_1.getInferredTSConfigRootDir)();
72
+ const tsconfigRootDir = (() => {
73
+ if (tsestreeOptions.tsconfigRootDir == null) {
74
+ const inferredTsconfigRootDir = (0, candidateTSConfigRootDirs_1.getInferredTSConfigRootDir)();
75
+ if (node_path_1.default.resolve(inferredTsconfigRootDir) !== inferredTsconfigRootDir) {
76
+ throw new Error(`inferred tsconfigRootDir should be a resolved absolute path, but received: ${JSON.stringify(inferredTsconfigRootDir)}. This is a bug in typescript-eslint! Please report it to us at https://github.com/typescript-eslint/typescript-eslint/issues/new/choose.`);
77
+ }
78
+ return inferredTsconfigRootDir;
79
+ }
80
+ if (typeof tsestreeOptions.tsconfigRootDir === 'string') {
81
+ const userProvidedTsconfigRootDir = tsestreeOptions.tsconfigRootDir;
82
+ if (!node_path_1.default.isAbsolute(userProvidedTsconfigRootDir) ||
83
+ // Ensure it's fully absolute with a drive letter if windows
84
+ (process.platform === 'win32' &&
85
+ !/^[a-zA-Z]:/.test(userProvidedTsconfigRootDir))) {
86
+ throw new Error(`parserOptions.tsconfigRootDir must be an absolute path, but received: ${JSON.stringify(userProvidedTsconfigRootDir)}. This is a bug in your configuration; please supply an absolute path.`);
87
+ }
88
+ // Deal with any funny business around trailing path separators (a/b/) or relative path segments (/a/b/../c)
89
+ // Since we already know it's absolute, we can safely use path.resolve here.
90
+ return node_path_1.default.resolve(userProvidedTsconfigRootDir);
91
+ }
92
+ throw new Error(`If provided, parserOptions.tsconfigRootDir must be a string, but received a value of type "${typeof tsestreeOptions.tsconfigRootDir}"`);
93
+ })();
75
94
  const passedLoggerFn = typeof tsestreeOptions.loggerFn === 'function';
76
95
  const filePath = (0, shared_1.ensureAbsolutePath)(typeof tsestreeOptions.filePath === 'string' &&
77
96
  tsestreeOptions.filePath !== '<input>'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typescript-eslint/typescript-estree",
3
- "version": "8.40.1-alpha.0",
3
+ "version": "8.40.1-alpha.10",
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.40.1-alpha.0",
56
- "@typescript-eslint/tsconfig-utils": "8.40.1-alpha.0",
57
- "@typescript-eslint/types": "8.40.1-alpha.0",
58
- "@typescript-eslint/visitor-keys": "8.40.1-alpha.0",
55
+ "@typescript-eslint/project-service": "8.40.1-alpha.10",
56
+ "@typescript-eslint/tsconfig-utils": "8.40.1-alpha.10",
57
+ "@typescript-eslint/types": "8.40.1-alpha.10",
58
+ "@typescript-eslint/visitor-keys": "8.40.1-alpha.10",
59
59
  "debug": "^4.3.4",
60
60
  "fast-glob": "^3.3.2",
61
61
  "is-glob": "^4.0.3",