Merged in feat/shared-ts-config (pull request #1610)
Add typescript-config package with shared configs * Move web config to shared * Move design-system ts config to typescript-config package * Move redis-api tsconfig to typescript-config package * Sort tsconfig keys * Update react-library tsconfig Move declaration and declarationMap from base Add sourceMap This fixes Go-to-Definition, debugging and similar in packages/apps where it is consumed * Update base config module and moduleResolution Approved-by: Michael Zetterberg Approved-by: Christian Andolf
This commit is contained in:
@@ -1,30 +1,8 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"extends": "@scandic-hotels/typescript-config/bun.json",
|
||||||
// Enable latest features
|
"compilerOptions": {
|
||||||
"lib": ["ESNext", "DOM"],
|
"paths": {
|
||||||
"target": "ESNext",
|
"@/*": ["./src/*"]
|
||||||
"module": "ESNext",
|
|
||||||
"moduleDetection": "force",
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
"allowJs": true,
|
|
||||||
|
|
||||||
// Bundler mode
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
"verbatimModuleSyntax": true,
|
|
||||||
"noEmit": true,
|
|
||||||
|
|
||||||
// Best practices
|
|
||||||
"strict": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
|
|
||||||
// Some stricter flags (disabled by default)
|
|
||||||
"noUnusedLocals": false,
|
|
||||||
"noUnusedParameters": false,
|
|
||||||
"noPropertyAccessFromIndexSignature": false,
|
|
||||||
"paths": {
|
|
||||||
"@/*": ["./src/*"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,6 +104,7 @@
|
|||||||
"zustand": "^4.5.2"
|
"zustand": "^4.5.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@scandic-hotels/typescript-config": "workspace:*",
|
||||||
"@svgr/webpack": "^8.1.0",
|
"@svgr/webpack": "^8.1.0",
|
||||||
"@testing-library/jest-dom": "^6.4.6",
|
"@testing-library/jest-dom": "^6.4.6",
|
||||||
"@testing-library/react": "^16.0.0",
|
"@testing-library/react": "^16.0.0",
|
||||||
|
|||||||
@@ -1,20 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
"extends": "@scandic-hotels/typescript-config/nextjs.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2022",
|
|
||||||
"lib": ["dom", "dom.iterable", "ES2022"],
|
|
||||||
"allowJs": true,
|
|
||||||
"checkJs": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"strict": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleDetection": "force",
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"isolatedModules": true,
|
|
||||||
"jsx": "preserve",
|
|
||||||
"incremental": true,
|
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
"name": "next"
|
"name": "next"
|
||||||
|
|||||||
@@ -1,25 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"extends": "@scandic-hotels/typescript-config/react-library.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"declaration": true,
|
|
||||||
"target": "ES2022",
|
|
||||||
"useDefineForClassFields": true,
|
|
||||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
||||||
"module": "ESNext",
|
|
||||||
"skipLibCheck": true,
|
|
||||||
|
|
||||||
/* Bundler mode */
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"resolveJsonModule": true,
|
"noEmit": true
|
||||||
"isolatedModules": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
|
|
||||||
/* Linting */
|
|
||||||
"strict": true,
|
|
||||||
"noUnusedLocals": true,
|
|
||||||
"noUnusedParameters": true,
|
|
||||||
"noFallthroughCasesInSwitch": true
|
|
||||||
},
|
},
|
||||||
"include": ["example", "lib"],
|
"include": ["example", "lib"],
|
||||||
"exclude": ["node_modules", "**/*.test.ts"]
|
"exclude": ["node_modules", "**/*.test.ts"]
|
||||||
|
|||||||
16
packages/typescript-config/base.json
Normal file
16
packages/typescript-config/base.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"compilerOptions": {
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"incremental": false,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"lib": ["es2022", "DOM", "DOM.Iterable"],
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"target": "ES2022"
|
||||||
|
}
|
||||||
|
}
|
||||||
11
packages/typescript-config/bun.json
Normal file
11
packages/typescript-config/bun.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"extends": "@scandic-hotels/typescript-config/base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"allowJs": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"target": "ESNext",
|
||||||
|
"verbatimModuleSyntax": true
|
||||||
|
}
|
||||||
|
}
|
||||||
12
packages/typescript-config/nextjs.json
Normal file
12
packages/typescript-config/nextjs.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"extends": "./base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true,
|
||||||
|
"checkJs": true,
|
||||||
|
"incremental": true,
|
||||||
|
"jsx": "preserve",
|
||||||
|
"noEmit": true,
|
||||||
|
"plugins": [{ "name": "next" }]
|
||||||
|
}
|
||||||
|
}
|
||||||
5
packages/typescript-config/package.json
Normal file
5
packages/typescript-config/package.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"name": "@scandic-hotels/typescript-config",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.0"
|
||||||
|
}
|
||||||
13
packages/typescript-config/react-library.json
Normal file
13
packages/typescript-config/react-library.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
|
"extends": "./base.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"sourceMap": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6251,6 +6251,7 @@ __metadata:
|
|||||||
"@radix-ui/react-visually-hidden": "npm:^1.1.0"
|
"@radix-ui/react-visually-hidden": "npm:^1.1.0"
|
||||||
"@react-aria/ssr": "npm:^3.9.5"
|
"@react-aria/ssr": "npm:^3.9.5"
|
||||||
"@scandic-hotels/design-system": "workspace:*"
|
"@scandic-hotels/design-system": "workspace:*"
|
||||||
|
"@scandic-hotels/typescript-config": "workspace:*"
|
||||||
"@sentry/nextjs": "npm:^8.41.0"
|
"@sentry/nextjs": "npm:^8.41.0"
|
||||||
"@svgr/webpack": "npm:^8.1.0"
|
"@svgr/webpack": "npm:^8.1.0"
|
||||||
"@t3-oss/env-nextjs": "npm:^0.9.2"
|
"@t3-oss/env-nextjs": "npm:^0.9.2"
|
||||||
@@ -6344,6 +6345,12 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
|
"@scandic-hotels/typescript-config@workspace:*, @scandic-hotels/typescript-config@workspace:packages/typescript-config":
|
||||||
|
version: 0.0.0-use.local
|
||||||
|
resolution: "@scandic-hotels/typescript-config@workspace:packages/typescript-config"
|
||||||
|
languageName: unknown
|
||||||
|
linkType: soft
|
||||||
|
|
||||||
"@sentry-internal/browser-utils@npm:8.55.0":
|
"@sentry-internal/browser-utils@npm:8.55.0":
|
||||||
version: 8.55.0
|
version: 8.55.0
|
||||||
resolution: "@sentry-internal/browser-utils@npm:8.55.0"
|
resolution: "@sentry-internal/browser-utils@npm:8.55.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user