Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions .github/workflows/translationDryRun.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
types: [opened, synchronize]
branches-ignore: [staging, production]
paths: ['**.js', '**.ts', '**.tsx', 'package.json', 'package-lock.json', '**/tsconfig.json']
paths: ['**.js', '**.ts', '**.tsx', 'package.json', 'package-lock.json', '**/tsconfig*.json']

concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('{0}-{1}', github.ref, github.sha) || github.ref }}-typecheck
Expand Down
34 changes: 4 additions & 30 deletions config/eslint/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -715,46 +715,20 @@ const config = defineConfig([
},

{
files: ['server/**/*.ts', 'server/**/*.tsx'],
files: ['scripts/**/*.ts', 'tests/tooling/**/*.ts', 'server/{libs,plugins,stubs}/**/*.{ts,tsx}', 'evals/**/*.ts'],
languageOptions: {
parserOptions: {
project: path.resolve(projectRoot, 'server/tsconfig.json'),
project: path.resolve(projectRoot, 'tsconfig.bun.json'),
projectService: false,
},
},
},

{
// Its own project because `@types/bun`'s globals conflict with the app's, so it is excluded from
// the root tsconfig and would otherwise belong to no project at all.
files: ['evals/**/*.ts'],
files: ['.github/**/*.{ts,tsx,js}', 'web/proxy.ts', 'config/**/*.{ts,tsx,mts,mjs,cjs,js}'],
languageOptions: {
parserOptions: {
project: path.resolve(projectRoot, 'evals/tsconfig.json'),
projectService: false,
},
},
},

{
// CIGitLogic is excluded from the root tsconfig because it needs @types/bun, so type-aware rules have to
// be pointed at the project that does own it. See tests/tooling/README.md.
files: ['tests/tooling/CIGitLogic.test.ts'],
languageOptions: {
parserOptions: {
project: path.resolve(projectRoot, 'tests/tooling/tsconfig.json'),
projectService: false,
},
},
},

{
// Bun-only scripts are excluded from the root tsconfig because they need @types/bun, so type-aware rules
// have to be pointed at the project that owns them. See scripts/tsconfig.json.
files: ['scripts/applyPatches.ts', 'scripts/lint.ts', 'scripts/typecheck.ts'],
languageOptions: {
parserOptions: {
project: path.resolve(projectRoot, 'scripts/tsconfig.json'),
project: path.resolve(projectRoot, 'tsconfig.node.json'),
projectService: false,
},
},
Expand Down
2 changes: 1 addition & 1 deletion config/rsbuild/rsbuild.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ const getCommonConfiguration = async ({file = '.env', platform = 'web', isDevSer
...(sentryWebpackPlugin
? ([
sentryWebpackPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN as string | undefined,
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'expensify',
project: 'app',
release: {
Expand Down
21 changes: 0 additions & 21 deletions evals/tsconfig.json

This file was deleted.

24 changes: 0 additions & 24 deletions scripts/tsconfig.json

This file was deleted.

13 changes: 7 additions & 6 deletions scripts/typecheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Type-check the repo with the TypeScript 7 native compiler.
*
* bun scripts/typecheck.ts -> check every project CI gates on
* bun scripts/typecheck.ts evals -> check just the named project directories
* bun scripts/typecheck.ts tsconfig.bun.json -> check just the named project
*
* Every project is checked even after one fails, so a single run reports every error in the repo.
*/
Expand All @@ -18,14 +18,14 @@ const projectRoot = `${import.meta.dir}/..`;
// Invoke that bin by path so a leftover `.bin/tsc` from `@typescript/old` cannot win.
const tsc = `${projectRoot}/node_modules/typescript/bin/tsc`;

/** Project directories, relative to the repo root, that `npm run typecheck` and CI check. */
const DEFAULT_PROJECTS = ['.', 'tests/tooling', 'server', 'server/victory-chart-renderer', 'scripts'];
/** TypeScript projects, relative to the repo root, that `npm run typecheck` and CI check. */
const DEFAULT_PROJECTS = ['tsconfig.json', 'tsconfig.bun.json', 'tsconfig.node.json', 'server/victory-chart-renderer/tsconfig.json'];

const cli = new CLI({
positionalArgs: [
{
name: 'projects',
description: 'Project directories to type-check, relative to the repo root (default: the five CI-gated projects)',
description: 'tsconfig paths to type-check, relative to the repo root',
variadic: true,
default: DEFAULT_PROJECTS,
},
Expand All @@ -36,13 +36,14 @@ const {projects} = cli.positionalArgs;

const failed: string[] = [];
for (const project of projects) {
const tsconfig = `${project}/tsconfig.json`;
const tsconfig = project.endsWith('.json') ? project : `${project}/tsconfig.json`;
console.log(`\nType checking ${tsconfig}...`);

// The build info file lets repeat runs skip unchanged projects. It is named apart from the
// `tsconfig.tsbuildinfo` that `incremental` defaults to so that running TypeScript 6 by hand in
// the same worktree can't feed it a build info file written by a different compiler.
const result = await $`${tsc} --noEmit --incremental -p ${tsconfig} --tsBuildInfoFile ${project}/tsconfig.ts7.tsbuildinfo`.cwd(projectRoot).nothrow();
const tsBuildInfoFile = `${tsconfig.replace(/\.json$/, '')}.ts7.tsbuildinfo`;
const result = await $`${tsc} --noEmit --incremental -p ${tsconfig} --tsBuildInfoFile ${tsBuildInfoFile}`.cwd(projectRoot).nothrow();
if (result.exitCode !== 0) {
failed.push(tsconfig);
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function execSync(command: string, options?: ExecSyncOptions) {
}

const IS_CI = process.env.CI === 'true';
const GITHUB_BASE_REF = process.env.GITHUB_BASE_REF as string | undefined;
const GITHUB_BASE_REF = process.env.GITHUB_BASE_REF;

/**
* Represents a single changed line in a git diff.
Expand Down
25 changes: 0 additions & 25 deletions server/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion server/victory-chart-renderer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../tsconfig.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["react-native", "react-native-web", "node"]
},
Expand Down
Loading
Loading