chore: standardize tsconfig (#9568)

This commit is contained in:
forehalo
2025-01-08 04:07:56 +00:00
parent 39f4b17315
commit c0ed74dfed
151 changed files with 1041 additions and 1566 deletions
+15 -14
View File
@@ -1,20 +1,21 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": false,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"noEmit": true,
"composite": false
"rootDir": ".",
"outDir": "./dist",
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
},
"include": ["./apps", "./examples"],
"references": [{ "path": "./tsconfig.node.json" }]
"references": [
{ "path": "../affine/components" },
{ "path": "../affine/model" },
{ "path": "../framework/block-std" },
{ "path": "../blocks" },
{ "path": "../affine/data-view" },
{ "path": "../framework/global" },
{ "path": "../framework/inline" },
{ "path": "../presets" },
{ "path": "../framework/store" },
{ "path": "../framework/sync" }
]
}
+6 -4
View File
@@ -1,9 +1,11 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
"allowSyntheticDefaultImports": true,
"noUncheckedIndexedAccess": false,
"rootDir": ".",
"outDir": "./lib",
"tsBuildInfoFile": "./lib/tsconfig.tsbuildinfo"
},
"include": ["vite.config.ts", "./scripts"]
}
+11 -5
View File
@@ -29,6 +29,8 @@ export function sourcemapExclude(): Plugin {
map: { mappings: '' },
};
}
return undefined;
},
};
}
@@ -157,10 +159,10 @@ const clearSiteDataPlugin = () =>
}) as Plugin;
// https://vitejs.dev/config/
export default ({ mode }) => {
export default defineConfig(({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, __dirname, '') };
return defineConfig({
return {
envDir: __dirname,
define: {
'import.meta.env.PLAYGROUND_SERVER': JSON.stringify(
@@ -200,7 +202,10 @@ export default ({ mode }) => {
cache: false,
maxParallelFileOps: Math.max(1, cpus().length - 1),
onwarn(warning, defaultHandler) {
if (['EVAL', 'SOURCEMAP_ERROR'].includes(warning.code)) {
if (
warning.code &&
['EVAL', 'SOURCEMAP_ERROR'].includes(warning.code)
) {
return;
}
@@ -252,10 +257,11 @@ export default ({ mode }) => {
}
return group;
}
return undefined;
}
},
},
},
},
});
};
};
});