mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[ts] Check .d.ts files for all projects in typeCheck (#114295)
* enable --skip-lib-check for all projects in typeCheck and fix existing issues * fix graph types * transpile TS to ES2019, but not all the way back to es5 Co-authored-by: spalger <spalger@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
da8264f26a
commit
6c5dd08712
4 changed files with 7 additions and 23 deletions
|
@ -53,23 +53,8 @@ export async function runTypeCheckCli() {
|
|||
}
|
||||
}
|
||||
|
||||
const nonCompositeProjects = projects.filter((p) => !p.isCompositeProject());
|
||||
if (!nonCompositeProjects.length) {
|
||||
if (projectFilter) {
|
||||
log.success(
|
||||
`${flags.project} is a composite project so its types are validated by scripts/build_ts_refs`
|
||||
);
|
||||
} else {
|
||||
log.success(
|
||||
`All projects are composite so their types are validated by scripts/build_ts_refs`
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const concurrency = Math.min(4, Math.round((Os.cpus() || []).length / 2) || 1) || 1;
|
||||
log.info('running type check in', nonCompositeProjects.length, 'non-composite projects');
|
||||
log.info('running type check in', projects.length, 'projects');
|
||||
|
||||
const tscArgs = [
|
||||
...['--emitDeclarationOnly', 'false'],
|
||||
|
@ -81,7 +66,7 @@ export async function runTypeCheckCli() {
|
|||
];
|
||||
|
||||
const failureCount = await lastValueFrom(
|
||||
Rx.from(nonCompositeProjects).pipe(
|
||||
Rx.from(projects).pipe(
|
||||
mergeMap(async (p) => {
|
||||
const relativePath = Path.relative(process.cwd(), p.tsConfigPath);
|
||||
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { Workspace, WorkspaceOptions } from '../types';
|
||||
import { Workspace, WorkspaceOptions } from '../../types';
|
||||
|
||||
declare function createWorkspace(options: WorkspaceOptions): Workspace;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
declare module 'puid' {
|
||||
declare class Puid {
|
||||
class Puid {
|
||||
generate(): string;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,15 +8,14 @@
|
|||
"target/**/*"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": ["es5", "dom"],
|
||||
"target": "ES2019",
|
||||
"outDir": "target/types",
|
||||
"types": [
|
||||
"cypress",
|
||||
"cypress-pipe",
|
||||
"node"
|
||||
"node",
|
||||
"resize-observer-polyfill",
|
||||
],
|
||||
"resolveJsonModule": true,
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../tsconfig.json" }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue