mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 22:09:08 +08:00
chore: standardize tsconfig (#9568)
This commit is contained in:
+86
-140
@@ -1,171 +1,117 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"verbatimModuleSyntax": true,
|
||||
// Classification follows https://www.typescriptlang.org/tsconfig
|
||||
// Type Checking
|
||||
// Strictness
|
||||
"strict": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"exactOptionalPropertyTypes": false,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitOverride": true,
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitThis": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noPropertyAccessFromIndexSignature": false,
|
||||
"noUncheckedIndexedAccess": false,
|
||||
"useUnknownInCatchVariables": true,
|
||||
"skipLibCheck": true,
|
||||
|
||||
// Modules
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"types": ["affine__env"],
|
||||
"typeRoots": ["./tools/@types", "./node_modules/@types"],
|
||||
|
||||
// Emit
|
||||
"lib": ["ESNext"],
|
||||
"target": "ES2024",
|
||||
"useDefineForClassFields": false,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
// skip type emit for @internal types
|
||||
// "stripInternal": true,
|
||||
// JavaScript Support
|
||||
"allowJs": false,
|
||||
"checkJs": false,
|
||||
"importsNotUsedAsValues": "remove",
|
||||
|
||||
// Interop Constraints
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"isolatedModules": true,
|
||||
// Language and Environment
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "@emotion/react",
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"target": "ES2022",
|
||||
"useDefineForClassFields": false,
|
||||
"experimentalDecorators": false,
|
||||
"emitDecoratorMetadata": false,
|
||||
// Projects
|
||||
|
||||
// Composite
|
||||
"composite": true,
|
||||
"incremental": true,
|
||||
// For dev performance
|
||||
"disableReferencedProjectLoad": true,
|
||||
// Completeness
|
||||
"skipLibCheck": true, // skip all type checks for .d.ts files
|
||||
|
||||
// NOTE(@forehalo):
|
||||
// We now "fully" resolve package exports by standard "exports" field in package.json
|
||||
// but core's exports are lit bit complex, so we left it here and will fix it when repos reorganization is done
|
||||
"paths": {
|
||||
"@affine/core/*": ["./packages/frontend/core/src/*"],
|
||||
"@affine/admin/*": ["./packages/frontend/admin/src/*"],
|
||||
"@affine/admin/components/ui/*": [
|
||||
"./packages/frontend/admin/src/components/ui/*"
|
||||
],
|
||||
"@affine/server/*": ["./packages/backend/server/src/*"],
|
||||
"@affine/component": ["./packages/frontend/component/src/index"],
|
||||
"@affine/component/*": [
|
||||
"./packages/frontend/component/src/components/*/index",
|
||||
"./packages/frontend/component/src/components/*"
|
||||
],
|
||||
"@affine/i18n": ["./packages/frontend/i18n/src"],
|
||||
"@affine/debug": ["./packages/common/debug"],
|
||||
"@affine/env": ["./packages/common/env/src"],
|
||||
"@affine/env/*": ["./packages/common/env/src/*"],
|
||||
"@affine/graphql": ["./packages/frontend/graphql/src"],
|
||||
"@affine/electron/scripts/*": ["./packages/frontend/electron/scripts/*"],
|
||||
"@affine-test/kit/*": ["./tests/kit/*"],
|
||||
"@toeverything/infra": ["./packages/common/infra/src"],
|
||||
"@affine/native": ["./packages/frontend/native/index.d.ts"],
|
||||
"@affine/native/*": ["./packages/frontend/native/*"],
|
||||
"@affine/server-native": ["./packages/backend/native/index.d.ts"],
|
||||
// Development only
|
||||
"@affine/electron/*": ["./packages/frontend/apps/electron/src/*"],
|
||||
"@affine/nbstore": ["./packages/common/nbstore/src"]
|
||||
"@affine/core/*": ["./packages/frontend/core/src/*"]
|
||||
}
|
||||
},
|
||||
"include": [],
|
||||
"references": [
|
||||
// Backend
|
||||
{
|
||||
"path": "./packages/backend/server"
|
||||
},
|
||||
{
|
||||
"path": "./packages/backend/server/tests"
|
||||
},
|
||||
// Frontend
|
||||
{
|
||||
"path": "./packages/frontend/admin"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/component"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/core"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/track"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/apps/web"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/apps/electron-renderer"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/apps/mobile"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/apps/ios"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/apps/android"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/apps/electron/tsconfig.test.json"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/graphql"
|
||||
},
|
||||
{
|
||||
"path": "./packages/frontend/i18n"
|
||||
},
|
||||
// Common
|
||||
{
|
||||
"path": "./packages/common/debug"
|
||||
},
|
||||
{
|
||||
"path": "./packages/common/env"
|
||||
},
|
||||
{
|
||||
"path": "./packages/common/infra"
|
||||
},
|
||||
{
|
||||
"path": "./packages/common/nbstore"
|
||||
},
|
||||
// Tools
|
||||
{
|
||||
"path": "./tools/cli"
|
||||
},
|
||||
{
|
||||
"path": "./tools/utils"
|
||||
},
|
||||
{
|
||||
"path": "./tools/playstore-auto-bump"
|
||||
},
|
||||
// Tests
|
||||
{
|
||||
"path": "./tests/kit"
|
||||
},
|
||||
{
|
||||
"path": "./tests/affine-local"
|
||||
},
|
||||
{
|
||||
"path": "./tests/affine-mobile"
|
||||
},
|
||||
{
|
||||
"path": "./tests/affine-cloud"
|
||||
},
|
||||
{
|
||||
"path": "./tests/affine-desktop"
|
||||
},
|
||||
// Blocksuite
|
||||
{
|
||||
"path": "./blocksuite/affine/all"
|
||||
}
|
||||
],
|
||||
"files": [],
|
||||
"exclude": ["node_modules", "target", "lib", "test-results", "dist"]
|
||||
"exclude": ["node_modules", "target", "dist", "lib"],
|
||||
// NOTE(@forehalo):
|
||||
// The references are generated by the cli, do not modify it manually
|
||||
// COMMAND: `yarn affine init`
|
||||
"references": [
|
||||
{ "path": "./blocksuite/affine/all" },
|
||||
{ "path": "./blocksuite/affine/block-attachment" },
|
||||
{ "path": "./blocksuite/affine/block-bookmark" },
|
||||
{ "path": "./blocksuite/affine/block-code" },
|
||||
{ "path": "./blocksuite/affine/block-data-view" },
|
||||
{ "path": "./blocksuite/affine/block-database" },
|
||||
{ "path": "./blocksuite/affine/block-divider" },
|
||||
{ "path": "./blocksuite/affine/block-edgeless-text" },
|
||||
{ "path": "./blocksuite/affine/block-embed" },
|
||||
{ "path": "./blocksuite/affine/block-frame" },
|
||||
{ "path": "./blocksuite/affine/block-image" },
|
||||
{ "path": "./blocksuite/affine/block-latex" },
|
||||
{ "path": "./blocksuite/affine/block-list" },
|
||||
{ "path": "./blocksuite/affine/block-note" },
|
||||
{ "path": "./blocksuite/affine/block-paragraph" },
|
||||
{ "path": "./blocksuite/affine/block-surface" },
|
||||
{ "path": "./blocksuite/affine/block-surface-ref" },
|
||||
{ "path": "./blocksuite/affine/components" },
|
||||
{ "path": "./blocksuite/affine/data-view" },
|
||||
{ "path": "./blocksuite/affine/model" },
|
||||
{ "path": "./blocksuite/affine/shared" },
|
||||
{ "path": "./blocksuite/affine/widget-drag-handle" },
|
||||
{ "path": "./blocksuite/affine/widget-frame-title" },
|
||||
{ "path": "./blocksuite/affine/widget-remote-selection" },
|
||||
{ "path": "./blocksuite/affine/widget-scroll-anchoring" },
|
||||
{ "path": "./blocksuite/blocks" },
|
||||
{ "path": "./blocksuite/framework/block-std" },
|
||||
{ "path": "./blocksuite/framework/global" },
|
||||
{ "path": "./blocksuite/framework/inline" },
|
||||
{ "path": "./blocksuite/framework/store" },
|
||||
{ "path": "./blocksuite/framework/sync" },
|
||||
{ "path": "./blocksuite/presets" },
|
||||
{ "path": "./packages/backend/native" },
|
||||
{ "path": "./packages/backend/server" },
|
||||
{ "path": "./packages/common/debug" },
|
||||
{ "path": "./packages/common/env" },
|
||||
{ "path": "./packages/common/infra" },
|
||||
{ "path": "./packages/common/nbstore" },
|
||||
{ "path": "./packages/frontend/admin" },
|
||||
{ "path": "./packages/frontend/apps/android" },
|
||||
{ "path": "./packages/frontend/apps/electron" },
|
||||
{ "path": "./packages/frontend/apps/electron-renderer" },
|
||||
{ "path": "./packages/frontend/apps/ios" },
|
||||
{ "path": "./packages/frontend/apps/mobile" },
|
||||
{ "path": "./packages/frontend/apps/web" },
|
||||
{ "path": "./packages/frontend/component" },
|
||||
{ "path": "./packages/frontend/core" },
|
||||
{ "path": "./packages/frontend/electron-api" },
|
||||
{ "path": "./packages/frontend/graphql" },
|
||||
{ "path": "./packages/frontend/i18n" },
|
||||
{ "path": "./packages/frontend/native" },
|
||||
{ "path": "./packages/frontend/track" },
|
||||
{ "path": "./tests/affine-cloud" },
|
||||
{ "path": "./tests/affine-cloud-copilot" },
|
||||
{ "path": "./tests/affine-desktop" },
|
||||
{ "path": "./tests/affine-desktop-cloud" },
|
||||
{ "path": "./tests/affine-local" },
|
||||
{ "path": "./tests/affine-mobile" },
|
||||
{ "path": "./tests/kit" },
|
||||
{ "path": "./tools/cli" },
|
||||
{ "path": "./tools/playstore-auto-bump" },
|
||||
{ "path": "./tools/utils" }
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user