xo 3.0.0 → 3.0.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/lib/handle-ts-files.js +5 -1
- package/dist/lib/xo.js +2 -0
- package/package.json +1 -1
|
@@ -63,11 +63,15 @@ const getFallbackCompilerOptions = (cwd) => {
|
|
|
63
63
|
}
|
|
64
64
|
const compilerOptions = {
|
|
65
65
|
...compilerOptionsResult.options,
|
|
66
|
+
// Anchor module and `@types` resolution to the project directory. Without `configFilePath`, an option-only program resolves these from `process.cwd()`, which differs from `cwd` for programmatic callers. The file need not exist; only its directory is used.
|
|
67
|
+
configFilePath: path.join(cacheKey, 'tsconfig.json'),
|
|
66
68
|
esModuleInterop: true,
|
|
67
|
-
|
|
69
|
+
resolveJsonModule: true,
|
|
68
70
|
allowJs: true,
|
|
69
71
|
skipLibCheck: true,
|
|
70
72
|
skipDefaultLibCheck: true,
|
|
73
|
+
// TypeScript 6 only auto-includes `@types/*` packages when `types` contains `'*'`. Without this, files outside the tsconfig resolve imports to `any` and type-aware rules misfire.
|
|
74
|
+
types: ['*'],
|
|
71
75
|
};
|
|
72
76
|
fallbackCompilerOptionsCache.set(cacheKey, compilerOptions);
|
|
73
77
|
return compilerOptions;
|
package/dist/lib/xo.js
CHANGED
|
@@ -344,6 +344,8 @@ export class Xo {
|
|
|
344
344
|
moduleResolution: 'NodeNext',
|
|
345
345
|
esModuleInterop: true,
|
|
346
346
|
skipLibCheck: true,
|
|
347
|
+
// TypeScript 6 only auto-includes `@types/*` packages when `types` contains `'*'`. Without this, virtual/stdin files resolve imports to `any` and type-aware rules misfire.
|
|
348
|
+
types: ['*'],
|
|
347
349
|
},
|
|
348
350
|
files: filesArray,
|
|
349
351
|
};
|